Skip to content

Commit 934f4bb

Browse files
author
colinlyguo
committed
address AI's comments
1 parent c6b779f commit 934f4bb

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

rollup/cmd/proposer_tool/app/app.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ func action(ctx *cli.Context) error {
5555

5656
minCodecVersion := encoding.CodecVersion(ctx.Uint(utils.MinCodecVersionFlag.Name))
5757

58+
// sanity check config
59+
if cfg.L2Config.BatchProposerConfig.MaxChunksPerBatch <= 0 {
60+
log.Crit("cfg.L2Config.BatchProposerConfig.MaxChunksPerBatch must be greater than 0")
61+
}
62+
if cfg.L2Config.ChunkProposerConfig.MaxL2GasPerChunk <= 0 {
63+
log.Crit("cfg.L2Config.BatchProposerConfig.MaxChunksPerBatch must be greater than 0")
64+
}
65+
5866
proposerTool, err := watcher.NewProposerTool(subCtx, cancel, cfg, startL2BlockHeight, minCodecVersion, genesis.Config)
5967
if err != nil {
6068
log.Crit("failed to create proposer tool", "startL2BlockHeight", startL2BlockHeight, "minCodecVersion", minCodecVersion, "error", err)

rollup/internal/controller/watcher/proposer_tool.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,6 @@ func NewProposerTool(ctx context.Context, cancel context.CancelFunc, cfg *config
122122
return nil, fmt.Errorf("failed to update batch hash for chunks: %w", err)
123123
}
124124

125-
// sanity check config
126-
if cfg.L2Config.BatchProposerConfig.MaxChunksPerBatch <= 0 {
127-
return nil, fmt.Errorf("cfg.L2Config.BatchProposerConfig.MaxChunksPerBatch must be greater than 0")
128-
}
129-
if cfg.L2Config.ChunkProposerConfig.MaxL2GasPerChunk <= 0 {
130-
return nil, fmt.Errorf("cfg.L2Config.ChunkProposerConfig.MaxL2GasPerChunk must be greater than 0")
131-
}
132-
133125
chunkProposer := NewChunkProposer(ctx, cfg.L2Config.ChunkProposerConfig, minCodecVersion, chainCfg, db, nil)
134126
chunkProposer.SetReplayDB(dbForReplay)
135127
batchProposer := NewBatchProposer(ctx, cfg.L2Config.BatchProposerConfig, minCodecVersion, chainCfg, db, nil)

0 commit comments

Comments
 (0)