Skip to content

Commit f00dc06

Browse files
authored
fix: account for tx subcircuit confidence factor (#1065)
1 parent 2ed7456 commit f00dc06

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

core/tx_pool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
706706
return ErrOversizedData
707707
}
708708
// Reject transactions that cannot fit into a block even as a single transaction
709-
if !pool.chainconfig.Scroll.IsValidBlockSize(tx.Size()) {
709+
if !pool.chainconfig.Scroll.IsValidBlockSizeForMining(tx.Size()) {
710710
return ErrOversizedData
711711
}
712712
// Check whether the init code size has been exceeded.

miner/scroll_worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ func (w *worker) processTxn(tx *types.Transaction) (bool, error) {
742742
return false, ErrUnexpectedL1MessageIndex
743743
}
744744

745-
if !tx.IsL1MessageTx() && !w.chain.Config().Scroll.IsValidBlockSize(w.current.blockSize+tx.Size()) {
745+
if !tx.IsL1MessageTx() && !w.chain.Config().Scroll.IsValidBlockSizeForMining(w.current.blockSize+tx.Size()) {
746746
// can't fit this txn in this block, silently ignore and continue looking for more txns
747747
return false, errors.New("tx too big")
748748
}

params/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,11 @@ func (s ScrollConfig) IsValidBlockSize(size common.StorageSize) bool {
718718
return s.MaxTxPayloadBytesPerBlock == nil || size <= common.StorageSize(*s.MaxTxPayloadBytesPerBlock)
719719
}
720720

721+
// IsValidBlockSizeForMining is similar to IsValidBlockSize, but it accounts for the confidence factor in Rust CCC
722+
func (s ScrollConfig) IsValidBlockSizeForMining(size common.StorageSize) bool {
723+
return s.IsValidBlockSize(size * (1.0 / 0.95))
724+
}
725+
721726
// EthashConfig is the consensus engine configs for proof-of-work based sealing.
722727
type EthashConfig struct{}
723728

params/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
const (
2525
VersionMajor = 5 // Major version component of the current release
2626
VersionMinor = 7 // Minor version component of the current release
27-
VersionPatch = 23 // Patch version component of the current release
27+
VersionPatch = 24 // Patch version component of the current release
2828
VersionMeta = "mainnet" // Version metadata to append to the version string
2929
)
3030

rollup/pipeline/pipeline.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ func (p *Pipeline) traceAndApplyStage(txsIn <-chan *types.Transaction) (<-chan e
272272
continue
273273
}
274274

275-
if !tx.IsL1MessageTx() && !p.chain.Config().Scroll.IsValidBlockSize(p.blockSize+tx.Size()) {
275+
if !tx.IsL1MessageTx() && !p.chain.Config().Scroll.IsValidBlockSizeForMining(p.blockSize+tx.Size()) {
276276
// can't fit this txn in this block, silently ignore and continue looking for more txns
277277
sendCancellable(resCh, nil, p.ctx.Done())
278278
continue

0 commit comments

Comments
 (0)