pokt-network / pocket

Official implementation of the Pocket Network Protocol v1
https://pokt.network
MIT License
61 stars 33 forks source link

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

Closed h5law closed 1 year ago

h5law commented 1 year ago

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):

List of changes

Testing

Required Checklist

If Applicable Checklist

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 7.22% and project coverage change: -0.06 :warning:

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

Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/pokt-network/pocket/pull/843?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pokt-network) | Coverage Δ | | |---|---|---| | [persistence/trees/trees.go](https://app.codecov.io/gh/pokt-network/pocket/pull/843?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pokt-network#diff-cGVyc2lzdGVuY2UvdHJlZXMvdHJlZXMuZ28=) | `2.60% <7.22%> (+2.60%)` | :arrow_up: |

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

Olshansk commented 1 year ago

@dylanlott I think this one is close to approving but figured we should probably merge persistence/tree-store to main first and rebase/merge this with main?

Lmk if you have a preference

gitguardian[bot] commented 1 year ago

⚠️ 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](https://dashboard.gitguardian.com/incidents/5841025?occurrence=99217204) | Generic High Entropy Secret | 690a0adf2652414bd1f78a549e756926cd220fac | charts/pocket/templates/configmap-genesis.yaml | [View secret](https://github.com/pokt-network/pocket/commit/690a0adf2652414bd1f78a549e756926cd220fac#diff-33d68fb410c6b83957f59a2c6fcdc96d62a90d236e6a2a65bf24b205baa46f5dR1799) |
🛠 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](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices. 3. Revoke and [rotate this secret](https://docs.gitguardian.com/secrets-detection/detectors/generics/generic_high_entropy_secret#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 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 - following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials - install [secret detection on pre-commit](https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.

🦉 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!