-
Notifications
You must be signed in to change notification settings - Fork 246
fix(syncing): skip forced txs checks for p2p blocks #2922
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
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 |
|---|---|---|
|
|
@@ -536,7 +536,7 @@ func (s *Syncer) processHeightEvent(event *common.DAHeightEvent) { | |
| } | ||
|
|
||
| // only save to p2p stores if the event came from DA | ||
| if event.Source == common.SourceDA { | ||
| if event.Source == common.SourceDA { // TODO(@julienrbrt): To be reverted once DA Hints are merged (https://github.com/evstack/ev-node/pull/2891) | ||
| g, ctx := errgroup.WithContext(s.ctx) | ||
| g.Go(func() error { | ||
| // broadcast header locally only — prevents spamming the p2p network with old height notifications, | ||
|
|
@@ -591,11 +591,13 @@ func (s *Syncer) trySyncNextBlock(event *common.DAHeightEvent) error { | |
| } | ||
|
|
||
| // Verify forced inclusion transactions if configured | ||
| if err := s.verifyForcedInclusionTxs(currentState, data); err != nil { | ||
| s.logger.Error().Err(err).Uint64("height", nextHeight).Msg("forced inclusion verification failed") | ||
| if errors.Is(err, errMaliciousProposer) { | ||
| s.cache.RemoveHeaderDAIncluded(headerHash) | ||
| return err | ||
| if event.Source == common.SourceDA { | ||
| if err := s.verifyForcedInclusionTxs(currentState, data); err != nil { | ||
| s.logger.Error().Err(err).Uint64("height", nextHeight).Msg("forced inclusion verification failed") | ||
| if errors.Is(err, errMaliciousProposer) { | ||
| s.cache.RemoveHeaderDAIncluded(headerHash) | ||
| return err | ||
| } | ||
| } | ||
|
Comment on lines
+595
to
601
Contributor
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. The current error handling for Any error from I suggest simplifying the error handling to always return the error, which is also more consistent with how errors from if err := s.verifyForcedInclusionTxs(currentState, data); err != nil {
s.logger.Error().Err(err).Uint64("height", nextHeight).Msg("forced inclusion verification failed")
s.cache.RemoveHeaderDAIncluded(headerHash)
return err
} |
||
| } | ||
|
|
||
|
|
||
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.
turns out the todo is on the wrong condition, but we'll get it :D (should have been L594)