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

chore(trie): proof code refactoring and fixes #2604

Merged
merged 24 commits into from
Jul 7, 2022

Commits on Jul 4, 2022

  1. Merge in internal/trie/proof

    - `lib/trie` proof files
    - `internal/trie/record` package
    qdm12 committed Jul 4, 2022
    Configuration menu
    Copy the full SHA
    47e2d0b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    50e221e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f641cb4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f93b54c View commit details
    Browse the repository at this point in the history
  5. Refactor proof functions

    - Only verify for a single key and value
    - Produce ordered proof encoded nodes from root to leaves
    - Node deduplication logic removed (now unneeded)
    - Remove recorder code (now unneeded)
    - Generate uses a `Database` smaller interface
    - Better error wrapping
    - Error when key is not found in trie when generating proof
    - Generate only generates proof encoded nodes for a single given key
    qdm12 committed Jul 4, 2022
    Configuration menu
    Copy the full SHA
    e5dc44e View commit details
    Browse the repository at this point in the history
  6. Move proof trie build functions to internal/trie/proof

    - `buildTrie` returns a `*trie.Trie`
    - `loadProof` only acts on a parent node pointer
    - Older `LoadFromProof` and `loadProof` functions removed from `trie/database.go`
    qdm12 committed Jul 4, 2022
    Configuration menu
    Copy the full SHA
    90d2546 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7285e16 View commit details
    Browse the repository at this point in the history
  8. Add check for root not found

    qdm12 committed Jul 4, 2022
    Configuration menu
    Copy the full SHA
    31ccd8e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    6882bb6 View commit details
    Browse the repository at this point in the history
  10. Add tests with full coverage

    - More context to error wrapping
    - Verify function only returns an error
    qdm12 committed Jul 4, 2022
    Configuration menu
    Copy the full SHA
    ce04e19 View commit details
    Browse the repository at this point in the history
  11. Remove older tests

    qdm12 committed Jul 4, 2022
    Configuration menu
    Copy the full SHA
    e8d88b4 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    b64e74b View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    b5b33c2 View commit details
    Browse the repository at this point in the history
  14. Add Verify export comment

    qdm12 committed Jul 4, 2022
    Configuration menu
    Copy the full SHA
    2c89af8 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    ea84414 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    ee988d5 View commit details
    Browse the repository at this point in the history
  17. Review some error wrappings

    qdm12 committed Jul 4, 2022
    Configuration menu
    Copy the full SHA
    da0c760 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    84b5a57 View commit details
    Browse the repository at this point in the history
  19. Comments fixes

    qdm12 committed Jul 4, 2022
    Configuration menu
    Copy the full SHA
    9a5bb95 View commit details
    Browse the repository at this point in the history
  20. Add walk benchmark

    qdm12 committed Jul 4, 2022
    Configuration menu
    Copy the full SHA
    9f70103 View commit details
    Browse the repository at this point in the history
  21. Rename variables

    - `proofHashToNode` to `merkleValueToNode`
    - `proofHash` to `merkleValue`
    qdm12 committed Jul 4, 2022
    Configuration menu
    Copy the full SHA
    99541b9 View commit details
    Browse the repository at this point in the history
  22. WIP

    qdm12 committed Jul 4, 2022
    Configuration menu
    Copy the full SHA
    69cd49f View commit details
    Browse the repository at this point in the history
  23. Generate generates deduplicated encoded proof nodes for N full keys

    - Load trie only once from database
    - Move StorageState `GenerateTrieProof` to `lib/trie/proof` package
    - Update tests
    qdm12 committed Jul 4, 2022
    Configuration menu
    Copy the full SHA
    53e4a64 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    25b4e57 View commit details
    Browse the repository at this point in the history