mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 06:44:35 +00:00
This PR reverts #8179.
It turns out that the fix was invalid because an unknown root is always not a finalized descendant:
522bd9e9c6/consensus/proto_array/src/proto_array.rs (L976-L979)
so for any data columns with unknown parents, it will always penalise the gossip peer and disconnect it pretty quickly. On a small network, the node may lose all of its peers.
The impact is pretty obvious when the peer count is small and sync speed is slow, and is therefore easily reproducible by running a fresh supernode on devnet-3.
This isn't as obvious on a live testnet like holesky / sepolia, we haven't noticed this, probably due to its high peer count and sync speed - the nodes might be able to reach head quickly before losing too many peers.
The previous behaviour isn't ideal but safe: triggering unknown parent lookup and penalise the bad peer if it happens to be malicious or faulty. So for now it's safer to revert the change and plan for a proper fix after the v8 release.
Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
This commit is contained in:
@@ -626,21 +626,22 @@ fn verify_parent_block_and_finalized_descendant<T: BeaconChainTypes>(
|
||||
chain: &BeaconChain<T>,
|
||||
) -> Result<ProtoBlock, GossipDataColumnError> {
|
||||
let fork_choice = chain.canonical_head.fork_choice_read_lock();
|
||||
let block_parent_root = data_column.block_parent_root();
|
||||
|
||||
// Do not process a column that does not descend from the finalized root.
|
||||
if !fork_choice.is_finalized_checkpoint_or_descendant(block_parent_root) {
|
||||
return Err(GossipDataColumnError::NotFinalizedDescendant { block_parent_root });
|
||||
}
|
||||
|
||||
// We have already verified that the column is past finalization, so we can
|
||||
// just check fork choice for the block's parent.
|
||||
let block_parent_root = data_column.block_parent_root();
|
||||
let Some(parent_block) = fork_choice.get_block(&block_parent_root) else {
|
||||
return Err(GossipDataColumnError::ParentUnknown {
|
||||
parent_root: block_parent_root,
|
||||
});
|
||||
};
|
||||
|
||||
// Do not process a column that does not descend from the finalized root.
|
||||
// We just loaded the parent_block, so we can be sure that it exists in fork choice.
|
||||
if !fork_choice.is_finalized_checkpoint_or_descendant(block_parent_root) {
|
||||
return Err(GossipDataColumnError::NotFinalizedDescendant { block_parent_root });
|
||||
}
|
||||
|
||||
Ok(parent_block)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user