feat: reject txs with max l1 data fee in worker (#1204)

* feat: reject txs with max l1 data fee in worker

* fix
This commit is contained in:
Péter Garamvölgyi 2025-06-26 13:52:56 +02:00 committed by GitHub
parent cc9a1dd82d
commit 27e6e9e168
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View file

@ -838,6 +838,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, w.current.header.Time)
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())

View file

@ -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 = 59 // Patch version component of the current release
VersionPatch = 60 // Patch version component of the current release
VersionMeta = "mainnet" // Version metadata to append to the version string
)