mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
fix the bug when calculating l2TxCount. (#479)
* fix bug when calculate l2 tx count * Update version
This commit is contained in:
parent
ef893170bc
commit
b65f42b41a
2 changed files with 10 additions and 6 deletions
|
|
@ -970,11 +970,6 @@ loop:
|
||||||
}
|
}
|
||||||
return atomic.LoadInt32(interrupt) == commitInterruptNewHead, circuitCapacityReached
|
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 we don't have enough gas for any further transactions then we're done
|
||||||
if w.current.gasPool.Gas() < params.TxGas {
|
if w.current.gasPool.Gas() < params.TxGas {
|
||||||
log.Trace("Not enough gas for further transactions", "have", w.current.gasPool, "want", 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 {
|
if tx == nil {
|
||||||
break
|
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 {
|
if tx.IsL1MessageTx() && tx.AsL1MessageTx().QueueIndex != w.current.nextL1MsgIndex {
|
||||||
log.Error(
|
log.Error(
|
||||||
"Unexpected L1 message queue index in worker",
|
"Unexpected L1 message queue index in worker",
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import (
|
||||||
const (
|
const (
|
||||||
VersionMajor = 4 // Major version component of the current release
|
VersionMajor = 4 // Major version component of the current release
|
||||||
VersionMinor = 3 // Minor 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
|
VersionMeta = "sepolia" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue