Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmountaintop committed Nov 28, 2023
1 parent 0ff0275 commit 3098c11
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,12 +838,13 @@ func (w *worker) commitTransactions(env *environment, txs *transactionsByPriceAn
}
// If we have collected enough transactions then we're done
// Originally we only limit l2txs count, but now strictly limit total txs number.
if !w.chainConfig.Scroll.IsValidTxCount(w.current.tcount + 1) {
log.Trace("Transaction count limit reached", "have", w.current.tcount, "want", w.chainConfig.Scroll.MaxTxPerBlock)
// log.Info("w.chainConfig", "w.chainConfig.Scroll", w.chainConfig.Scroll)
if !w.chainConfig.Scroll.IsValidTxCount(env.tcount + 1) {
log.Trace("Transaction count limit reached", "have", env.tcount, "want", w.chainConfig.Scroll.MaxTxPerBlock)
break
}
if !tx.IsL1MessageTx() && !w.chainConfig.Scroll.IsValidBlockSize(w.current.blockSize+tx.Size()) {
log.Trace("Block size limit reached", "have", w.current.blockSize, "want", w.chainConfig.Scroll.MaxTxPayloadBytesPerBlock, "tx", tx.Size())
if !tx.IsL1MessageTx() && !w.chainConfig.Scroll.IsValidBlockSize(env.blockSize+tx.Size()) {
log.Trace("Block size limit reached", "have", env.blockSize, "want", w.chainConfig.Scroll.MaxTxPayloadBytesPerBlock, "tx", tx.Size())
txs.Pop() // skip transactions from this account
continue
}
Expand Down Expand Up @@ -877,7 +878,7 @@ func (w *worker) commitTransactions(env *environment, txs *transactionsByPriceAn
if tx.IsL1MessageTx() {
} else {
// only consider block size limit for L2 transactions
w.current.blockSize += tx.Size()
env.blockSize += tx.Size()
}

default:
Expand Down

0 comments on commit 3098c11

Please sign in to comment.