Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

op-node: Remove unused field in ChannelBank #12001

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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