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

evm-statemanager #67

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open

evm-statemanager #67

wants to merge 29 commits into from

Conversation

SoujanyaPonnapalli
Copy link
Member

@SoujanyaPonnapalli SoujanyaPonnapalli commented Feb 1, 2019

This PR adds the following features:

  • MerklePatriciaTree class supports copy and createReadStream now.

    • copy: Sets a flag which says that the updates henceforth to the tree should not happen in place. If the flag is set, the nodes in the search path for the key are copied and the copied path is updated to have the key. So if a copied tree is updated; the original tree remains unchanged.
    • createReadStream: returns all the key value pairs stores in the trie as a readable stream of {key: key, value: value} pairs
  • CheckpointTrie extends MerklePatriciaTree to support commit, revert and checkpoint

    • Checkpoint: Creates a checkpoint that can later be reverted back to or committed to. Updates to the tree after a checkpoint will be temporary until a commit is called.
    • Commit: Finalizes the temporary updates, if there are no nested checkpoints. If there are, drops the latest checkpoint and sets its parent as the current checkpoint
    • Revert : Revert to the most recent checkpoint. If there are nested checkpoints, sets the parent of the recent checkpoint as the current checkpoint.
  • SecureTrie extends CheckpointTrie
    This class stores/retrieves values in/from the trie against the hashed key.

Tests for CheckpointTrie and SecureTrie are added based on the tests in the ethereumjs/merkle-patricia-tree repo.

@SoujanyaPonnapalli SoujanyaPonnapalli added the don't merge Needs more work before merging label Feb 1, 2019
@s1na
Copy link

s1na commented May 9, 2019

Hello! I was looking for a way to implement checkpointing on top of your library and found this PR. I was wondering about the status, and wanted to offer my help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
don't merge Needs more work before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants