diff --git a/bridge/internal/controller/watcher/batch_proposer.go b/bridge/internal/controller/watcher/batch_proposer.go index e4e914440b..99d3862f91 100644 --- a/bridge/internal/controller/watcher/batch_proposer.go +++ b/bridge/internal/controller/watcher/batch_proposer.go @@ -183,6 +183,10 @@ func (p *BatchProposer) proposeBatchChunks() ([]*orm.Chunk, error) { } for i, chunk := range dbChunks { + // metric values + lastTotalL1CommitCalldataSize := totalL1CommitCalldataSize + lastTotalL1CommitGas := totalL1CommitGas + totalL1CommitCalldataSize += chunk.TotalL1CommitCalldataSize totalL1CommitGas += chunk.TotalL1CommitGas // adjust batch data hash gas cost @@ -230,9 +234,9 @@ func (p *BatchProposer) proposeBatchChunks() ([]*orm.Chunk, error) { "currentOverEstimateL1CommitGas", totalOverEstimateL1CommitGas, "maxL1CommitGasPerBatch", p.maxL1CommitGasPerBatch) - p.totalL1CommitGas.Set(float64(totalL1CommitGas)) - p.totalL1CommitCalldataSize.Set(float64(totalL1CommitCalldataSize)) - p.batchChunksNum.Set(float64(len(dbChunks))) + p.totalL1CommitGas.Set(float64(lastTotalL1CommitGas)) + p.totalL1CommitCalldataSize.Set(float64(lastTotalL1CommitCalldataSize)) + p.batchChunksNum.Set(float64(i)) return dbChunks[:i], nil } } diff --git a/bridge/internal/controller/watcher/chunk_proposer.go b/bridge/internal/controller/watcher/chunk_proposer.go index 189217e29d..a07c9403c3 100644 --- a/bridge/internal/controller/watcher/chunk_proposer.go +++ b/bridge/internal/controller/watcher/chunk_proposer.go @@ -199,6 +199,13 @@ func (p *ChunkProposer) proposeChunk() (*types.Chunk, error) { crc := chunkRowConsumption{} for i, block := range blocks { + // metric values + lastTotalL2TxNum := totalL2TxNum + lastTotalL1CommitGas := totalL1CommitGas + lastCrcMax := crc.max() + lastTotalL1CommitCalldataSize := totalL1CommitCalldataSize + lastTotalTxGasUsed := totalTxGasUsed + totalTxGasUsed += block.Header.GasUsed totalL2TxNum += block.L2TxsNum() totalL1CommitCalldataSize += block.EstimateL1CommitCalldataSize() @@ -258,18 +265,18 @@ func (p *ChunkProposer) proposeChunk() (*types.Chunk, error) { "totalL2TxNum", totalL2TxNum, "maxL2TxNumPerChunk", p.maxL2TxNumPerChunk, "currentL1CommitCalldataSize", totalL1CommitCalldataSize, - "maxL1CommitGasPerChunk", p.maxL1CommitGasPerChunk, - "currentOverEstimateL1CommitGas", totalOverEstimateL1CommitGas, "maxL1CommitCalldataSizePerChunk", p.maxL1CommitCalldataSizePerChunk, + "currentOverEstimateL1CommitGas", totalOverEstimateL1CommitGas, + "maxL1CommitGasPerChunk", p.maxL1CommitGasPerChunk, "chunkRowConsumptionMax", crcMax, "chunkRowConsumption", crc, "p.maxRowConsumptionPerChunk", p.maxRowConsumptionPerChunk) - p.chunkL2TxNum.Set(float64(totalL2TxNum)) - p.chunkEstimateL1CommitGas.Set(float64(totalL1CommitGas)) - p.totalL1CommitCalldataSize.Set(float64(totalL1CommitCalldataSize)) - p.maxTxConsumption.Set(float64(crcMax)) - p.totalTxGasUsed.Set(float64(totalTxGasUsed)) + p.chunkL2TxNum.Set(float64(lastTotalL2TxNum)) + p.chunkEstimateL1CommitGas.Set(float64(lastTotalL1CommitGas)) + p.totalL1CommitCalldataSize.Set(float64(lastTotalL1CommitCalldataSize)) + p.maxTxConsumption.Set(float64(lastCrcMax)) + p.totalTxGasUsed.Set(float64(lastTotalTxGasUsed)) p.chunkBlocksNum.Set(float64(len(chunk.Blocks))) return &chunk, nil } diff --git a/common/version/version.go b/common/version/version.go index 1fd82aec05..b695171784 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -7,7 +7,7 @@ import ( "strings" ) -var tag = "v4.1.105" +var tag = "v4.1.106" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok {