diff --git a/miner/worker.go b/miner/worker.go index 1c93ab2f71..4f628c69b9 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -970,11 +970,6 @@ loop: } return atomic.LoadInt32(interrupt) == commitInterruptNewHead, circuitCapacityReached } - // If we have collected enough transactions then we're done - if !w.chainConfig.Scroll.IsValidL2TxCount(w.current.tcount - w.current.l1TxCount + 1) { - log.Trace("Transaction count limit reached", "have", w.current.tcount-w.current.l1TxCount, "want", w.chainConfig.Scroll.MaxTxPerBlock) - break - } // If we don't have enough gas for any further transactions then we're done if w.current.gasPool.Gas() < params.TxGas { log.Trace("Not enough gas for further transactions", "have", w.current.gasPool, "want", params.TxGas) @@ -985,6 +980,15 @@ loop: if tx == nil { break } + // If we have collected enough transactions then we're done + l2TxCount := w.current.tcount - w.current.l1TxCount + if !tx.IsL1MessageTx() { // If the next tx is not L1MessageTx type then +1. + l2TxCount++ + } + if !w.chainConfig.Scroll.IsValidL2TxCount(l2TxCount) { + log.Trace("Transaction count limit reached", "have", w.current.tcount-w.current.l1TxCount, "want", w.chainConfig.Scroll.MaxTxPerBlock) + break + } if tx.IsL1MessageTx() && tx.AsL1MessageTx().QueueIndex != w.current.nextL1MsgIndex { log.Error( "Unexpected L1 message queue index in worker", diff --git a/params/version.go b/params/version.go index 7566ea31e6..7abf09a6c8 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 4 // Major version component of the current release VersionMinor = 3 // Minor version component of the current release - VersionPatch = 45 // Patch version component of the current release + VersionPatch = 46 // Patch version component of the current release VersionMeta = "sepolia" // Version metadata to append to the version string )