Skip to content

Commit

Permalink
consensus wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jking-aus committed Oct 1, 2024
1 parent 271b1ad commit a2508fe
Show file tree
Hide file tree
Showing 11 changed files with 202 additions and 1,125 deletions.
96 changes: 96 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tokio = { version = "1.39.2", features = [
tracing = "0.1.40"
git-version = "0.3.9"
target_info = "0.1.0"
tracing-subscriber = "0.3.18"

[profile.maxperf]
inherits = "release"
Expand Down
12 changes: 6 additions & 6 deletions anchor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ sensitive_url = { workspace = true }
async-channel = { workspace = true }
clap = { workspace = true }
dirs = { workspace = true }
ethereum_hashing = { workspace = true }
futures = { workspace = true }
serde = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
git-version = { workspace = true }
ethereum_hashing = { workspace = true }
futures = { workspace = true }
serde = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
git-version = { workspace = true }
target_info = { workspace = true }
client = { workspace = true }

Expand Down
3 changes: 2 additions & 1 deletion anchor/qbft/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ name = "qbft"
path = "src/lib.rs"

[dependencies]
tokio = { workspace = true }
tokio = { workspace = true, features = ["sync"] }
tracing = { workspace = true }
futures = { workspace = true }
tracing-subscriber = { workspace = true }
6 changes: 6 additions & 0 deletions anchor/qbft/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ where
pub instance_height: usize,
pub round: usize,
pub committee_size: usize,
pub committee_members: Vec<usize>,
pub quorum_size: usize,
pub round_time: Duration,
pub leader_fn: F,
Expand Down Expand Up @@ -46,6 +47,10 @@ impl<F: Clone + LeaderFunction> Config<F> {
self.committee_size
}

pub fn commmittee_members(&self) -> Vec<usize> {
self.committee_members.clone()
}

/// The quorum size required for the committee to reach consensus
pub fn quorum_size(&self) -> usize {
self.quorum_size
Expand Down Expand Up @@ -91,6 +96,7 @@ impl Default for ConfigBuilder<DefaultLeaderFunction> {
instance_id: 0,
instance_height: 0,
committee_size: 5,
committee_members: vec![0, 1, 2, 3, 4],
quorum_size: 4,
round: 0,
round_time: Duration::new(2, 0),
Expand Down
Loading

0 comments on commit a2508fe

Please sign in to comment.