Skip to content

fix: use getStateDiffJson instead of getStorageAccesses to avoid MemoryOOG - #1

Merged
NandyBa merged 1 commit into
mainfrom
fix/memory-oog-storage-validation
Mar 14, 2026
Merged

fix: use getStateDiffJson instead of getStorageAccesses to avoid MemoryOOG#1
NandyBa merged 1 commit into
mainfrom
fix/memory-oog-storage-validation

Conversation

@NandyBa

@NandyBa NandyBa commented Mar 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • _validateNoExecutorStorageChange (introduced in Feat/storage diff aave-dao/aave-helpers#662) calls vm.getStorageAccesses() which materializes all storage accesses into a Solidity memory array
  • On mainnet fork (AaveV3Ethereum) with dozens of assets, the e2e test generates so many storage accesses that this causes EvmError: MemoryOOG — even with multi-GB memory_limit
  • Replace with vm.parseJsonKeys() on the already-available getStateDiffJson() output, which checks for executor storage changes without allocating a massive array into EVM memory
  • Fix applied to both ProtocolV3TestBase and ProtocolV2TestBase

Test plan

  • Verify test_noExecutorStorageChange_passes still passes
  • Verify test_executorStorageChange_reverts still catches storage modifications
  • Run defaultTest against AaveV3Ethereum (mainnet) — previously caused MemoryOOG, should now pass

🤖 Generated with Claude Code

…ryOOG

vm.getStorageAccesses() materializes all storage accesses into a Solidity
memory array. On mainnet fork with many assets, this causes EvmError: MemoryOOG
even with multi-GB memory limits.

Replace with vm.parseJsonKeys on the already-available getStateDiffJson output,
which checks for executor storage changes without allocating a massive array.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@NandyBa NandyBa closed this Mar 14, 2026
@NandyBa NandyBa reopened this Mar 14, 2026
@NandyBa
NandyBa merged commit f17738d into main Mar 14, 2026
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.

1 participant