Skip to content

Commit 67f596d

Browse files
authored
fix(tests): Fix test expectations for BAL oog tests (#2293)
* fix(tests): Fix test expectations for BAL oog tests * chore: update Amsterdam commit hash for resolver * chore: add changelog entry
1 parent 9dff8d6 commit 67f596d

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

.github/configs/eels_resolutions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@
5252
"Amsterdam": {
5353
"git_url": "https://github.com/fselmo/execution-specs.git",
5454
"branch": "feat/amsterdam-fork-and-block-access-lists",
55-
"commit": "5d98d409da10f763754dea8d60e855395f944498"
55+
"commit": "f3ad59980a68fe5974244f41bcda7b22294bf98b"
5656
}
5757
}

docs/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Test fixtures for use by clients are available for each release on the [Github r
1818

1919
### 🧪 Test Cases
2020

21+
- 🐞Fix BALs opcode OOG test vectors by updating the Amsterdam commit hash in specs and validating appropriately on the testing side ([#2293](https://github.com/ethereum/execution-spec-tests/pull/2293)).
22+
2123
## [v5.3.0](https://github.com/ethereum/execution-spec-tests/releases/tag/v5.3.0) - 2025-10-09
2224

2325
## 🇯🇵 Summary

src/pytest_plugins/eels_resolutions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@
5555
"Amsterdam": {
5656
"git_url": "https://github.com/fselmo/execution-specs.git",
5757
"branch": "feat/amsterdam-fork-and-block-access-lists",
58-
"commit": "5d98d409da10f763754dea8d60e855395f944498"
58+
"commit": "f3ad59980a68fe5974244f41bcda7b22294bf98b"
5959
}
6060
}

tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_opcodes.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def test_bal_balance_and_oog(
233233
account_expectations={
234234
balance_checker: BalAccountExpectation.empty(),
235235
# Bob should only appear in BAL if BALANCE succeeded
236-
**({} if fails_at_balance else {bob: BalAccountExpectation.empty()}),
236+
**({bob: None} if fails_at_balance else {bob: BalAccountExpectation.empty()}),
237237
}
238238
),
239239
)
@@ -303,7 +303,7 @@ def test_bal_extcodesize_and_oog(
303303
codesize_checker: BalAccountExpectation.empty(),
304304
# Target should only appear if EXTCODESIZE succeeded
305305
**(
306-
{}
306+
{target_contract: None}
307307
if fails_at_extcodesize
308308
else {target_contract: BalAccountExpectation.empty()}
309309
),
@@ -375,7 +375,7 @@ def test_bal_call_and_oog(
375375
account_expectations={
376376
call_contract: BalAccountExpectation.empty(),
377377
# Bob should only appear if CALL succeeded
378-
**({} if fails_at_call else {bob: BalAccountExpectation.empty()}),
378+
**({bob: None} if fails_at_call else {bob: BalAccountExpectation.empty()}),
379379
}
380380
),
381381
)
@@ -450,7 +450,7 @@ def test_bal_delegatecall_and_oog(
450450
delegatecall_contract: BalAccountExpectation.empty(),
451451
# Target should only appear if DELEGATECALL succeeded
452452
**(
453-
{}
453+
{target_contract: None}
454454
if fails_at_delegatecall
455455
else {target_contract: BalAccountExpectation.empty()}
456456
),
@@ -504,9 +504,10 @@ def test_bal_extcodecopy_and_oog(
504504

505505
# Costs:
506506
# - 4 PUSH operations = G_VERY_LOW * 4
507-
# - EXTCODECOPY cold = G_COLD_ACCOUNT_ACCESS + G_COPY (base cost)
507+
# - EXTCODECOPY cold = G_COLD_ACCOUNT_ACCESS + (G_COPY * words)
508+
# where words = ceil32(size) // 32 = ceil32(0) // 32 = 0
508509
push_cost = gas_costs.G_VERY_LOW * 4
509-
extcodecopy_cold_cost = gas_costs.G_COLD_ACCOUNT_ACCESS + gas_costs.G_COPY
510+
extcodecopy_cold_cost = gas_costs.G_COLD_ACCOUNT_ACCESS # + (G_COPY * 0) = 0
510511
tx_gas_limit = intrinsic_gas_cost + push_cost + extcodecopy_cold_cost
511512

512513
if fails_at_extcodecopy:
@@ -526,7 +527,7 @@ def test_bal_extcodecopy_and_oog(
526527
extcodecopy_contract: BalAccountExpectation.empty(),
527528
# Target should only appear if EXTCODECOPY succeeded
528529
**(
529-
{}
530+
{target_contract: None}
530531
if fails_at_extcodecopy
531532
else {target_contract: BalAccountExpectation.empty()}
532533
),

0 commit comments

Comments
 (0)