mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
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:
parent
cc9a1dd82d
commit
27e6e9e168
2 changed files with 11 additions and 1 deletions
|
|
@ -838,6 +838,16 @@ func (w *worker) processTxn(tx *types.Transaction) (bool, error) {
|
||||||
return false, errors.New("tx too big")
|
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
|
// Start executing the transaction
|
||||||
w.current.state.SetTxContext(tx.Hash(), w.current.txs.Len())
|
w.current.state.SetTxContext(tx.Hash(), w.current.txs.Len())
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 = 8 // Minor 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
|
VersionMeta = "mainnet" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue