Skip to content

Commit

Permalink
remove dead code (#2238)
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-malene authored Jan 7, 2025
1 parent 65892f5 commit 09bfa2f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
12 changes: 2 additions & 10 deletions go/enclave/nodetype/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 0 additions & 4 deletions go/enclave/storage/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 0 additions & 9 deletions go/enclave/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 09bfa2f

Please sign in to comment.