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

[Persistence] Change root hash calculation to use an SMT #843

Merged
merged 68 commits into from
Jun 25, 2023

Conversation

h5law
Copy link
Contributor

@h5law h5law commented Jun 19, 2023

Description

Summary generated by Reviewpad on 23 Jun 23 10:35 UTC

This pull request contains several file diffs with various updates and additions. The implementation of the setupTrees function in module.go has been updated to use a new stateTree struct and additional error handling. The Pocket V1 protocol state hash document has been updated with changes to various infrastructural components and the computation of the state hash. The persistence_module.go file has a new GetTreeStore() method, and treestore_module.go file has a new import statement and GetTree() function. Additionally, the utility/session_test.go and state.go test cases have been updated with new values and logic changes.

Issue

Fixes #834

Type of change

Please mark the relevant option(s):

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Major breaking change
  • Documentation
  • Other

List of changes

  • Update root hash computation to insert different trees hashes and tree name into the tree then compute the root of the tree giving the root hash

Testing

  • make develop_test; if any code changes were made
  • make test_e2e on k8s LocalNet; if any code changes were made
  • e2e-devnet-test passes tests on DevNet; if any code was changed
  • Docker Compose LocalNet; if any major functionality was changed or introduced
  • k8s LocalNet; if any infrastructure or configuration changes were made

Required Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added, or updated, godoc format comments on touched members (see: tip.golang.org/doc/comment)
  • I have tested my changes using the available tooling
  • I have updated the corresponding CHANGELOG

If Applicable Checklist

  • I have updated the corresponding README(s); local and/or global
  • I have added tests that prove my fix is effective or that my feature works
  • I have added, or updated, mermaid.js diagrams in the corresponding README(s)
  • I have added, or updated, documentation and mermaid.js diagrams in shared/docs/* if I updated shared/*README(s)

@h5law h5law added the persistence Persistence specific changes label Jun 19, 2023
@h5law h5law added this to the M3: Pocket RoS (Relay or Slash) milestone Jun 19, 2023
@h5law h5law requested review from Olshansk and dylanlott June 19, 2023 10:13
@h5law h5law self-assigned this Jun 19, 2023
@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Jun 19, 2023
@codecov
Copy link

codecov bot commented Jun 19, 2023

Codecov Report

Patch coverage: 7.22% and project coverage change: -0.06 ⚠️

Comparison is base (e64af30) 30.86% compared to head (d4e1694) 30.80%.

Additional details and impacted files
@@                    Coverage Diff                     @@
##           persistence/tree-store     #843      +/-   ##
==========================================================
- Coverage                   30.86%   30.80%   -0.06%     
==========================================================
  Files                         108      108              
  Lines                        9228     9264      +36     
==========================================================
+ Hits                         2848     2854       +6     
- Misses                       6040     6070      +30     
  Partials                      340      340              
Impacted Files Coverage Δ
persistence/trees/trees.go 2.60% <7.22%> (+2.60%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@reviewpad reviewpad bot added medium Pull request is medium and removed small Pull request is small labels Jun 19, 2023
@h5law h5law added the e2e-devnet-test Runs E2E tests on devnet label Jun 19, 2023
@reviewpad reviewpad bot added large Pull request is large and removed medium Pull request is medium labels Jun 21, 2023
@gitguardian
Copy link

gitguardian bot commented Jun 21, 2023

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id Secret Commit Filename
5841025 Generic High Entropy Secret 690a0ad charts/pocket/templates/configmap-genesis.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@reviewpad reviewpad bot added medium Pull request is medium and removed large Pull request is large labels Jun 21, 2023
@h5law h5law changed the base branch from persistence/tree-store to main June 22, 2023 10:51
@reviewpad reviewpad bot added large Pull request is large and removed medium Pull request is medium labels Jun 22, 2023
@reviewpad reviewpad bot added medium Pull request is medium and removed large Pull request is large labels Jun 22, 2023
@h5law h5law force-pushed the persistence/root-hash-tree branch from 76b75fb to b168429 Compare June 23, 2023 10:33
@h5law h5law requested a review from Olshansk June 23, 2023 12:49
@h5law h5law merged commit 9276154 into main Jun 25, 2023
9 checks passed
@h5law h5law deleted the persistence/root-hash-tree branch June 25, 2023 09:25
bryanchriswhite added a commit that referenced this pull request Jun 28, 2023
* pokt/main:
  [IBC] Create initial IBC module (#842)
  [Persistence] Adds TreeStore logger (#852)
  [Persistence] Change root hash calculation to use an SMT (#843)
bryanchriswhite added a commit that referenced this pull request Jun 28, 2023
* refactor/unicast-router:
  fix: return error
  chore: cleanup unused garbage
  chore: add missing godoc comments
  chore: add submodule TECHDEBT comments
  chore: comment cleanup
  chore: cleanup unused test utils
  [IBC] Create initial IBC module (#842)
  [Persistence] Adds TreeStore logger (#852)
  [Persistence] Change root hash calculation to use an SMT (#843)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e-devnet-test Runs E2E tests on devnet medium Pull request is medium persistence Persistence specific changes waiting-for-review
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Persistence] Change the state root hash computation mechanism
3 participants