Skip to content

Commit 36690d1

Browse files
author
colinlyguo
committed
tweaks
1 parent 8112a12 commit 36690d1

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

rollup/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ make rollup_bins
4141
1. Set genesis config to enable desired hardforks in [`proposer-tool-genesis.json`](./proposer-tool-genesis.json).
4242
2. Set proposer config in [`proposer-tool-config.json`](./proposer-tool-config.json) for data analysis.
4343

44-
### Start the proposer tool using docker-compose.
44+
### Start the proposer tool using docker-compose
4545

4646
```
4747
cd rollup

rollup/cmd/proposer_tool/app/app.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ func action(ctx *cli.Context) error {
6565
}
6666
}()
6767

68-
// Init l2BlockOrm connection
68+
// Init dbForReplay connection
6969
dbForReplay, err := database.InitDB(cfg.DBConfigForReplay)
7070
if err != nil {
71-
log.Crit("failed to init l2BlockOrm connection", "err", err)
71+
log.Crit("failed to init dbForReplay connection", "err", err)
7272
}
7373
defer func() {
7474
cancel()
7575
if err = database.CloseDB(dbForReplay); err != nil {
76-
log.Crit("failed to close l2BlockOrm connection", "error", err)
76+
log.Crit("failed to close dbForReplay connection", "error", err)
7777
}
7878
}()
7979

rollup/internal/controller/watcher/batch_proposer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ func (p *BatchProposer) updateDBBatchInfo(batch *encoding.Batch, codecVersion en
231231
return dbErr
232232
}
233233
if p.replayMode {
234-
// if replayMode is true, it means that the batch is proposed by the proposer tool, set the batch status to types.RollupCommitted
235-
// and commit tx hash to a unique value so that new bundles can be proposed
234+
// If replayMode is true, meaning the batch was proposed by the proposer tool,
235+
// set batch status to types.RollupCommitted and assign a unique commit tx hash to enable new bundle proposals.
236236
if dbErr = p.batchOrm.UpdateCommitTxHashAndRollupStatus(p.ctx, dbBatch.Hash, dbBatch.Hash, types.RollupCommitted, dbTX); dbErr != nil {
237237
log.Warn("BatchProposer.UpdateCommitTxHashAndRollupStatus update the batch's commit tx hash failure", "hash", dbBatch.Hash, "error", dbErr)
238238
return dbErr

rollup/internal/controller/watcher/chunk_proposer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,10 @@ func (p *ChunkProposer) updateDBChunkInfo(chunk *encoding.Chunk, codecVersion en
243243
log.Warn("ChunkProposer.InsertChunk failed", "codec version", codecVersion, "err", err)
244244
return err
245245
}
246+
// In replayMode we don't need to update chunk_hash in l2_block table.
246247
if !p.replayMode {
247248
if err := p.l2BlockOrm.UpdateChunkHashInRange(p.ctx, dbChunk.StartBlockNumber, dbChunk.EndBlockNumber, dbChunk.Hash, dbTX); err != nil {
248-
log.Error("failed to update chunk_hash for l2_blocks", "chunk hash", dbChunk.Hash, "start block", dbChunk.StartBlockNumber, "end block", dbChunk.EndBlockNumber, "err", err)
249+
log.Error("failed to update chunk_hash for l2_block", "chunk hash", dbChunk.Hash, "start block", dbChunk.StartBlockNumber, "end block", dbChunk.EndBlockNumber, "err", err)
249250
return err
250251
}
251252
}

0 commit comments

Comments
 (0)