Skip to content

Commit 3ac7bd5

Browse files
committed
Add timeboost-config.
1 parent bb374e2 commit 3ac7bd5

File tree

25 files changed

+104
-55
lines changed

25 files changed

+104
-55
lines changed

Cargo.lock

Lines changed: 26 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ members = [
1212
"tests",
1313
"timeboost",
1414
"timeboost-builder",
15+
"timeboost-config",
1516
"timeboost-contract",
1617
"timeboost-crypto",
1718
"timeboost-proto",

tests/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ sailfish = { path = "../sailfish", features = ["test"] }
2323
sailfish-types = { path = "../sailfish-types" }
2424
serde = { workspace = true }
2525
timeboost = { path = "../timeboost" }
26-
timeboost-builder = { path = "../timeboost-builder" }
27-
timeboost-crypto = { path = "../timeboost-crypto" }
28-
timeboost-sequencer = { path = "../timeboost-sequencer" }
29-
timeboost-types = { path = "../timeboost-types" }
3026
timeboost-utils = { path = "../timeboost-utils", features = ["test"] }
3127
tokio = { workspace = true }
3228
tokio-stream = { workspace = true }

tests/src/tests/timeboost.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ use cliquenet::{Address, AddressableCommittee};
1111
use multisig::Keypair;
1212
use multisig::{Committee, x25519};
1313
use sailfish_types::UNKNOWN_COMMITTEE_ID;
14+
use timeboost::builder::CertifierConfig;
15+
use timeboost::conf::{ChainConfig, ParentChain};
16+
use timeboost::crypto::prelude::DkgDecKey;
17+
use timeboost::sequencer::SequencerConfig;
1418
use timeboost::types::BundleVariant;
15-
use timeboost_builder::CertifierConfig;
16-
use timeboost_crypto::prelude::DkgDecKey;
17-
use timeboost_sequencer::SequencerConfig;
18-
use timeboost_types::{ChainConfig, DecryptionKeyCell, KeyStore, ParentChain};
19+
use timeboost::types::{DecryptionKeyCell, KeyStore};
1920
use timeboost_utils::load_generation::make_bundle;
2021
use tokio::sync::broadcast;
2122
use tokio::time::{Duration, sleep};

tests/src/tests/timeboost/handover.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ use sailfish::consensus::Consensus;
1414
use sailfish::rbc::Rbc;
1515
use sailfish::types::{ConsensusTime, RoundNumber, Timestamp};
1616
use sailfish::{Coordinator, Event};
17-
use timeboost_crypto::prelude::DkgDecKey;
18-
use timeboost_sequencer::SequencerConfig;
19-
use timeboost_types::{ChainConfig, DecryptionKeyCell, KeyStore, ParentChain};
17+
use timeboost::conf::{ChainConfig, ParentChain};
18+
use timeboost::crypto::prelude::DkgDecKey;
19+
use timeboost::sequencer::SequencerConfig;
20+
use timeboost::types::{DecryptionKeyCell, KeyStore};
2021
use timeboost_utils::types::logging::init_logging;
2122
use tokio::select;
2223
use tokio::sync::{broadcast, mpsc};

tests/src/tests/timeboost/transaction_order.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::time::Duration;
66
use alloy::primitives::B256;
77
use metrics::NoMetrics;
88
use sailfish_types::RoundNumber;
9-
use timeboost_sequencer::{Output, Sequencer};
9+
use timeboost::sequencer::{Output, Sequencer};
1010
use timeboost_utils::types::logging::init_logging;
1111
use tokio::select;
1212
use tokio::sync::broadcast::error::RecvError;

timeboost-config/Cargo.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[package]
2+
name = "timeboost-config"
3+
version.workspace = true
4+
edition.workspace = true
5+
rust-version.workspace = true
6+
7+
[dependencies]
8+
alloy = { workspace = true }
9+
anyhow = { workspace = true }
10+
ark-std = { workspace = true }
11+
bon = { workspace = true }
12+
clap = { workspace = true }
13+
cliquenet = { path = "../cliquenet" }
14+
jiff = { workspace = true }
15+
multisig = { path = "../multisig" }
16+
rand = { workspace = true }
17+
secp256k1 = { workspace = true }
18+
serde = { workspace = true }
19+
thiserror = { workspace = true }
20+
timeboost-crypto = { path = "../timeboost-crypto" }
21+
tokio = { workspace = true }
22+
toml = { workspace = true }
23+
tracing = { workspace = true }
24+
url = { workspace = true }
25+
26+
[[bin]]
27+
name = "mkconfig"
28+
path = "src/binaries/mkconfig.rs"

timeboost-utils/src/binaries/mkconfig.rs renamed to timeboost-config/src/binaries/mkconfig.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ use clap::{Parser, ValueEnum};
1111
use cliquenet::Address;
1212
use multisig::x25519;
1313
use secp256k1::rand::SeedableRng as _;
14-
use timeboost_crypto::prelude::{DkgDecKey, DkgEncKey};
15-
use timeboost_types::{ChainConfig, ParentChain};
16-
use timeboost_utils::config::{
14+
use timeboost_config::{ChainConfig, ParentChain};
15+
use timeboost_config::{
1716
CommitteeConfig, CommitteeMember, InternalNet, NodeConfig, NodeKeyConfig, NodeKeypairConfig,
1817
NodeNetConfig, PublicNet,
1918
};
20-
use timeboost_utils::types::logging;
19+
use timeboost_crypto::prelude::{DkgDecKey, DkgEncKey};
2120
use url::Url;
2221

2322
#[derive(Clone, Debug, Parser)]
@@ -205,8 +204,6 @@ impl Args {
205204
}
206205

207206
fn main() -> Result<()> {
208-
logging::init_logging();
209-
210207
let args = Args::parse();
211208
args.mk_config()?;
212209

timeboost-types/src/chain_config.rs renamed to timeboost-config/src/chain.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
use alloy::eips::BlockNumberOrTag;
2-
use alloy::network::EthereumWallet;
32
use alloy::primitives::Address;
4-
use alloy::providers::ProviderBuilder;
53
use bon::Builder;
64
use serde::{Deserialize, Serialize};
75
use url::Url;
86

9-
use crate::{HttpProvider, HttpProviderWithWallet};
10-
117
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Builder)]
128
pub struct ChainConfig {
139
namespace: u64,
@@ -53,14 +49,4 @@ impl ParentChain {
5349
pub fn key_manager_contract(&self) -> &Address {
5450
&self.key_manager_contract
5551
}
56-
57-
pub fn provider(&self) -> HttpProvider {
58-
ProviderBuilder::new().connect_http(self.rpc_url.clone())
59-
}
60-
61-
pub fn provider_with_wallet(&self, wallet: EthereumWallet) -> HttpProviderWithWallet {
62-
ProviderBuilder::new()
63-
.wallet(wallet)
64-
.connect_http(self.rpc_url.clone())
65-
}
6652
}

timeboost-utils/src/config.rs renamed to timeboost-config/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ use cliquenet::Address;
33
use multisig::x25519;
44
use serde::{Deserialize, Serialize};
55
use timeboost_crypto::prelude::{DkgDecKey, DkgEncKey};
6-
use timeboost_types::ChainConfig;
76
use tracing::error;
87

8+
mod chain;
9+
10+
pub use chain::{ChainConfig, ChainConfigBuilder, ParentChain, ParentChainBuilder};
11+
912
pub const DECRYPTER_PORT_OFFSET: u16 = 1;
1013
pub const CERTIFIER_PORT_OFFSET: u16 = 2;
1114

0 commit comments

Comments
 (0)