Skip to content

Commit 27e6e9e

Browse files
authored
feat: reject txs with max l1 data fee in worker (#1204)
* feat: reject txs with max l1 data fee in worker * fix
1 parent cc9a1dd commit 27e6e9e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

miner/scroll_worker.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,16 @@ func (w *worker) processTxn(tx *types.Transaction) (bool, error) {
838838
return false, errors.New("tx too big")
839839
}
840840

841+
// Reject transactions that require the max data fee amount.
842+
// This can only happen if the L1 gas oracle is updated incorrectly.
843+
l1DataFee, err := fees.CalculateL1DataFee(tx, w.current.state, w.chain.Config(), w.current.header.Number, w.current.header.Time)
844+
if err != nil {
845+
return false, fmt.Errorf("failed to calculate L1 data fee, err: %w", err)
846+
}
847+
if l1DataFee.Cmp(fees.MaxL1DataFee()) >= 0 {
848+
return false, errors.New("invalid transaction: invalid L1 data fee")
849+
}
850+
841851
// Start executing the transaction
842852
w.current.state.SetTxContext(tx.Hash(), w.current.txs.Len())
843853

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 = 8 // Minor version component of the current release
27-
VersionPatch = 59 // Patch version component of the current release
27+
VersionPatch = 60 // Patch version component of the current release
2828
VersionMeta = "mainnet" // Version metadata to append to the version string
2929
)
3030

0 commit comments

Comments
 (0)