Skip to content

Conversation

james-prysm
Copy link
Contributor

@james-prysm james-prysm commented Oct 9, 2025

What type of PR is this?

Other

What does this PR do? Why is it needed?

The gossip ignored issue is likely caused by the below however the error didn't provide clarity on the underlying reason.
- Node A produces block at slot N
- Node A broadcasts block + attestations
- Node B receives attestations for block N before it finishes processing block N
- Node B's gossip validation ignores attestations because block N is not yet in forkchoice
- This is logged as "Gossip message was ignored"

Which issues(s) does this PR fix?

Fixes #5812

alternative to #15840

Other notes for review

Acknowledgements

@james-prysm james-prysm changed the title changeing ErrNotDescendantOfFinalized to ErrRootNotInForkChoice changing ErrNotDescendantOfFinalized to ErrRootNotInForkChoice Oct 9, 2025
@james-prysm james-prysm marked this pull request as ready for review October 10, 2025 18:25
@james-prysm james-prysm requested a review from potuz October 10, 2025 18:26
@potuz
Copy link
Contributor

potuz commented Oct 10, 2025

- Node B receives attestations for block N before it finishes processing block N
- Node B's gossip validation rejects attestations because block N is not yet in forkchoice

This can't be accurate, we do not reject attestations for blocks we do not know.

Copy link
Contributor

@potuz potuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very dangerous change, previously a simple check could result in an error being logged because the requested root was not in forkchoice, now the same error will also mark a block as invalid?


// ErrRootNotInForkchoice is returned when a root cannot be found in forkchoice.
func ErrRootNotInForkchoice(root [fieldparams.RootLength]byte) invalidBlock {
return invalidBlock{error: fmt.Errorf("root %#x not in forkchoice", root), root: root}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this? this is a very dangerous change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah, my bad, read this incorrectly, this is fine, reviewing.

// Shared validations for the entire bucket.
if !s.cfg.chain.InForkchoice(bytesutil.ToBytes32(data.BeaconBlockRoot)) {
log.WithError(blockchain.ErrNotDescendantOfFinalized).WithField("root", fmt.Sprintf("%#x", data.BeaconBlockRoot)).Debug("Failed forkchoice check for bucket")
log.WithError(blockchain.ErrRootNotInForkchoice(bytesutil.ToBytes32(data.BeaconBlockRoot))).Debug("Failed forkchoice check for bucket")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we need to return an invalid block and a root here.

if !s.cfg.chain.InForkchoice(bytesutil.ToBytes32(data.BeaconBlockRoot)) {
tracing.AnnotateError(span, blockchain.ErrNotDescendantOfFinalized)
return pubsub.ValidationIgnore, blockchain.ErrNotDescendantOfFinalized
tracing.AnnotateError(span, blockchain.ErrRootNotInForkchoice(bytesutil.ToBytes32(data.BeaconBlockRoot)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

if !s.cfg.chain.InForkchoice(blockRoot) {
tracing.AnnotateError(span, blockchain.ErrNotDescendantOfFinalized)
return pubsub.ValidationIgnore, blockchain.ErrNotDescendantOfFinalized
tracing.AnnotateError(span, blockchain.ErrRootNotInForkchoice(blockRoot))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

func (s *Service) validatePhase0Block(ctx context.Context, blk interfaces.ReadOnlySignedBeaconBlock, blockRoot [32]byte) (state.BeaconState, error) {
if !s.cfg.chain.InForkchoice(blk.Block().ParentRoot()) {
s.setBadBlock(ctx, blockRoot)
return nil, blockchain.ErrNotDescendantOfFinalized
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slasher kills beacon node: dropping peers

2 participants