From c4749449430c2732c54b8cfda01eb401049b7d97 Mon Sep 17 00:00:00 2001 From: Josh King Date: Mon, 21 Oct 2024 11:36:38 +1100 Subject: [PATCH] typo --- Cargo.lock | 11 ++++++++++- Cargo.toml | 12 +++++++++++- anchor/qbft/src/lib.rs | 11 ++++------- anchor/src/main.rs | 1 - 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3bf0bbb..767bda5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2639,7 +2639,7 @@ source = "git+https://github.com/sigp/lighthouse?branch=anchor#73743a53d1255f342 dependencies = [ "metrics", "parking_lot", - "types", + "types 0.2.1", ] [[package]] @@ -3065,6 +3065,15 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "types" +version = "0.1.0" +dependencies = [ + "arbitrary", + "ethereum_serde_utils", + "serde", +] + [[package]] name = "types" version = "0.2.1" diff --git a/Cargo.toml b/Cargo.toml index c650c26..1351015 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,12 @@ [workspace] # Extra tooling projects will be added. -members = ["anchor", "anchor/client", "anchor/http_api", "anchor/qbft"] +members = [ + "anchor", + "anchor/client", + "anchor/http_api", + "anchor/qbft", + "anchor/types", +] resolver = "2" [workspace.package] @@ -10,6 +16,7 @@ edition = "2021" client = { path = "anchor/client" } qbft = { path = "anchor/qbft" } http_api = { path = "anchor/http_api" } +types = { path = "anchor/types" } task_executor = { git = "https://github.com/sigp/lighthouse", branch = "anchor", default-features = false, features = [ "tracing", ] } @@ -24,6 +31,7 @@ futures = "0.3.30" # dirs = "3" hyper = "1.4" serde = { version = "1.0.208", features = ["derive"] } +ethereum_serde_utils = "0.7.0" tokio = { version = "1.39.2", features = [ "rt", "rt-multi-thread", @@ -33,6 +41,8 @@ tokio = { version = "1.39.2", features = [ ] } tracing = "0.1.40" tracing-subscriber = { version = "0.3.18", features = ["fmt", "env-filter"] } +arbitrary = { version = "1.3.2", features = ["derive"] } + [profile.maxperf] inherits = "release" diff --git a/anchor/qbft/src/lib.rs b/anchor/qbft/src/lib.rs index 664787d..d76cb80 100644 --- a/anchor/qbft/src/lib.rs +++ b/anchor/qbft/src/lib.rs @@ -234,17 +234,17 @@ where fn start_round(&mut self) { debug!(round = *self.current_round, "Starting new round",); - // Remove old unnecessary round change message + // Remove round change messages that would be for previous rounds self.round_change_messages .retain(|&round, _value| round >= self.current_round); + // Initialise the instance state for the round + self.state = InstanceState::AwaitingProposal; + // Check if we are the leader if self.check_leader(&self.operator_id()) { // We are the leader debug!("Current leader"); - - self.state = InstanceState::AwaitingProposal; - // Check justification of round change quorum if let Some(validated_data) = self.justify_round_change_quorum().cloned() { debug!( @@ -257,9 +257,6 @@ where self.send_proposal(self.start_data.clone()); self.send_prepare(self.start_data.clone()); } - } else { - // We are not the leader, so await a proposal from a leader - self.state = InstanceState::AwaitingProposal; } } diff --git a/anchor/src/main.rs b/anchor/src/main.rs index b95b244..b817f66 100644 --- a/anchor/src/main.rs +++ b/anchor/src/main.rs @@ -1,7 +1,6 @@ use tracing::{error, info}; mod environment; - use client::Client; use environment::Environment; use task_executor::ShutdownReason;