Skip to content

Commit 6a5ac8d

Browse files
gurukamathSamWilsn
authored andcommitted
eip(Osaka): Implement EIP-7594 (#1325)
* Implement EIP-7594 * run latest json fixtures * update to latest eest
1 parent 6aa56cd commit 6a5ac8d

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

eest_tests/execution-spec-tests

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies = [
2626
"ethereum-types>=0.2.4,<0.3",
2727
"ethereum-rlp>=0.1.4,<0.2",
2828
"cryptography>=45.0.1,<46",
29-
"ethereum-execution-spec-tests @ git+https://github.com/ethereum/execution-spec-tests@6cf5107cee0eae1c2d4dd6a5ef5bc729aea6c379",
29+
"ethereum-execution-spec-tests @ git+https://github.com/ethereum/execution-spec-tests@0fdd974b0968e443ef5878430ba5194c43149a4b",
3030
"ethereum-spec-evm-resolver @ git+https://github.com/petertdavies/ethereum-spec-evm-resolver",
3131
]
3232

src/ethereum/osaka/exceptions.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ class NoBlobDataError(InvalidTransaction):
9797
"""
9898

9999

100+
class BlobCountExceededError(InvalidTransaction):
101+
"""
102+
The transaction has more blobs than the limit.
103+
"""
104+
105+
100106
class PriorityFeeGreaterThanMaxFeeError(InvalidTransaction):
101107
"""
102108
The priority fee is greater than the maximum fee per gas.

src/ethereum/osaka/fork.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from .blocks import Block, Header, Log, Receipt, Withdrawal, encode_receipt
3434
from .bloom import logs_bloom
3535
from .exceptions import (
36+
BlobCountExceededError,
3637
BlobGasLimitExceededError,
3738
EmptyAuthorizationListError,
3839
InsufficientMaxFeePerBlobGasError,
@@ -112,6 +113,7 @@
112113
MAX_BLOCK_SIZE = 10_485_760
113114
SAFETY_MARGIN = 2_097_152
114115
MAX_RLP_BLOCK_SIZE = MAX_BLOCK_SIZE - SAFETY_MARGIN
116+
BLOB_COUNT_LIMIT = 6
115117

116118

117119
@dataclass
@@ -440,6 +442,8 @@ def check_transaction(
440442
version.
441443
NoBlobDataError :
442444
If the transaction is a type 3 but has no blobs.
445+
BlobCountExceededError :
446+
If the transaction is a type 3 and has nore blobs than the limit.
443447
TransactionTypeContractCreationError:
444448
If the transaction type is not allowed to create contracts.
445449
EmptyAuthorizationListError :
@@ -484,8 +488,13 @@ def check_transaction(
484488
max_gas_fee = tx.gas * tx.gas_price
485489

486490
if isinstance(tx, BlobTransaction):
487-
if len(tx.blob_versioned_hashes) == 0:
491+
blob_count = len(tx.blob_versioned_hashes)
492+
if blob_count == 0:
488493
raise NoBlobDataError("no blob data in transaction")
494+
if blob_count > BLOB_COUNT_LIMIT:
495+
raise BlobCountExceededError(
496+
f"Tx has {blob_count} blobs. Max allowed: {BLOB_COUNT_LIMIT}"
497+
)
489498
for blob_versioned_hash in tx.blob_versioned_hashes:
490499
if blob_versioned_hash[0:1] != VERSIONED_HASH_VERSION_KZG:
491500
raise InvalidBlobVersionedHashError(

tests/helpers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class _FixtureSource(TypedDict):
2727
"fixture_path": "tests/fixtures/latest_fork_tests",
2828
},
2929
"osaka_tests": {
30-
"url": "https://github.com/ethereum/execution-spec-tests/releases/download/fusaka-devnet-2%40v1.2.0/fixtures_fusaka-devnet-2.tar.gz",
30+
"url": "https://github.com/ethereum/execution-spec-tests/releases/download/fusaka-devnet-3%40v1.0.0/fixtures_fusaka-devnet-3.tar.gz",
3131
"fixture_path": "tests/fixtures/osaka_tests",
3232
},
3333
}

0 commit comments

Comments
 (0)