Skip to content

Commit dd124b2

Browse files
committed
Address observed proposers behaviour (#4192)
## Issue Addressed NA ## Proposed Changes Apply two changes to code introduced in #4179: 1. Remove the `ERRO` log for when we error on `proposer_has_been_observed()`. We were seeing a lot of this in our logs for finalized blocks and it's a bit noisy. 1. Use `false` rather than `true` for `proposal_already_known` when there is an error. If a block raises an error in `proposer_has_been_observed()` then the block must be invalid, so we should process (and reject) it now rather than queuing it. For reference, here is one of the offending `ERRO` logs: ``` ERRO Failed to check observed proposers block_root: 0x5845…878e, source: rpc, error: FinalizedBlock { slot: Slot(5410983), finalized_slot: Slot(5411232) } ``` ## Additional Info NA
1 parent 2b3084f commit dd124b2

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

beacon_node/beacon_chain/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub mod migrate;
3232
mod naive_aggregation_pool;
3333
mod observed_aggregates;
3434
mod observed_attesters;
35-
mod observed_block_producers;
35+
pub mod observed_block_producers;
3636
pub mod observed_operations;
3737
pub mod otb_verification_service;
3838
mod persisted_beacon_chain;

beacon_node/network/src/beacon_processor/worker/sync_methods.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use crate::sync::manager::{BlockProcessType, SyncMessage};
99
use crate::sync::{BatchProcessResult, ChainId};
1010
use beacon_chain::CountUnrealized;
1111
use beacon_chain::{
12-
BeaconChainError, BeaconChainTypes, BlockError, ChainSegmentResult, HistoricalBlockError,
13-
NotifyExecutionLayer,
12+
observed_block_producers::Error as ObserveError, BeaconChainError, BeaconChainTypes,
13+
BlockError, ChainSegmentResult, HistoricalBlockError, NotifyExecutionLayer,
1414
};
1515
use lighthouse_network::PeerAction;
1616
use slog::{debug, error, info, warn};
@@ -85,21 +85,18 @@ impl<T: BeaconChainTypes> Worker<T> {
8585
};
8686
// Check if a block from this proposer is already known. If so, defer processing until later
8787
// to avoid wasting time processing duplicates.
88-
let proposal_already_known = self
88+
let proposal_already_known = match self
8989
.chain
9090
.observed_block_producers
9191
.read()
9292
.proposer_has_been_observed(block.message())
93-
.map_err(|e| {
94-
error!(
95-
self.log,
96-
"Failed to check observed proposers";
97-
"error" => ?e,
98-
"source" => "rpc",
99-
"block_root" => %block_root
100-
);
101-
})
102-
.unwrap_or(true);
93+
{
94+
Ok(is_observed) => is_observed,
95+
// Both of these blocks will be rejected, so reject them now rather
96+
// than re-queuing them.
97+
Err(ObserveError::FinalizedBlock { .. })
98+
| Err(ObserveError::ValidatorIndexTooHigh { .. }) => false,
99+
};
103100
if proposal_already_known {
104101
debug!(
105102
self.log,

0 commit comments

Comments
 (0)