Skip to content

Commit 7808c5a

Browse files
authored
fix(syncing): skip forced txs checks for p2p blocks (#2922)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. NOTE: PR titles should follow semantic commits: https://www.conventionalcommits.org/en/v1.0.0/ --> ## Overview Temporary fix until #2891. After #2891 the verification for p2p blocks will be done in the background. ref: #2906 <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. Ex: Closes #<issue number> -->
1 parent c3775f8 commit 7808c5a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

block/internal/syncing/syncer.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ func (s *Syncer) processHeightEvent(event *common.DAHeightEvent) {
536536
}
537537

538538
// only save to p2p stores if the event came from DA
539-
if event.Source == common.SourceDA {
539+
if event.Source == common.SourceDA { // TODO(@julienrbrt): To be reverted once DA Hints are merged (https://github.com/evstack/ev-node/pull/2891)
540540
g, ctx := errgroup.WithContext(s.ctx)
541541
g.Go(func() error {
542542
// 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 {
591591
}
592592

593593
// Verify forced inclusion transactions if configured
594-
if err := s.verifyForcedInclusionTxs(currentState, data); err != nil {
595-
s.logger.Error().Err(err).Uint64("height", nextHeight).Msg("forced inclusion verification failed")
596-
if errors.Is(err, errMaliciousProposer) {
597-
s.cache.RemoveHeaderDAIncluded(headerHash)
598-
return err
594+
if event.Source == common.SourceDA {
595+
if err := s.verifyForcedInclusionTxs(currentState, data); err != nil {
596+
s.logger.Error().Err(err).Uint64("height", nextHeight).Msg("forced inclusion verification failed")
597+
if errors.Is(err, errMaliciousProposer) {
598+
s.cache.RemoveHeaderDAIncluded(headerHash)
599+
return err
600+
}
599601
}
600602
}
601603

0 commit comments

Comments
 (0)