Conversation
3a5f553 to
33198ac
Compare
33198ac to
64e838a
Compare
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #756 +/- ##
==========================================
- Coverage 31.52% 30.86% -0.67%
==========================================
Files 107 108 +1
Lines 9034 9228 +194
==========================================
Hits 2848 2848
- Misses 5846 6040 +194
Partials 340 340
☔ View full report in Codecov by Sentry. |
e7ab3db to
5ecc3b5
Compare
0c86257 to
1446460
Compare
|
|
||
| ## [0.0.0.56] - 2023-06-02 | ||
|
|
||
| - Renamed an error used by Badger / KVStore |
There was a problem hiding this comment.
The code patch provided appears to be part of a project's CHANGELOG. This file is meant to keep track of changes made to the project over time, rather than containing actual code for review. Nevertheless, I can give comments on this particular entry:
- The date format and versioning seem consistent with the previous entries, based on the visible fragment.
- There are two changes described:
a) Refactoring stateTrees implementation: This could be positive, as it mentions moving the functionality into its own module, potentially improving code organization and maintainability. However, without examining the specific code changes, it's impossible to determine if this refactoring improved the code quality or introduced any bugs.
b) Implementing Update and Commit pattern with SMT trees: Without more context on what the "Update and Commit" pattern is and how it relates to SMT trees, I cannot give specific feedback on whether this is an improvement or risk. It would be helpful to provide additional details or references regarding these concepts for better understanding.
In summary, while there doesn't seem to be anything inherently risky in these descriptions, it would be necessary to examine the actual code changes themselves to give relevant feedback on bug risks and improvements.
|
|
||
| ## [0.0.0.40] - 2023-06-01 | ||
|
|
||
| - Add an Address field to Servicer configuration |
There was a problem hiding this comment.
The provided code patch shows a small update in the project's changelog, detailing changes in version 0.0.0.41. Here's a brief review:
-
Typo: There appears to be a typo in the description of the change - "consitency" should be spelled as "consistency". Please fix this to avoid confusion.
-
Clarity: The description of the change, "Rename package import for consistency and clarity," is slightly vague. It could be more informative by specifically mentioning which package imports were renamed. This would provide better understanding and context related to the changes.
Overall, the code patch seems minimal and straightforward, but it can be improved by fixing the spelling error and providing more specific details about the package imports being renamed.
|
|
||
| ## [0.0.0.13] - 2023-06-02 | ||
|
|
||
| - Added `GetIndexedTransaction` to the `UtilityModule` interface to be able to retrieve an indexed transaction without running the underlying business logic |
There was a problem hiding this comment.
The provided code patch represents the addition of a new release/version (0.0.0.14) to a changelog for a project that adheres to Semantic Versioning. Here are my feedback and suggestions:
-
It seems you're following an incorrect version numbering format; semantic versioning typically follows the pattern
MAJOR.MINOR.PATCH. You may consider updating the version number to0.14.0. -
The entry in the changelog indicates that the
TreeStoreinterface has been defined, but there's no actual code snippet available for inspection. To provide a thorough review, please share the relevant code changes. -
When providing information about updates in the changelog, ensure they describe the impact with sufficient detail to help users understand what's new or changed. For example, mentioning the purpose/benefits of the
TreeStoreinterface and any key methods introduced would be helpful.
Olshansk
left a comment
There was a problem hiding this comment.
@dylanlott Do you plan on adding any unit tests to this?
|
|
||
| // Interface defining the context within which the node can operate with the persistence layer. | ||
| // Operations in the context of a PersistenceContext are isolated from other operations and | ||
| // other persistence contexts until committed, enabling parallelizability along other operations. |
There was a problem hiding this comment.
Overall, the code patch seems to be well-structured and clear. However, here's a brief review with some suggestions for improvement:
-
Comment consistency:
Some comments are formatted as full sentences with capitalization and punctuation, while others are not. For consistency, it would be better to choose one style and apply it throughout the comments. For example, update,// BlockStore maps a block height to an *coreTypes.IndexedTransactionto
// BlockStore maps a block height to an *coreTypes.IndexedTransaction. -
Import organization:
Although not mandatory, it's a best practice to organize imports into three groups: standard library imports, third-party imports, and local (same project) imports. In your case, consider organizing the imports like this:import ( // Standard library imports if any "github.com/jackc/pgx/v5" // ... other third-party imports "github.com/pokt-network/pocket/persistence/blockstore" "github.com/pokt-network/pocket/persistence/indexer" "github.com/pokt-network/pocket/runtime/genesis" // ... other local imports )
-
Error handling:
The addition of new methods to thePersistenceModuleinterface and the newTreeStoreinterface brings more opportunities for errors. Ensure that you have appropriate error handling in place when these methods are implemented in concrete implementations of these interfaces. -
Interface segregation:
Consider whether it's necessary to extend thePersistenceModuleinterface with theGetTreeStore() TreeStoremethod or if creating a separate interface that embeds bothPersistenceModuleandTreeStorewould achieve better separation of concerns. This may help you keep the code modular, making it easier to maintain and test.
Aside from these suggestions, the code patch seems well-structured and presents low risk of introducing bugs.
Yes, was planning on future PRs with more test coverage. This PR was meant to bring the refactor online and achieve test parity. |
0aa8aad to
70537ca
Compare
Olshansk
left a comment
There was a problem hiding this comment.
Let's get this over the finish line!
Co-authored-by: Daniel Olshansky <olshansky@pokt.network>
## Description Refactors the TreeStore to use the Module pattern and register it on the Bus. Addresses comment from #756 by @Olshansk about making the TreeStore a full module. ## Issue <img width="836" alt="image" src="https://github.com/pokt-network/pocket/assets/5915948/30fae7fb-26b3-49ed-a8b5-f336bcf43707"> Addresses refactor from #756 mentioned above. ## Type of change Please mark the relevant option(s): - [ ] New feature, functionality or library - [ ] Bug fix - [x] Code health or cleanup - [ ] Major breaking change - [ ] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - Adds the TreeStore module plumbing - Creates the TreeStoreModule interface in shared/modules ## Testing - [x] `make develop_test`; if any code changes were made - [ ] `make test_e2e` on [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any code changes were made - [ ] `e2e-devnet-test` passes tests on [DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd); if any code was changed - [ ] [Docker Compose LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md); if any major functionality was changed or introduced - [ ] [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any infrastructure or configuration changes were made <!-- REMOVE this comment block after following the instructions If you added additional tests or infrastructure, describe it here. Bonus points for images and videos or gifs. --> ## 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](https://go.dev/blog/godoc) on touched members (see: [tip.golang.org/doc/comment](https://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](https://mermaid-js.github.io) diagrams in the corresponding README(s) - [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s) --------- Co-authored-by: Daniel Olshansky <olshansky.daniel@gmail.com>
## Description Refactors the TreeStore to use the Module pattern and register it on the Bus. Addresses comment from #756 by @Olshansk about making the TreeStore a full module. ## Issue <img width="836" alt="image" src="https://github.com/pokt-network/pocket/assets/5915948/30fae7fb-26b3-49ed-a8b5-f336bcf43707"> Addresses refactor from #756 mentioned above. ## Type of change Please mark the relevant option(s): - [ ] New feature, functionality or library - [ ] Bug fix - [x] Code health or cleanup - [ ] Major breaking change - [ ] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - Adds the TreeStore module plumbing - Creates the TreeStoreModule interface in shared/modules ## Testing - [x] `make develop_test`; if any code changes were made - [ ] `make test_e2e` on [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any code changes were made - [ ] `e2e-devnet-test` passes tests on [DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd); if any code was changed - [ ] [Docker Compose LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md); if any major functionality was changed or introduced - [ ] [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any infrastructure or configuration changes were made <!-- REMOVE this comment block after following the instructions If you added additional tests or infrastructure, describe it here. Bonus points for images and videos or gifs. --> ## 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](https://go.dev/blog/godoc) on touched members (see: [tip.golang.org/doc/comment](https://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](https://mermaid-js.github.io) diagrams in the corresponding README(s) - [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s) --------- Co-authored-by: Daniel Olshansky <olshansky.daniel@gmail.com>
## Description Loads the TreeStore from a proper module and allows it access to the bus. ## Issue Refactor related to #756 This PR is the sum of feedback from #808. ## Type of change Please mark the relevant option(s): - [ ] New feature, functionality or library - [ ] Bug fix - [x] Code health or cleanup - [ ] Major breaking change - [ ] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - Makes the TreeStore component into a proper module. - Removes the txIndexer from the Update method interface. ## Testing - [x] `make develop_test`; if any code changes were made - [x] `make test_e2e` on [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any code changes were made - [ ] `e2e-devnet-test` passes tests on [DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd); if any code was changed - [ ] [Docker Compose LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md); if any major functionality was changed or introduced - [ ] [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); 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](https://go.dev/blog/godoc) on touched members (see: [tip.golang.org/doc/comment](https://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](https://mermaid-js.github.io) diagrams in the corresponding README(s) - [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s)
## Description - [Persistence] Adds a logger to TreeStore module ## Issue Enabled by changes introduced in #756 and #808 ## Type of change Please mark the relevant option(s): - [ ] New feature, functionality or library - [ ] Bug fix - [x] Code health or cleanup - [ ] Major breaking change - [ ] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - Adds a logger to the tree store ## Testing - [x] `make develop_test`; if any code changes were made - [x] `make test_e2e` on [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any code changes were made - [ ] `e2e-devnet-test` passes tests on [DevNet](https://pocketnetwork.notion.site/How-to-DevNet-ff1598f27efe44c09f34e2aa0051f0dd); if any code was changed - [ ] [Docker Compose LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md); if any major functionality was changed or introduced - [ ] [k8s LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md); if any infrastructure or configuration changes were made ## Required Checklist - [x] 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](https://go.dev/blog/godoc) on touched members (see: [tip.golang.org/doc/comment](https://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](https://mermaid-js.github.io) diagrams in the corresponding README(s) - [ ] I have added, or updated, documentation and [mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*` if I updated `shared/*`README(s)
Description
Refactors the stateTrees component behind the TreeStore interface.
Issue
Part of a refactor effort towards implementing #562
Part of a series of refactors in the persistence package, with #736 being the first.
Type of change
Please mark the relevant option(s):
List of changes
Testing
make develop_test; if any code changes were madeRequired Checklist
godocformat comments on touched members (see: tip.golang.org/doc/comment)If Applicable Checklist
shared/docs/*if I updatedshared/*README(s)