Skip to content

Commit

Permalink
fix: remove term from peers (#1041)
Browse files Browse the repository at this point in the history
  • Loading branch information
renancloudwalk authored Jun 8, 2024
1 parent 5fd57d8 commit 3c98711
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/eth/consensus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ struct Peer {
match_index: u64,
next_index: u64,
role: Role,
term: u64,
receiver: Arc<Mutex<broadcast::Receiver<Block>>>,
}

Expand Down Expand Up @@ -542,7 +541,6 @@ impl Consensus {
match_index: 0,
next_index: 0,
role: Role::Follower, // FIXME it won't be always follower, we need to check the leader or candidates
term: 0, // Replace with actual term
receiver: Arc::new(Mutex::new(consensus.broadcast_sender.subscribe())),
};
peers.push((peer_address.clone(), peer));
Expand Down Expand Up @@ -587,7 +585,6 @@ impl Consensus {
match_index: 0,
next_index: 0,
role: Role::Follower, //FIXME it wont be always follower, we need to check the leader or candidates
term: 0, // Replace with actual term
receiver: Arc::new(Mutex::new(consensus.broadcast_sender.subscribe())),
};
peers.push((PeerAddress::new(address, jsonrpc_port, grpc_port), peer));
Expand Down Expand Up @@ -663,7 +660,7 @@ impl Consensus {
#[cfg(feature = "metrics")]
metrics::inc_append_entries(start.elapsed());

tracing::info!(match_index = peer.match_index, next_index = peer.next_index, role = ?peer.role, term = peer.term, "current follower state on election"); //TODO also move this to metrics
tracing::info!(match_index = peer.match_index, next_index = peer.next_index, role = ?peer.role, "current follower state on election"); //TODO also move this to metrics

match StatusCode::try_from(response.status) {
Ok(StatusCode::AppendSuccess) => Ok(()),
Expand Down

0 comments on commit 3c98711

Please sign in to comment.