Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix(forking): leverage the requested block number when getting forked storage #613

Merged
merged 3 commits into from
Aug 25, 2020

Conversation

mikeseese
Copy link
Contributor

This PR resolves #573 leveraging the direction proposed by @nebojsa94. If we're getting storage prior to the fork, we don't even bother with ForkedStorageTrie and use eth_getStorageAt in ForkedBlockchain.getStorage. If we do end up hitting the forked storage trie, then we make sure we get the requested block state root prior to looking up storage

I believe there is a possible cleaner architecture, but with other refactoring efforts going on plus the time to refactor in the old codebase, I feel like this is an acceptable solution.

@coveralls
Copy link

coveralls commented Aug 20, 2020

Coverage Status

Coverage decreased (-0.008%) to 82.573% when pulling e53379c on fix/forking-storage-by-block into a8a4d8f on develop.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 82.563% when pulling 3f56085 on fix/forking-storage-by-block into a8a4d8f on develop.

@nebojsa94
Copy link
Contributor

@seesemichaelj Thank you for implementing these changes, looks good!

lib/forking/forked_blockchain.js Outdated Show resolved Hide resolved
@davidmurdoch davidmurdoch merged commit e05e67e into develop Aug 25, 2020
@davidmurdoch davidmurdoch deleted the fix/forking-storage-by-block branch August 25, 2020 00:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eth_getStorageAt with block number parameter doesn't return correct result when using fork feature
4 participants