Skip to content

Commit

Permalink
op-node: Remove unused field in ChannelBank
Browse files Browse the repository at this point in the history
  • Loading branch information
palango committed Sep 24, 2024
1 parent 718b9b0 commit 57969a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions op-node/rollup/derive/channel_bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,20 @@ type ChannelBank struct {
channels map[ChannelID]*Channel // channels by ID
channelQueue []ChannelID // channels in FIFO order

prev NextFrameProvider
fetcher L1Fetcher
prev NextFrameProvider
}

var _ ResettableStage = (*ChannelBank)(nil)

// NewChannelBank creates a ChannelBank, which should be Reset(origin) before use.
func NewChannelBank(log log.Logger, cfg *rollup.Config, prev NextFrameProvider, fetcher L1Fetcher, m Metrics) *ChannelBank {
func NewChannelBank(log log.Logger, cfg *rollup.Config, prev NextFrameProvider, m Metrics) *ChannelBank {
return &ChannelBank{
log: log,
spec: rollup.NewChainSpec(cfg),
metrics: m,
channels: make(map[ChannelID]*Channel),
channelQueue: make([]ChannelID, 0, 10),
prev: prev,
fetcher: fetcher,
}
}

Expand Down
8 changes: 4 additions & 4 deletions op-node/rollup/derive/channel_bank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func TestChannelBankSimple(t *testing.T) {

cfg := &rollup.Config{ChannelTimeoutBedrock: 10}

cb := NewChannelBank(testlog.Logger(t, log.LevelCrit), cfg, input, nil, metrics.NoopMetrics)
cb := NewChannelBank(testlog.Logger(t, log.LevelCrit), cfg, input, metrics.NoopMetrics)

// Load the first frame
out, err := cb.NextData(context.Background())
Expand Down Expand Up @@ -146,7 +146,7 @@ func TestChannelBankInterleavedPreCanyon(t *testing.T) {

cfg := &rollup.Config{ChannelTimeoutBedrock: 10, CanyonTime: nil}

cb := NewChannelBank(testlog.Logger(t, log.LevelCrit), cfg, input, nil, metrics.NoopMetrics)
cb := NewChannelBank(testlog.Logger(t, log.LevelCrit), cfg, input, metrics.NoopMetrics)

// Load a:0
out, err := cb.NextData(context.Background())
Expand Down Expand Up @@ -211,7 +211,7 @@ func TestChannelBankInterleaved(t *testing.T) {
ct := uint64(0)
cfg := &rollup.Config{ChannelTimeoutBedrock: 10, CanyonTime: &ct}

cb := NewChannelBank(testlog.Logger(t, log.LevelCrit), cfg, input, nil, metrics.NoopMetrics)
cb := NewChannelBank(testlog.Logger(t, log.LevelCrit), cfg, input, metrics.NoopMetrics)

// Load a:0
out, err := cb.NextData(context.Background())
Expand Down Expand Up @@ -271,7 +271,7 @@ func TestChannelBankDuplicates(t *testing.T) {

cfg := &rollup.Config{ChannelTimeoutBedrock: 10}

cb := NewChannelBank(testlog.Logger(t, log.LevelCrit), cfg, input, nil, metrics.NoopMetrics)
cb := NewChannelBank(testlog.Logger(t, log.LevelCrit), cfg, input, metrics.NoopMetrics)

// Load the first frame
out, err := cb.NextData(context.Background())
Expand Down
2 changes: 1 addition & 1 deletion op-node/rollup/derive/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func NewDerivationPipeline(log log.Logger, rollupCfg *rollup.Config, l1Fetcher L
dataSrc := NewDataSourceFactory(log, rollupCfg, l1Fetcher, l1Blobs, altDA) // auxiliary stage for L1Retrieval
l1Src := NewL1Retrieval(log, dataSrc, l1Traversal)
frameQueue := NewFrameQueue(log, l1Src)
bank := NewChannelBank(log, rollupCfg, frameQueue, l1Fetcher, metrics)
bank := NewChannelBank(log, rollupCfg, frameQueue, metrics)
chInReader := NewChannelInReader(rollupCfg, log, bank, metrics)
batchQueue := NewBatchQueue(log, rollupCfg, chInReader, l2Source)
attrBuilder := NewFetchingAttributesBuilder(rollupCfg, l1Fetcher, l2Source)
Expand Down

0 comments on commit 57969a9

Please sign in to comment.