Skip to content

Commit

Permalink
[R4R]-{develop}: fix mt-batcher pushes one less block (#1367)
Browse files Browse the repository at this point in the history
# Goals of PR

Core changes:

1. mt-batcher adds a block when pushing each batch
2. This metric is only pushed when the batch exists.

Notes:

- no

Related Issues:

- #1366
  • Loading branch information
HXHke authored Sep 26, 2023
2 parents 69c0b80 + f5b151c commit a18ec93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mt-batcher/services/sequencer/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func (d *Driver) GetBatchBlockRange(ctx context.Context) (*big.Int, *big.Int, er
return nil, nil, fmt.Errorf("invalid range, end(%v) < start(%v)", end, start)
}
if end.Cmp(latestHeader.Number) > 0 {
end = latestHeader.Number
end = new(big.Int).Add(latestHeader.Number, bigOne)
}
return start, end, nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@ export class DaIngestionService extends BaseService<DaIngestionServiceOptions> {
)
return false
}
this.daIngestionMetrics.currentL2TransactionIndex.set(
batchTx['TxMeta']['index']
)
}
transactionEntries.push({
index: batchTx['TxMeta']['index'],
Expand All @@ -464,9 +467,6 @@ export class DaIngestionService extends BaseService<DaIngestionServiceOptions> {
decoded,
confirmed: true,
})
this.daIngestionMetrics.currentL2TransactionIndex.set(
batchTx['TxMeta']['index']
)
}
await this.state.db.putTransactions(transactionEntries)
await this.state.db.putBatchTransactionByDsId(
Expand Down

0 comments on commit a18ec93

Please sign in to comment.