mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Detect invalid proposer signature on RPC block processing (#6519)
Complements - https://github.com/sigp/lighthouse/pull/6321 by detecting if the proposer signature is valid or not during RPC block processing. In lookup sync, if the invalid signature signature is the proposer signature, it's not deterministic on the block root. So we should only penalize the sending peer and retry. Otherwise, if it's on the body we should drop the lookup and penalize all peers that claim to have imported the block
This commit is contained in:
@@ -1677,7 +1677,7 @@ fn test_parent_lookup_too_many_processing_attempts_must_blacklist() {
|
||||
rig.assert_not_failed_chain(block_root);
|
||||
// send the right parent but fail processing
|
||||
rig.parent_lookup_block_response(id, peer_id, Some(parent.clone().into()));
|
||||
rig.parent_block_processed(block_root, BlockError::InvalidSignature.into());
|
||||
rig.parent_block_processed(block_root, BlockError::BlockSlotLimitReached.into());
|
||||
rig.parent_lookup_block_response(id, peer_id, None);
|
||||
rig.expect_penalty(peer_id, "lookup_block_processing_failure");
|
||||
}
|
||||
@@ -2575,7 +2575,7 @@ mod deneb_only {
|
||||
fn invalid_parent_processed(mut self) -> Self {
|
||||
self.rig.parent_block_processed(
|
||||
self.block_root,
|
||||
BlockProcessingResult::Err(BlockError::ProposalSignatureInvalid),
|
||||
BlockProcessingResult::Err(BlockError::BlockSlotLimitReached),
|
||||
);
|
||||
assert_eq!(self.rig.active_parent_lookups_count(), 1);
|
||||
self
|
||||
@@ -2584,7 +2584,7 @@ mod deneb_only {
|
||||
fn invalid_block_processed(mut self) -> Self {
|
||||
self.rig.single_block_component_processed(
|
||||
self.block_req_id.expect("block request id").lookup_id,
|
||||
BlockProcessingResult::Err(BlockError::ProposalSignatureInvalid),
|
||||
BlockProcessingResult::Err(BlockError::BlockSlotLimitReached),
|
||||
);
|
||||
self.rig.assert_single_lookups_count(1);
|
||||
self
|
||||
|
||||
Reference in New Issue
Block a user