Skip to content
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

fix prunning: use correct state root and don't require account address #276

Merged
merged 2 commits into from
Dec 27, 2023

Conversation

magicxyyz
Copy link
Contributor

@magicxyyz magicxyyz commented Dec 6, 2023

This PR:

  • uses block root as state root in trie.StorageTrieID call (previously leaf key was passed)

    type ID struct {
    StateRoot common.Hash // The root of the corresponding state(block.root)
    Owner common.Hash // The contract address hash which the trie belongs to
    Root common.Hash // The root hash of trie
    }

    // StorageTrieID constructs an identifier for storage trie which belongs to a certain
    // state and contract specified by the stateRoot and owner.
    func StorageTrieID(stateRoot common.Hash, owner common.Hash, root common.Hash) *ID {
    return &ID{
    StateRoot: stateRoot,
    Owner: owner,
    Root: root,
    }
    }

  • similarly to upstream, uses trie.NewStateTrie directly instead of OpenStorageTrie to not require preimage of account address hash

@cla-bot cla-bot bot added the s label Dec 6, 2023
@magicxyyz magicxyyz changed the title pruning fix - don't require account address when opening storage trie fix prunning: don't require account address when opening storage trie Dec 6, 2023
@magicxyyz magicxyyz changed the title fix prunning: don't require account address when opening storage trie fix prunning: use correct state root and don't require account address Dec 14, 2023
@magicxyyz magicxyyz marked this pull request as ready for review December 15, 2023 16:05
Copy link
Collaborator

@PlasmaPower PlasmaPower left a comment

Choose a reason for hiding this comment

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

LGTM

@PlasmaPower PlasmaPower merged commit dff302d into master Dec 27, 2023
3 checks passed
@PlasmaPower PlasmaPower deleted the fix-pruner-account-address-not-available branch December 27, 2023 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants