mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
fix: account for tx subcircuit confidence factor (#1065)
This commit is contained in:
parent
2ed7456a4b
commit
f00dc06628
5 changed files with 9 additions and 4 deletions
|
|
@ -706,7 +706,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
|
||||||
return ErrOversizedData
|
return ErrOversizedData
|
||||||
}
|
}
|
||||||
// Reject transactions that cannot fit into a block even as a single transaction
|
// Reject transactions that cannot fit into a block even as a single transaction
|
||||||
if !pool.chainconfig.Scroll.IsValidBlockSize(tx.Size()) {
|
if !pool.chainconfig.Scroll.IsValidBlockSizeForMining(tx.Size()) {
|
||||||
return ErrOversizedData
|
return ErrOversizedData
|
||||||
}
|
}
|
||||||
// Check whether the init code size has been exceeded.
|
// Check whether the init code size has been exceeded.
|
||||||
|
|
|
||||||
|
|
@ -742,7 +742,7 @@ func (w *worker) processTxn(tx *types.Transaction) (bool, error) {
|
||||||
return false, ErrUnexpectedL1MessageIndex
|
return false, ErrUnexpectedL1MessageIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
if !tx.IsL1MessageTx() && !w.chain.Config().Scroll.IsValidBlockSize(w.current.blockSize+tx.Size()) {
|
if !tx.IsL1MessageTx() && !w.chain.Config().Scroll.IsValidBlockSizeForMining(w.current.blockSize+tx.Size()) {
|
||||||
// can't fit this txn in this block, silently ignore and continue looking for more txns
|
// can't fit this txn in this block, silently ignore and continue looking for more txns
|
||||||
return false, errors.New("tx too big")
|
return false, errors.New("tx too big")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -718,6 +718,11 @@ func (s ScrollConfig) IsValidBlockSize(size common.StorageSize) bool {
|
||||||
return s.MaxTxPayloadBytesPerBlock == nil || size <= common.StorageSize(*s.MaxTxPayloadBytesPerBlock)
|
return s.MaxTxPayloadBytesPerBlock == nil || size <= common.StorageSize(*s.MaxTxPayloadBytesPerBlock)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsValidBlockSizeForMining is similar to IsValidBlockSize, but it accounts for the confidence factor in Rust CCC
|
||||||
|
func (s ScrollConfig) IsValidBlockSizeForMining(size common.StorageSize) bool {
|
||||||
|
return s.IsValidBlockSize(size * (1.0 / 0.95))
|
||||||
|
}
|
||||||
|
|
||||||
// EthashConfig is the consensus engine configs for proof-of-work based sealing.
|
// EthashConfig is the consensus engine configs for proof-of-work based sealing.
|
||||||
type EthashConfig struct{}
|
type EthashConfig struct{}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import (
|
||||||
const (
|
const (
|
||||||
VersionMajor = 5 // Major version component of the current release
|
VersionMajor = 5 // Major version component of the current release
|
||||||
VersionMinor = 7 // Minor version component of the current release
|
VersionMinor = 7 // Minor version component of the current release
|
||||||
VersionPatch = 23 // Patch version component of the current release
|
VersionPatch = 24 // Patch version component of the current release
|
||||||
VersionMeta = "mainnet" // Version metadata to append to the version string
|
VersionMeta = "mainnet" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ func (p *Pipeline) traceAndApplyStage(txsIn <-chan *types.Transaction) (<-chan e
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if !tx.IsL1MessageTx() && !p.chain.Config().Scroll.IsValidBlockSize(p.blockSize+tx.Size()) {
|
if !tx.IsL1MessageTx() && !p.chain.Config().Scroll.IsValidBlockSizeForMining(p.blockSize+tx.Size()) {
|
||||||
// can't fit this txn in this block, silently ignore and continue looking for more txns
|
// can't fit this txn in this block, silently ignore and continue looking for more txns
|
||||||
sendCancellable(resCh, nil, p.ctx.Done())
|
sendCancellable(resCh, nil, p.ctx.Done())
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue