Skip to content

Commit

Permalink
New exception type: INSUFFICIENT_MAX_FEE_PER_BLOB_GAS
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiburdusa committed Nov 15, 2024
1 parent b5778bc commit 104a61c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Conform/TestRunner.lean
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def executeTransaction (transaction : Transaction) (s : EVM.State) (header : Blo
-- Validate transaction
match transaction with
| .blob t =>
if t.maxFeePerBlobGas.toNat < header.getBlobGasprice then .error (.InvalidTransaction .INSUFFICIENT_MAX_FEE_PER_BLOB_GAS)
if header.blobGasUsed == none || header.excessBlobGas == none then .error (.InvalidTransaction .TYPE_3_TX_PRE_FORK)
match t.blobVersionedHashes with
| [] => .error (.InvalidTransaction .TYPE_3_TX_ZERO_BLOBS)
Expand Down
2 changes: 2 additions & 0 deletions EvmYul/EVM/Exception.lean
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ inductive InvalidTransactionException where
| TYPE_3_TX_ZERO_BLOBS : InvalidTransactionException
| TYPE_3_TX_PRE_FORK : InvalidTransactionException
| INTRINSIC_GAS_TOO_LOW : InvalidTransactionException
| INSUFFICIENT_MAX_FEE_PER_BLOB_GAS : InvalidTransactionException

instance : Repr InvalidTransactionException where
reprPrec s _ :=
Expand All @@ -31,6 +32,7 @@ instance : Repr InvalidTransactionException where
| .TYPE_3_TX_ZERO_BLOBS => "TYPE_3_TX_ZERO_BLOBS"
| .TYPE_3_TX_PRE_FORK => "TYPE_3_TX_PRE_FORK"
| .INTRINSIC_GAS_TOO_LOW => "INTRINSIC_GAS_TOO_LOW"
| .INSUFFICIENT_MAX_FEE_PER_BLOB_GAS => "INTRINSIC_GAS_TOO_LOW"

-- TODO - fix / cleanup.
inductive Exception where
Expand Down
2 changes: 0 additions & 2 deletions EvmYul/EllipticCurves.lean
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,3 @@ private example :
:= by native_decide

open Batteries

#eval ByteArray.zeroes ⟨12⟩ ++ (KEC pᵤ).extract 12 32

0 comments on commit 104a61c

Please sign in to comment.