Skip to content

Commit

Permalink
skipping self for checking in hbbft early epoch end manager
Browse files Browse the repository at this point in the history
  • Loading branch information
SurfingNerd committed Nov 27, 2023
1 parent 437c289 commit b5bd4c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use ethereum_types::Address;
use types::ids::BlockId;

use crate::client::BlockChainClient;
use crate::{client::BlockChainClient, ethereum::public_key_to_address::public_key_to_address};
use std::time::{Duration, Instant};

use super::{hbbft_message_memorium::HbbftMessageMemorium, NodeId};
Expand Down Expand Up @@ -148,6 +148,12 @@ impl HbbftEarlyEpochEndManager {
// get current state of missing validators from hbbftMemorium.
if let Some(epoch_history) = memorium.get_staking_epoch_history(block_num) {
for validator in &self.validators.clone() {
let validator_eth_address = public_key_to_address(&validator.0);
// we do not have to check ourself.
if validator_eth_address == *mining_address {
continue;
}

// we need to exclude ourself.
if let Some(node_history) = epoch_history.get_history_for_node(validator) {
let last_sealing_message = node_history.get_sealing_message();
Expand Down
3 changes: 1 addition & 2 deletions crates/ethcore/src/engines/hbbft/hbbft_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -954,8 +954,7 @@ impl HoneyBadgerBFT {
let epoch_start_block = hbbft_state.get_current_posdao_epoch_start_block();
let mut validator_set = hbbft_state.get_validator_set();
// todo: remove own node from validator set.



// we got everything we need from hbbft_state - drop lock ASAP.
std::mem::drop(hbbft_state);

Expand Down

0 comments on commit b5bd4c3

Please sign in to comment.