Skip to content

Commit 2c5fdbf

Browse files
committed
updates
1 parent 97345be commit 2c5fdbf

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

block/components.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,15 @@ func NewAggregatorComponents(
246246
return nil, fmt.Errorf("failed to create reaper: %w", err)
247247
}
248248

249+
if config.Node.BasedSequencer { // no submissions needed for bases sequencer
250+
return &Components{
251+
Executor: executor,
252+
Reaper: reaper,
253+
Cache: cacheManager,
254+
errorCh: errorCh,
255+
}, nil
256+
}
257+
249258
// Create DA submitter for aggregator nodes (with signer for submission)
250259
daSubmitter := submitting.NewDASubmitter(da, config, genesis, blockOpts, metrics, logger)
251260
submitter := submitting.NewSubmitter(

block/internal/syncing/syncer.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,11 @@ func (s *Syncer) trySyncNextBlock(event *common.DAHeightEvent) error {
466466
// Verify forced inclusion transactions if configured
467467
if err := s.verifyForcedInclusionTxs(currentState, data); err != nil {
468468
s.logger.Error().Err(err).Uint64("height", nextHeight).Msg("forced inclusion verification failed")
469-
// TODO(@julienrbrt): Eventually halt the syncer and request the node to be started using the based sequencer.
469+
if errors.Is(err, errMaliciousProposer) {
470+
s.logger.Error().Msg("Restart with based sequencer.")
471+
s.cache.RemoveHeaderDAIncluded(headerHash)
472+
return err
473+
}
470474
}
471475

472476
// Apply block
@@ -586,6 +590,8 @@ func (s *Syncer) validateBlock(currState types.State, data *types.Data, header *
586590
return nil
587591
}
588592

593+
var errMaliciousProposer = errors.New("malicious proposer detected")
594+
589595
// verifyForcedInclusionTxs verifies that all forced inclusion transactions from DA are included in the block
590596
func (s *Syncer) verifyForcedInclusionTxs(currentState types.State, data *types.Data) error {
591597
if s.daRetriever == nil {
@@ -631,7 +637,7 @@ func (s *Syncer) verifyForcedInclusionTxs(currentState types.State, data *types.
631637
Int("missing_count", len(missingTxs)).
632638
Int("total_forced", len(forcedIncludedTxsEvent.Txs)).
633639
Msg("SEQUENCER IS MALICIOUS: forced inclusion transactions missing from block")
634-
return fmt.Errorf("sequencer is malicious: %d forced inclusion transactions not included in block", len(missingTxs))
640+
return errors.Join(errMaliciousProposer, fmt.Errorf("sequencer is malicious: %d forced inclusion transactions not included in block", len(missingTxs)))
635641
}
636642

637643
s.logger.Debug().

0 commit comments

Comments
 (0)