From 09bfa2f8e0876b33338ae44bf457779b27fcfc30 Mon Sep 17 00:00:00 2001 From: Tudor Malene Date: Tue, 7 Jan 2025 14:16:35 +0200 Subject: [PATCH] remove dead code (#2238) --- go/enclave/nodetype/sequencer.go | 12 ++---------- go/enclave/storage/interfaces.go | 4 ---- go/enclave/storage/storage.go | 9 --------- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/go/enclave/nodetype/sequencer.go b/go/enclave/nodetype/sequencer.go index 7c32d6416..182840eb2 100644 --- a/go/enclave/nodetype/sequencer.go +++ b/go/enclave/nodetype/sequencer.go @@ -414,16 +414,8 @@ func (s *sequencer) OnL1Fork(ctx context.Context, fork *common.ChainFork) error return fmt.Errorf("could not duplicate batches. Cause %w", err) } - rollup, err := s.storage.FetchReorgedRollup(ctx, fork.NonCanonicalPath) - if err == nil { - s.logger.Error("Reissue rollup", log.RollupHashKey, rollup) - // todo - tudor - finalise the logic to reissue a rollup when the block used for compression was reorged - return nil - } - if !errors.Is(err, errutil.ErrNotFound) { - return fmt.Errorf("could not call FetchReorgedRollup. Cause: %w", err) - } - + // note: there is no need to do anything about Rollups that were published against re-orged blocks + // because the state machine in the host will detect that case return nil } diff --git a/go/enclave/storage/interfaces.go b/go/enclave/storage/interfaces.go index 9b641de17..6c2ba7e2b 100644 --- a/go/enclave/storage/interfaces.go +++ b/go/enclave/storage/interfaces.go @@ -32,10 +32,6 @@ type BlockResolver interface { StoreBlock(ctx context.Context, block *types.Header, fork *common.ChainFork) error // IsAncestor returns true if maybeAncestor is an ancestor of the L1 BlockHeader, and false otherwise IsAncestor(ctx context.Context, block *types.Header, maybeAncestor *types.Header) bool - // IsBlockAncestor returns true if maybeAncestor is an ancestor of the L1 BlockHeader, and false otherwise - // Takes into consideration that the BlockHeader to verify might be on a branch we haven't received yet - // todo (low priority) - this is super confusing, analyze the usage - IsBlockAncestor(ctx context.Context, block *types.Header, maybeAncestor common.L1BlockHash) bool } type BatchResolver interface { diff --git a/go/enclave/storage/storage.go b/go/enclave/storage/storage.go index fbefa4730..be875cb95 100644 --- a/go/enclave/storage/storage.go +++ b/go/enclave/storage/storage.go @@ -388,15 +388,6 @@ func (s *storageImpl) IsAncestor(ctx context.Context, block *types.Header, maybe return s.IsAncestor(ctx, p, maybeAncestor) } -func (s *storageImpl) IsBlockAncestor(ctx context.Context, block *types.Header, maybeAncestor common.L1BlockHash) bool { - defer s.logDuration("IsBlockAncestor", measure.NewStopwatch()) - resolvedBlock, err := s.FetchBlock(ctx, maybeAncestor) - if err != nil { - return false - } - return s.IsAncestor(ctx, block, resolvedBlock) -} - func (s *storageImpl) HealthCheck(ctx context.Context) (bool, error) { defer s.logDuration("HealthCheck", measure.NewStopwatch()) seqNo, err := s.FetchCurrentSequencerNo(ctx)