From f08fb8fe102047e64a28169c63a76ffc9e0da4a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Wed, 11 Jun 2025 17:42:11 +0200 Subject: [PATCH] feat: reject txs with max l1 data fee in worker --- miner/scroll_worker.go | 10 ++++++++++ params/version.go | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/miner/scroll_worker.go b/miner/scroll_worker.go index 8af97f1cd7a9..947d7f42764b 100644 --- a/miner/scroll_worker.go +++ b/miner/scroll_worker.go @@ -833,6 +833,16 @@ func (w *worker) processTxn(tx *types.Transaction) (bool, error) { return false, errors.New("tx too big") } + // Reject transactions that require the max data fee amount. + // This can only happen if the L1 gas oracle is updated incorrectly. + l1DataFee, err := fees.CalculateL1DataFee(tx, w.current.state, w.chain.Config(), w.current.header.Number) + if err != nil { + return false, fmt.Errorf("failed to calculate L1 data fee, err: %w", err) + } + if l1DataFee.Cmp(fees.MaxL1DataFee()) >= 0 { + return false, errors.New("invalid transaction: invalid L1 data fee") + } + // Start executing the transaction w.current.state.SetTxContext(tx.Hash(), w.current.txs.Len()) diff --git a/params/version.go b/params/version.go index 01c2565f1582..0a9f4e2b00b5 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 = 8 // Minor version component of the current release - VersionPatch = 55 // Patch version component of the current release + VersionPatch = 56 // Patch version component of the current release VersionMeta = "mainnet" // Version metadata to append to the version string )