Compare commits

..

1 Commits

Author SHA1 Message Date
Péter Garamvölgyi
f00c400993 fix(chunk proposer): treat L2 tx gas check as soft limit (#602) 2023-06-29 23:32:16 +08:00
2 changed files with 11 additions and 10 deletions

View File

@@ -106,15 +106,6 @@ func (p *ChunkProposer) proposeChunk() (*bridgeTypes.Chunk, error) {
)
}
if totalTxGasUsed > p.maxTxGasPerChunk {
return nil, fmt.Errorf(
"the first block exceeds l2 tx gas limit; block number: %v, gas used: %v, max gas limit: %v",
firstBlock.Header.Number,
totalTxGasUsed,
p.maxTxGasPerChunk,
)
}
if totalL1CommitGas > p.maxL1CommitGasPerChunk {
return nil, fmt.Errorf(
"the first block exceeds l1 commit gas limit; block number: %v, commit gas: %v, max commit gas limit: %v",
@@ -133,6 +124,16 @@ func (p *ChunkProposer) proposeChunk() (*bridgeTypes.Chunk, error) {
)
}
// Check if the first block breaks any soft limits.
if totalTxGasUsed > p.maxTxGasPerChunk {
log.Warn(
"The first block in chunk exceeds l2 tx gas limit",
"block number", firstBlock.Header.Number,
"gas used", totalTxGasUsed,
"max gas limit", p.maxTxGasPerChunk,
)
}
for i, block := range blocks[1:] {
totalTxGasUsed += block.Header.GasUsed
totalL2TxNum += block.L2TxsNum()

View File

@@ -5,7 +5,7 @@ import (
"runtime/debug"
)
var tag = "v4.0.3"
var tag = "v4.0.4"
var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {