Skip to content

fix: skip storage verification for empty storage dict#2325

Open
mandeepmourya007 wants to merge 2 commits intoethereum:forks/amsterdamfrom
mandeepmourya007:fix/empty-storage-check-2162
Open

fix: skip storage verification for empty storage dict#2325
mandeepmourya007 wants to merge 2 commits intoethereum:forks/amsterdamfrom
mandeepmourya007:fix/empty-storage-check-2162

Conversation

@mandeepmourya007
Copy link
Copy Markdown
Contributor

Closes #2162

Account(storage={}) caused infinite loop when verifying storage over RPC (attempting to check 2^256 keys). Skip storage check when no keys are specified - empty storage dict is now treated as 'allow any storage values'.

🗒️ Description

🔗 Related Issues or PRs

N/A.

✅ Checklist

  • All: Ran fast tox checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    uvx tox -e static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

Copy link
Copy Markdown
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is modifying the behavior that a lot of tests expect.

We need to:

  1. Define a new sentinel value Storage.EMPTY (perhaps simply equal to None) that is used to signal that the test expects the storage to be completely empty.
  2. Go through all tests that are currently doing Account(storage={}) and use the sentinel value instead, to make sure that the checks remain the same for these tests
  3. Modify TransactionPost to handle the sentinel value in the way that the original issue describes (Using eth_getProof for example).

Closes ethereum#2162

- Add Storage.EMPTY sentinel value to explicitly verify empty storage
- Account(storage={}) is now meaningless and allows any storage values
- Add eth_getProof method to EthRPC for Storage.EMPTY verification
- TransactionPost uses eth_getProof to verify empty storage root
- Update tests to use Storage.EMPTY where empty storage check is needed
@mandeepmourya007 mandeepmourya007 force-pushed the fix/empty-storage-check-2162 branch from 561faf4 to 5327cb4 Compare February 27, 2026 10:17
@mandeepmourya007
Copy link
Copy Markdown
Contributor Author

This change is modifying the behavior that a lot of tests expect.

We need to:

  1. Define a new sentinel value Storage.EMPTY (perhaps simply equal to None) that is used to signal that the test expects the storage to be completely empty.
  2. Go through all tests that are currently doing Account(storage={}) and use the sentinel value instead, to make sure that the checks remain the same for these tests
  3. Modify TransactionPost to handle the sentinel value in the way that the original issue describes (Using eth_getProof for example).

@marioevz please check i update PR but not sure why my old commit lost

@marioevz
Copy link
Copy Markdown
Member

This change is modifying the behavior that a lot of tests expect.
We need to:

  1. Define a new sentinel value Storage.EMPTY (perhaps simply equal to None) that is used to signal that the test expects the storage to be completely empty.
  2. Go through all tests that are currently doing Account(storage={}) and use the sentinel value instead, to make sure that the checks remain the same for these tests
  3. Modify TransactionPost to handle the sentinel value in the way that the original issue describes (Using eth_getProof for example).

@marioevz please check i update PR but not sure why my old commit lost

Thanks, I see the changes and looks very good so far!

One missing thing though is that we need to search for tests doing post = Account(..., storage={}, ...) because this PR changes the meaning of this, and most of the tests should be updated to now do post = Account(..., storage=Storage.EMPTY, ...), otherwise we are going to skip checks on those tests that currently expect the storage to be empty.

@marioevz marioevz self-assigned this Feb 27, 2026
Update 23 test files to use Storage.EMPTY instead of storage={}
for explicit empty storage verification. This ensures tests that
expect empty storage continue to verify it correctly after the
semantic change where storage={} now allows any storage values.
@mandeepmourya007
Copy link
Copy Markdown
Contributor Author

This change is modifying the behavior that a lot of tests expect.
We need to:

  1. Define a new sentinel value Storage.EMPTY (perhaps simply equal to None) that is used to signal that the test expects the storage to be completely empty.
  2. Go through all tests that are currently doing Account(storage={}) and use the sentinel value instead, to make sure that the checks remain the same for these tests
  3. Modify TransactionPost to handle the sentinel value in the way that the original issue describes (Using eth_getProof for example).

@marioevz please check i update PR but not sure why my old commit lost

Thanks, I see the changes and looks very good so far!

One missing thing though is that we need to search for tests doing post = Account(..., storage={}, ...) because this PR changes the meaning of this, and most of the tests should be updated to now do post = Account(..., storage=Storage.EMPTY, ...), otherwise we are going to skip checks on those tests that currently expect the storage to be empty.

please have a look I updated other test cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Account(storage={}) infinite loop-checks account storage over RPC

2 participants