Skip to content

Commit f08fb8f

Browse files
committed
feat: reject txs with max l1 data fee in worker
1 parent cf3d22e commit f08fb8f

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
@@ -833,6 +833,16 @@ func (w *worker) processTxn(tx *types.Transaction) (bool, error) {
833833
return false, errors.New("tx too big")
834834
}
835835

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

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 = 55 // Patch version component of the current release
27+
VersionPatch = 56 // 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)