Fix ignored gossip attestation validation for early arriving attestations (#15840)

* debug log

* undo debug logs

* fix: return if block not available

* changelog
This commit is contained in:
satushh
2025-10-12 20:19:45 +01:00
committed by GitHub
parent 6973cd2c5f
commit 0aa248e663
2 changed files with 7 additions and 0 deletions

View File

@@ -112,8 +112,12 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(
// Verify the block being voted and the processed state is in beaconDB and the block has passed validation if it's in the beaconDB.
blockRoot := bytesutil.ToBytes32(data.BeaconBlockRoot)
if !s.hasBlockAndState(ctx, blockRoot) {
// Block not yet available - save attestation to pending queue for later processing
// when the block arrives. Return ValidationIgnore so gossip doesn't potentially penalize the peer.
s.savePendingAtt(att)
return pubsub.ValidationIgnore, nil
}
// Block exists - verify it's in forkchoice (i.e., it's a descendant of the finalized checkpoint)
if !s.cfg.chain.InForkchoice(blockRoot) {
tracing.AnnotateError(span, blockchain.ErrNotDescendantOfFinalized)
return pubsub.ValidationIgnore, blockchain.ErrNotDescendantOfFinalized

View File

@@ -0,0 +1,3 @@
### Fixed
- Fixed [#15812](https://github.com/OffchainLabs/prysm/issues/15812): Gossip attestation validation incorrectly rejecting attestations that arrive before their referenced blocks. Previously, attestations were saved to the pending queue but immediately rejected by forkchoice validation, causing "not descendant of finalized checkpoint" errors. Now attestations for missing blocks return `ValidationIgnore` without error, allowing them to be properly processed when their blocks arrive. This eliminates false positive rejections and prevents potential incorrect peer downscoring during network congestion.