Skip to content

Commit b22e901

Browse files
authored
fix(forks,tests): EIP-2935, EIP-7002 and EIP-7251: Final Prague system contracts address update (#1155)
* feat(tools): Check and verify tx hash and sender on deploy contract tests * fix(forks): Update 2935, 7002 and 7251 system contract addresses * fix(tests): Update 2935, 7002 and 7251 system contract addresses * changelog * docs: CHANGELOG * docs: fix
1 parent 9b84e40 commit b22e901

File tree

10 files changed

+36
-29
lines changed

10 files changed

+36
-29
lines changed

docs/CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ Release tarball changes:
2626
-[EIP-7623](https://eips.ethereum.org/EIPS/eip-7623) Increase calldata cost ([#1004](https://github.com/ethereum/execution-spec-tests/pull/1004), [#1071](https://github.com/ethereum/execution-spec-tests/pull/1071))
2727
- ✨ Add generic precompile-absence test ([#1036](https://github.com/ethereum/execution-spec-tests/pull/1036))
2828
- ✨ Add test for [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537) which uses the full discount table of G2 MSM ([#1038](https://github.com/ethereum/execution-spec-tests/pull/1038))
29-
- 🔀 Update EIP-7251 according to [spec updates](https://github.com/ethereum/EIPs/pull/9127) ([#1024](https://github.com/ethereum/execution-spec-tests/pull/1024)).
30-
- 🔀 Update EIP-7002 according to [spec updates](https://github.com/ethereum/EIPs/pull/9119) ([#1024](https://github.com/ethereum/execution-spec-tests/pull/1024)).
31-
- 🔀 Update EIP-2935 according to [spec updates](https://github.com/ethereum/EIPs/pull/9144) ([#1046](https://github.com/ethereum/execution-spec-tests/pull/1046))
29+
- 🔀 Update EIP-7251 according to spec updates [#9127](https://github.com/ethereum/EIPs/pull/9127), [#9289](https://github.com/ethereum/EIPs/pull/9289) ([#1024](https://github.com/ethereum/execution-spec-tests/pull/1024), [#1155](https://github.com/ethereum/execution-spec-tests/pull/1155)).
30+
- 🔀 Update EIP-7002 according to spec updates [#9119](https://github.com/ethereum/EIPs/pull/9119), [#9288](https://github.com/ethereum/EIPs/pull/9288) ([#1024](https://github.com/ethereum/execution-spec-tests/pull/1024), [#1155](https://github.com/ethereum/execution-spec-tests/pull/1155)).
31+
- 🔀 Update EIP-2935 according to spec updates [#9144](https://github.com/ethereum/EIPs/pull/9144), [#9287](https://github.com/ethereum/EIPs/pull/9287) ([#1046](https://github.com/ethereum/execution-spec-tests/pull/1046), [#1155](https://github.com/ethereum/execution-spec-tests/pull/1155))
3232
-[EIP-7691](https://eips.ethereum.org/EIPS/eip-7691) Blob throughput increase tests by parametrization of existing EIP-4844 tests ([#1023](https://github.com/ethereum/execution-spec-tests/pull/1023), [#1082](https://github.com/ethereum/execution-spec-tests/pull/1082))
3333
- 🔀 Update EIP-7702 test expectations according to [spec updates](https://github.com/ethereum/EIPs/pull/9248) ([#1129](https://github.com/ethereum/execution-spec-tests/pull/1129))
3434
- ✨ Port [calldatacopy test](https://github.com/ethereum/tests/blob/ae4791077e8fcf716136e70fe8392f1a1f1495fb/src/GeneralStateTestsFiller/VMTests/vmTests/calldatacopyFiller.yml) ([#1056](https://github.com/ethereum/execution-spec-tests/pull/1056)).

src/ethereum_test_forks/forks/forks.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,9 +1093,9 @@ def system_contracts(cls, block_number: int = 0, timestamp: int = 0) -> List[Add
10931093
"""Prague introduces the system contracts for EIP-6110, EIP-7002, EIP-7251 and EIP-2935."""
10941094
return [
10951095
Address(0x00000000219AB540356CBB839CBE05303D7705FA),
1096-
Address(0x0C15F14308530B7CDB8460094BBB9CC28B9AAAAA),
1097-
Address(0x00431F263CE400F4455C2DCF564E53007CA4BBBB),
1098-
Address(0x0F792BE4B0C0CB4DAE440EF133E90C0ECD48CCCC),
1096+
Address(0x00000961EF480EB55E80D19AD83579A64C007002),
1097+
Address(0x0000BBDDC7CE488642FB579F8B00F3A590007251),
1098+
Address(0x0000F90827F1C53A10CB7A02335B175320002935),
10991099
] + super(Prague, cls).system_contracts(block_number, timestamp)
11001100

11011101
@classmethod
@@ -1224,33 +1224,33 @@ def pre_allocation_blockchain(cls) -> Mapping:
12241224
}
12251225
)
12261226

1227-
# Add the withdrawal request contract
1227+
# EIP-7002: Add the withdrawal request contract
12281228
with open(CURRENT_FOLDER / "contracts" / "withdrawal_request.bin", mode="rb") as f:
12291229
new_allocation.update(
12301230
{
1231-
0x0C15F14308530B7CDB8460094BBB9CC28B9AAAAA: {
1231+
0x00000961EF480EB55E80D19AD83579A64C007002: {
12321232
"nonce": 1,
12331233
"code": f.read(),
12341234
},
12351235
}
12361236
)
12371237

1238-
# Add the consolidation request contract
1238+
# EIP-7251: Add the consolidation request contract
12391239
with open(CURRENT_FOLDER / "contracts" / "consolidation_request.bin", mode="rb") as f:
12401240
new_allocation.update(
12411241
{
1242-
0x00431F263CE400F4455C2DCF564E53007CA4BBBB: {
1242+
0x0000BBDDC7CE488642FB579F8B00F3A590007251: {
12431243
"nonce": 1,
12441244
"code": f.read(),
12451245
},
12461246
}
12471247
)
12481248

1249-
# Add the history storage contract
1249+
# EIP-2935: Add the history storage contract
12501250
with open(CURRENT_FOLDER / "contracts" / "history_contract.bin", mode="rb") as f:
12511251
new_allocation.update(
12521252
{
1253-
0x0F792BE4B0C0CB4DAE440EF133E90C0ECD48CCCC: {
1253+
0x0000F90827F1C53A10CB7A02335B175320002935: {
12541254
"nonce": 1,
12551255
"code": f.read(),
12561256
}

src/ethereum_test_tools/utility/generators.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import pytest
99

10-
from ethereum_test_base_types import Account, Address
10+
from ethereum_test_base_types import Account, Address, Hash
1111
from ethereum_test_forks import Fork
1212
from ethereum_test_specs import BlockchainTestFiller
1313
from ethereum_test_specs.blockchain import Block
@@ -102,6 +102,10 @@ def generate_system_contract_deploy_test(
102102
assert gas_price is not None
103103
deployer_required_balance = deploy_tx.gas_limit * gas_price
104104
deployer_address = deploy_tx.sender
105+
if "hash" in tx_json:
106+
assert deploy_tx.hash == Hash(tx_json["hash"])
107+
if "sender" in tx_json:
108+
assert deploy_tx.sender == Address(tx_json["sender"])
105109

106110
def decorator(func: SystemContractDeployTestFunction):
107111
@pytest.mark.parametrize(

tests/prague/eip2935_historical_block_hashes_from_state/contract_deploy_tx.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"input": "0x60538060095f395ff33373fffffffffffffffffffffffffffffffffffffffe14604657602036036042575f35600143038111604257611fff81430311604257611fff9006545f5260205ff35b5f5ffd5b5f35611fff60014303065500",
1111
"v": "0x1b",
1212
"r": "0x539",
13-
"s": "0xbaefe09f0109759",
14-
"hash": "0x8c7bd2d3713a0b2bb693463d2a78c4d612ac47dd38ecb74f8996a4b6fc96f03c"
13+
"s": "0x0aa12693182426612186309f02cfe8a80a0000",
14+
"hash": "0x67139a552b0d3fffc30c0fa7d0c20d42144138c8fe07fc5691f09c1cce632e15",
15+
"sender": "0x3462413Af4609098e1E27A490f554f260213D685"
1516
}

tests/prague/eip2935_historical_block_hashes_from_state/spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ class Spec:
2222
"""
2323

2424
FORK_TIMESTAMP = 15_000
25-
HISTORY_STORAGE_ADDRESS = 0x0F792BE4B0C0CB4DAE440EF133E90C0ECD48CCCC
25+
HISTORY_STORAGE_ADDRESS = 0x0000F90827F1C53A10CB7A02335B175320002935
2626
HISTORY_SERVE_WINDOW = 8191
2727
BLOCKHASH_OLD_WINDOW = 256

tests/prague/eip7002_el_triggerable_withdrawals/contract_deploy_tx.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"input": "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5f556101f880602d5f395ff33373fffffffffffffffffffffffffffffffffffffffe1460cb5760115f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff146101f457600182026001905f5b5f82111560685781019083028483029004916001019190604d565b909390049250505036603814608857366101f457346101f4575f5260205ff35b34106101f457600154600101600155600354806003026004013381556001015f35815560010160203590553360601b5f5260385f601437604c5fa0600101600355005b6003546002548082038060101160df575060105b5f5b8181146101835782810160030260040181604c02815460601b8152601401816001015481526020019060020154807fffffffffffffffffffffffffffffffff00000000000000000000000000000000168252906010019060401c908160381c81600701538160301c81600601538160281c81600501538160201c81600401538160181c81600301538160101c81600201538160081c81600101535360010160e1565b910180921461019557906002556101a0565b90505f6002555f6003555b5f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14156101cd57505f5b6001546002828201116101e25750505f6101e8565b01600290035b5f555f600155604c025ff35b5f5ffd",
1111
"v": "0x1b",
1212
"r": "0x539",
13-
"s": "0xeb793ed1dcd82833",
14-
"hash": "0xe89c48ef3308192a0768aefaa5128559e68ab87b5b9a6d113824551867746a20",
15-
"protected": false
13+
"s": "0x5feeb084551e4e03a3581e269bc2ea2f8d0008",
14+
"hash": "0x8ded54be89448d78d4bc97782c0187b099e45380ab681742f9d3754e405c2572",
15+
"protected": false,
16+
"sender": "0x8646861A7cF453dDD086874d622b0696dE5b9674"
1617
}

tests/prague/eip7002_el_triggerable_withdrawals/spec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class Spec:
3030
out.
3131
"""
3232

33-
WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS = 0x0C15F14308530B7CDB8460094BBB9CC28B9AAAAA
34-
WITHDRAWAL_REQUEST_PREDEPLOY_SENDER = Address(0xA05D9EED37862DAB22B002B8F6668B8FB0C4D798)
33+
WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS = 0x00000961EF480EB55E80D19AD83579A64C007002
34+
WITHDRAWAL_REQUEST_PREDEPLOY_SENDER = Address(0x8646861A7CF453DDD086874D622B0696DE5B9674)
3535
SYSTEM_ADDRESS = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE
3636

3737
EXCESS_WITHDRAWAL_REQUESTS_STORAGE_SLOT = 0

tests/prague/eip7251_consolidations/contract_deploy_tx.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"input": "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5f5561019e80602d5f395ff33373fffffffffffffffffffffffffffffffffffffffe1460d35760115f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1461019a57600182026001905f5b5f82111560685781019083028483029004916001019190604d565b9093900492505050366060146088573661019a573461019a575f5260205ff35b341061019a57600154600101600155600354806004026004013381556001015f358155600101602035815560010160403590553360601b5f5260605f60143760745fa0600101600355005b6003546002548082038060021160e7575060025b5f5b8181146101295782810160040260040181607402815460601b815260140181600101548152602001816002015481526020019060030154905260010160e9565b910180921461013b5790600255610146565b90505f6002555f6003555b5f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff141561017357505f5b6001546001828201116101885750505f61018e565b01600190035b5f555f6001556074025ff35b5f5ffd",
1111
"v": "0x1b",
1212
"r": "0x539",
13-
"s": "0x332601ef36aa2ce9",
14-
"hash": "0xc7d223eb06267248bcd21f7af0223c8d467ef7e95ff51cef84c616973692169f",
15-
"protected": false
13+
"s": "0x0c0730f92dc275b663d377a7cbb141b6600052",
14+
"hash": "0x379269d571beff3ed1d8eba3abb24076a7267b0eaf0cc66d728fb0544f5a690d",
15+
"protected": false,
16+
"sender": "0x13d1913d623E6a9D8811736359E50fD31Fe54fCA"
1617
}

tests/prague/eip7251_consolidations/spec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class Spec:
2424
https://eips.ethereum.org/EIPS/eip-7251#execution-layer.
2525
"""
2626

27-
CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS = 0x00431F263CE400F4455C2DCF564E53007CA4BBBB
28-
CONSOLIDATION_REQUEST_PREDEPLOY_SENDER = Address(0xE24B968AB4319A580D9FFC7AC29466894FEEB361)
27+
CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS = 0x0000BBDDC7CE488642FB579F8B00F3A590007251
28+
CONSOLIDATION_REQUEST_PREDEPLOY_SENDER = Address(0x13D1913D623E6A9D8811736359E50FD31FE54FCA)
2929
SYSTEM_ADDRESS = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE
3030

3131
EXCESS_CONSOLIDATION_REQUESTS_STORAGE_SLOT = 0

tests/prague/eip7702_set_code_tx/test_set_code_txs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,7 +2648,7 @@ def test_set_code_to_system_contract(
26482648
)
26492649
caller_payload = deposit_request.calldata
26502650
call_value = deposit_request.value
2651-
case Address(0x0C15F14308530B7CDB8460094BBB9CC28B9AAAAA): # EIP-7002
2651+
case Address(0x00000961EF480EB55E80D19AD83579A64C007002): # EIP-7002
26522652
# Fabricate a valid withdrawal request to the set-code account
26532653
withdrawal_request = WithdrawalRequest(
26542654
source_address=0x01,
@@ -2658,7 +2658,7 @@ def test_set_code_to_system_contract(
26582658
)
26592659
caller_payload = withdrawal_request.calldata
26602660
call_value = withdrawal_request.value
2661-
case Address(0x00431F263CE400F4455C2DCF564E53007CA4BBBB): # EIP-7251
2661+
case Address(0x0000BBDDC7CE488642FB579F8B00F3A590007251): # EIP-7251
26622662
# Fabricate a valid consolidation request to the set-code account
26632663
consolidation_request = ConsolidationRequest(
26642664
source_address=0x01,
@@ -2668,7 +2668,7 @@ def test_set_code_to_system_contract(
26682668
)
26692669
caller_payload = consolidation_request.calldata
26702670
call_value = consolidation_request.value
2671-
case Address(0x0F792BE4B0C0CB4DAE440EF133E90C0ECD48CCCC): # EIP-2935
2671+
case Address(0x0000F90827F1C53A10CB7A02335B175320002935): # EIP-2935
26722672
caller_payload = Hash(0)
26732673
caller_code_storage[call_return_data_size_slot] = 32
26742674
case _:

0 commit comments

Comments
 (0)