-
Notifications
You must be signed in to change notification settings - Fork 1.2k
changing ErrNotDescendantOfFinalized to ErrRootNotInForkChoice #15836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,7 +117,7 @@ func (s *Service) processAttestationBucket(ctx context.Context, bucket *attestat | |
|
||
// 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") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
return | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,8 +166,8 @@ func (s *Service) validateAggregatedAtt(ctx context.Context, signed ethpb.Signed | |
|
||
// Verify current finalized checkpoint is an ancestor of the block defined by the attestation's beacon block root. | ||
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))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
return pubsub.ValidationIgnore, blockchain.ErrRootNotInForkchoice(bytesutil.ToBytes32(data.BeaconBlockRoot)) | ||
} | ||
|
||
bs, err := s.cfg.chain.AttestationTargetState(ctx, data.Target) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,8 +115,8 @@ func (s *Service) validateCommitteeIndexBeaconAttestation( | |
s.savePendingAtt(att) | ||
} | ||
if !s.cfg.chain.InForkchoice(blockRoot) { | ||
tracing.AnnotateError(span, blockchain.ErrNotDescendantOfFinalized) | ||
return pubsub.ValidationIgnore, blockchain.ErrNotDescendantOfFinalized | ||
tracing.AnnotateError(span, blockchain.ErrRootNotInForkchoice(blockRoot)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
return pubsub.ValidationIgnore, blockchain.ErrRootNotInForkchoice(blockRoot) | ||
} | ||
if err = s.cfg.chain.VerifyLmdFfgConsistency(ctx, att); err != nil { | ||
tracing.AnnotateError(span, err) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -285,7 +285,7 @@ func (s *Service) validateBeaconBlock(ctx context.Context, blk interfaces.ReadOn | |
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
return nil, blockchain.ErrRootNotInForkchoice(blk.Block().ParentRoot()) | ||
} | ||
|
||
parentState, err := s.cfg.stateGen.StateByRoot(ctx, blk.Block().ParentRoot()) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### Changed | ||
|
||
- changed ErrNotDescendantOfFinalized to ErrRootNotInForkChoice. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.