-
Notifications
You must be signed in to change notification settings - Fork 449
fix(ported_static): fork-specific Amsterdam balance for OoG refund tests #2790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
leolara
wants to merge
1
commit into
ethereum:devnets/snøbal/4
Choose a base branch
from
leolara:wt-snobal-4-amsterdam-oog-balances
base: devnets/snøbal/4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+195
−40
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,6 +3,10 @@ | |||||
|
|
||||||
| Ported from: | ||||||
| state_tests/stCreate2/Create2OOGFromCallRefundsFiller.yml | ||||||
|
|
||||||
| @manually-enhanced: Do not overwrite. Post-state expectations include | ||||||
| fork-specific overrides for Amsterdam (EIP-8037 changes the OoG refund | ||||||
| arithmetic; sender keeps a non-zero residue). | ||||||
| """ | ||||||
|
|
||||||
| import pytest | ||||||
|
|
@@ -979,6 +983,45 @@ def test_create2_oog_from_call_refunds( | |||||
| ), | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| # EIP-8037 (Amsterdam) two-dimensional gas model changes the | ||||||
| # OoG refund — sender keeps a non-zero residue. Listed before | ||||||
| # the >=Cancun entry so resolve_expect_post matches Amsterdam | ||||||
| # specifically (first-match wins). | ||||||
| "indexes": { | ||||||
| "data": [1, 2, 4, 5, 7, 8, 10, 11], | ||||||
| "gas": -1, | ||||||
| "value": -1, | ||||||
| }, | ||||||
| "network": [">=Amsterdam"], | ||||||
| "result": { | ||||||
| sender: Account(balance=0x19CBC0, nonce=2), | ||||||
| Address( | ||||||
| 0x95E88628C53B5C0E40FF6DE65A3CF8CDC3B477F7 | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0x66E1CC2616A273450621C8CC5E91D8CFD92494FA | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0x6175BA9976476425B1CDA8E1DA479768FB429542 | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0x8DFF0E448F1E078E9B8A7FCF0BF6C291F167AAEF | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0xA2C4270800A5DBEEA48464E5F2420EFB1747725A | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0x4D80F1150EE236ADFAAB47C70DF90E757CEF1141 | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0x0566DC8DABC80FAD3ED9AB2B4309EBFD98894F44 | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0x55305CC46BDAF1E755A05A771D55CFEC3FEDEF90 | ||||||
| ): Account.NONEXISTENT, | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| "indexes": { | ||||||
| "data": [1, 2, 4, 5, 7, 8, 10, 11], | ||||||
|
|
@@ -1025,6 +1068,23 @@ def test_create2_oog_from_call_refunds( | |||||
| contract_26: Account(balance=0, nonce=1), | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| # Amsterdam refund residue (see SStore_Refund_OoG comment). | ||||||
| "indexes": {"data": [13, 14], "gas": -1, "value": -1}, | ||||||
| "network": [">=Amsterdam"], | ||||||
| "result": { | ||||||
| sender: Account(balance=0x19CBC0, nonce=2), | ||||||
| Address( | ||||||
| 0x8F6E6C741AC95C1A9109850EA1A3FFC722DC3BF8 | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0x1F5D187BB3A48DBB2C011D0A6E731AC8131799AD | ||||||
| ): Account.NONEXISTENT, | ||||||
| contract_26: Account( | ||||||
| storage={1: 1}, code=bytes.fromhex("32ff"), nonce=1 | ||||||
| ), | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| "indexes": {"data": [13, 14], "gas": -1, "value": -1}, | ||||||
| "network": [">=Cancun"], | ||||||
|
|
@@ -1051,6 +1111,20 @@ def test_create2_oog_from_call_refunds( | |||||
| ), | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| # Amsterdam refund residue (see SStore_Refund_OoG comment). | ||||||
| "indexes": {"data": [16, 17], "gas": -1, "value": -1}, | ||||||
| "network": [">=Amsterdam"], | ||||||
| "result": { | ||||||
| sender: Account(balance=0x19CBC0, nonce=2), | ||||||
| Address( | ||||||
| 0x74B39291DFC237C0D42FD15457754778F51C6DE8 | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0x3399C78929EAB89C673A8986FF7CA9CCC49DB454 | ||||||
| ): Account.NONEXISTENT, | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| "indexes": {"data": [16, 17], "gas": -1, "value": -1}, | ||||||
| "network": [">=Cancun"], | ||||||
|
|
@@ -1077,6 +1151,27 @@ def test_create2_oog_from_call_refunds( | |||||
| ), | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| # Amsterdam refund residue is larger for the SStore+Create | ||||||
| # paths (see SStore_Refund_OoG comment). | ||||||
| "indexes": {"data": [19, 20], "gas": -1, "value": -1}, | ||||||
| "network": [">=Amsterdam"], | ||||||
| "result": { | ||||||
| sender: Account(balance=0x284E5C, nonce=2), | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, you could have another helper like: residue_sstore_create = (
fork.create_state_gas(code_size=0)
+ fork.create_state_gas(code_size=1)
) * gas_priceand then this line becomes:
Suggested change
|
||||||
| Address( | ||||||
| 0xF922B2F70110C83F8EC7DF512B41BAC5627E8E59 | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0x2CA788D22E21134AB1909266ED3B6C352E2A07CB | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0x398426E736801FE712DF1EF078A3B6CA3C6F063B | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0xB520686759CED3BC9D8898E02EE41623032FF47F | ||||||
| ): Account.NONEXISTENT, | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| "indexes": {"data": [19, 20], "gas": -1, "value": -1}, | ||||||
| "network": [">=Cancun"], | ||||||
|
|
@@ -1109,6 +1204,26 @@ def test_create2_oog_from_call_refunds( | |||||
| ), | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| # Amsterdam refund residue (see SStore_Create_Refund_OoG). | ||||||
| "indexes": {"data": [22, 23], "gas": -1, "value": -1}, | ||||||
| "network": [">=Amsterdam"], | ||||||
| "result": { | ||||||
| sender: Account(balance=0x284E5C, nonce=2), | ||||||
| Address( | ||||||
| 0xDD2C53BFCAF5C1D698A2B21C0908F15F7FBFD635 | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0x2D556BDBCC37C7A021879A21ABE25D1850D4FD36 | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0xA99DA4EA490335C986D52B0CC9E3F78B286AC5FC | ||||||
| ): Account.NONEXISTENT, | ||||||
| Address( | ||||||
| 0xB4AB8AB0D363765586925E35C715E342E4AE3C63 | ||||||
| ): Account.NONEXISTENT, | ||||||
| }, | ||||||
| }, | ||||||
| { | ||||||
| "indexes": {"data": [22, 23], "gas": -1, "value": -1}, | ||||||
| "network": [">=Cancun"], | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is manually-enhanced anyway, I wonder if it's worth making a couple helpers to do this calculation instead of hard coding so that when
cpsbinevitably changes, this test (and the create test below) will automatically pick it up. I think we also won't need this>=Amsterdambranch because these helpers will return 0 before Amsterdam. Maybe something like:Then this line becomes something like: