From b7fe0384163fd5e9f4e39666470d53e32480ab88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20Irmak?= Date: Thu, 10 Oct 2024 16:51:24 +0300 Subject: [PATCH 1/2] fix: account for tx subcircuit confidence factor --- core/tx_pool.go | 2 +- miner/scroll_worker.go | 2 +- params/config.go | 5 +++++ rollup/pipeline/pipeline.go | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/tx_pool.go b/core/tx_pool.go index e7d5062fd523..8cc9e2ffd028 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -706,7 +706,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error { return ErrOversizedData } // 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 } // Check whether the init code size has been exceeded. diff --git a/miner/scroll_worker.go b/miner/scroll_worker.go index 02f331bc200a..ec6337bef406 100644 --- a/miner/scroll_worker.go +++ b/miner/scroll_worker.go @@ -742,7 +742,7 @@ func (w *worker) processTxn(tx *types.Transaction) (bool, error) { 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 return false, errors.New("tx too big") } diff --git a/params/config.go b/params/config.go index 11b8ff9390c9..eb2213fdd360 100644 --- a/params/config.go +++ b/params/config.go @@ -718,6 +718,11 @@ func (s ScrollConfig) IsValidBlockSize(size common.StorageSize) bool { 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. type EthashConfig struct{} diff --git a/rollup/pipeline/pipeline.go b/rollup/pipeline/pipeline.go index 4c0abd3e53e7..12c34e2c96ff 100644 --- a/rollup/pipeline/pipeline.go +++ b/rollup/pipeline/pipeline.go @@ -272,7 +272,7 @@ func (p *Pipeline) traceAndApplyStage(txsIn <-chan *types.Transaction) (<-chan e 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 sendCancellable(resCh, nil, p.ctx.Done()) continue From 23788fee8276d244d22319f46fcef47bc4192782 Mon Sep 17 00:00:00 2001 From: omerfirmak Date: Thu, 10 Oct 2024 13:53:13 +0000 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20auto=20version=20bump=E2=80=89[bot?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- params/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params/version.go b/params/version.go index 91a69450932c..c523758cbe05 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 5 // Major 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 )