-
Notifications
You must be signed in to change notification settings - Fork 33
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
[Utility][Persistence][Consensus] Implement SavePoints & Rollbacks #562
Comments
@deblasis This is a goal? Are you implying that it's a stretch goal that may be possible, but you don't want to make it one of the deliverables? |
The goal was to have a discussion about it and here we are :) I was meant to raise this yesterday but I forgot. I think that the moonshot part should be a separate issue in the backlog. Thoughts? |
Agreed. Side note: I accidentally just discovered that if I highlight part of your message and click "quote reply", it only quotes the part that I highlighted. |
…into UtilityUnitOfWork (Issue #563) (#577) ## Description This PR creates the logical abstraction that would represent the "Unit Of Work" (inspired by [Martin Fowler's work in his "Patterns of Enterprise Application Architecture"](https://martinfowler.com/eaaCatalog/unitOfWork.html)) Essentially what previously was known as `UtilityContext` becomes `LeaderUtilityUnitOfWork` or `ReplicaUtilityUnitOfWork` depending on the fact that the current node is the Leader or not (in Consensus). It touches many files because it moves everything that is interacting with `Persistence` into the `utility/unit_of_work` folder. This is to facilitate subsequent refactorings (see related PRs under #562) into more modular components. This PR also sets the ground up for the completion of #508 ## Issue Fixes #563 ## Type of change Please mark the relevant option(s): - [x] New feature, functionality or library - [ ] Bug fix - [ ] Code health or cleanup - [ ] Major breaking change - [ ] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes - Refactored `UtilityContext` to be a polymorphic `UtilityOfWork` - Introduced `LeaderUtilityUnitOfWork` and `ReplicaUtilityUnitOfWork` that expose the methods that are going be to used depending on the "role" of the node in the consensus process. - Moved `utilityContext` related code under `utility/unit_of_work` and renamed all references accordingly ## Testing - [x] `make develop_test` - [x] [LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md) w/ all of the steps outlined in the `README` <!-- 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 - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have tested my changes using the available tooling - [x] I have updated the corresponding CHANGELOG ### If Applicable Checklist - [x] 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) --------- Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
## Description This PR refactors the persistence module to create the BlockStore interface. In doing so, it stops higher level components from directly calling the KVStore and exposes specialized GetBlock and StoreBlock functions instead. These two will eventually be wrapped with savepoints and rollbacks logic to facilitate atomic commits to the block store. ## Issue Parts of #562 ## 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 - Creates the BlockStore interface and replaces mocks to use it where possible - Forces height and block serialization handling down into the BlockStore module, making it cleaner and easier to get any block from the bus. ## 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 - [x] `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 - [x] [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 - [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)) - [x] 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 This PR refactors the persistence module to create the BlockStore interface. In doing so, it stops higher level components from directly calling the KVStore and exposes specialized GetBlock and StoreBlock functions instead. These two will eventually be wrapped with savepoints and rollbacks logic to facilitate atomic commits to the block store. ## Issue Parts of #562 ## 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 - Creates the BlockStore interface and replaces mocks to use it where possible - Forces height and block serialization handling down into the BlockStore module, making it cleaner and easier to get any block from the bus. ## 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 - [x] `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 - [x] [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 - [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)) - [x] 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): - [ ] 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 - Pulls the stateTrees component down into its own component behind a dedicated interface for managing the SMT store. ## Testing - [x] `make develop_test`; if any code changes were made - [ ] [Docker Compose LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md); if any major functionality was changed or introduced - [x] [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) --------- Co-authored-by: Daniel Olshansky <olshansky.daniel@gmail.com> Co-authored-by: Daniel Olshansky <olshansky@pokt.network>
Objective
This issue is going to be an "umbrella" ticket/epic used to wrap and link all the intermediate steps/deliverables that are necessary to build
Savepoints
andRollbacks
as highlighted in the Design Document - Issue #493Origin Document
This is the result of R&D work on #508 which was essentially asking the assignee to build savepoints and rollbacks, just with a different wording thanks to a more "practical" problem to solve.
Goals
Deliverable
UtilityContext
intoUtilityUnitOfWork
#563UtilityUnitOfWork
to allow ephemeral state and remove side effects #564Non-goals / Non-deliverables
Consensus
General issue deliverables
Testing Methodology
make ...
make ...
make test_all
LocalNet
is still functioning correctly by following the instructions at docs/development/README.mdCreator: @deblasis
Co-Owners: @Olshansk
The text was updated successfully, but these errors were encountered: