Skip to content

Commit

Permalink
chore: make standalone behave as a leader
Browse files Browse the repository at this point in the history
  • Loading branch information
renancloudwalk committed Jun 2, 2024
1 parent 55904bf commit 3719c85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/eth/consensus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl Consensus {

//FIXME TODO automate the way we gather the leader, instead of using a env var
pub fn is_leader(&self) -> bool {
Self::current_node().unwrap_or("".to_string()) == self.leader_name
Self::current_node().unwrap_or("standalone".to_string()) == self.leader_name
}

pub fn is_follower(&self) -> bool {
Expand All @@ -211,6 +211,7 @@ impl Consensus {
}

pub fn should_forward(&self) -> bool {
tracing::info!(is_leader = self.is_leader(), sync_online_enabled = self.importer_config.is_some(), "handling request forward");
if self.is_leader() && self.importer_config.is_none() {
return false; // the leader is on miner mode and should deal with the requests
}
Expand Down

0 comments on commit 3719c85

Please sign in to comment.