-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
## Description The first implementation of the ## Issue Fixes #284 with follow up work in #361. ## Type of change Please mark the relevant option(s): - [x] New feature, functionality or library - [x] Bug fix - [x] Code health or cleanup - [x] Major breaking change - [x] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes ### Persistence - Core Changes for SMT * Introduced & defined for `block_persistence.proto` * A persistence specific protobuf for the Block stored in the BlockStore * On `Commit`, prepare and store a persistence block in the KV Store, SQL Store * Replace `IndexTransactions` (plural) to `IndexTransaction` (singular) * Maintaining a list of StateTrees using Celestia’s SMT and badger as the KV store to compute the state hash * Implemented `ComputeStateHash` to update the global state based on: * Validators * Applications * Servicers * Fisherman * Accounts * Pools * Transactions * Added a placeholder for `params` and `flags` * Added a benchmarking and a determinism test suite to validate this ### Persistence - General module changes * Implemented `GetAccountsUpdated`, `GetPoolsUpdated` and `GetActorsUpdated` functions * Removed `GetPrevAppHash` and `indexTransactions` functions * Removed `blockProtoBytes` and `txResults` from the local state and added `quorumCert` * Consolidate all `resetContext` related operations into a single function * Implemented `ReleaseWriteContext` * Implemented ability to `ClearAllState` and `ResetToGenesis` for debugging & testing purposes * Added unit tests for all of the supporting SQL functions implemented * Some improvements in unit test preparation & cleanup (limited to this PR's functionality) ### Persistence - KVStore changes * Renamed `Put` to `Set` * Embedded `smt.MapStore` in the interface containing `Get`, `Set` and `Delete` * Implemented `Delete` * Modified `GetAll` to return both `keys` and `values` * Turned off badger logging options since it’s noisy ### Persistence - Module Interface changes * Removed `GetPrevHash` and just using `GetBlockHash` instead * Removed `blockProtoBz` from `SetProposalBlock` interface * Removed `GetLatestBlockTxs` and `SetLatestTxResults` in exchange for `IndexTransaction` * Removed `SetTxResults` * Renamed `UpdateAppHash` to `ComputeStateHash` * Removed some getters related to the proposal block (`GetBlockTxs`, `GetBlockHash`, etc…) ### Consensus * Propagate `highPrepareQC` if available to the block being created * Remove `blockProtoBytes` from propagation in `SetProposalBlock` * Guarantee that `writeContext` is released when refreshing the `utilityContext` * Use `GetBlockHash(height)` instead of `GetPrevAppHash` to be more explicit * Use the real `quorumCert` when preparing a new block ### Configs * Updated the test generator to produce deterministic keys * Added `trees_store_dir` to persistence configs * Updated `LocalNet` configs to have an empty `tx_indexer_path` and `trees_store_dir` ### Makefile changes * Added `db_cli_node` * Added `db_show_schemas` * Added `test_persistence_state_hash` * Added `benchmark_persistence_state_hash` ### Debug * `ResetToGenesis` - Added the ability to reset the state to genesis * `ClearState` - Added the ability to clear the state completely (height 0 without genesis data) ## Testing **New:** - [x] `make benchmark_persistence_state_hash` - [x] `make test_persistence_state_hash` - [x] Iteration 3 demo was done using this PR: https://drive.google.com/file/d/1IOrzq-XJP04BJjyqPPpPu873aSfwrnur/view?usp=sharing **Existing:** - [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` ## 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 - [ ] I have updated the corresponding README(s); local and/or global - [x] 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: Alessandro De Blasis <alex@deblasis.net> Co-authored-by: Irving A.J. Rivas Z. <axel.rivas@gmail.com> Co-authored-by: Andrew Nguyen <amnguyen1@mail.usf.edu> Co-authored-by: Daniel Olshansky <olshansky.daniel@gmail.com> Co-authored-by: Jason You <Jasonyou1995@users.noreply.github.com> Co-authored-by: Dmitry Knyazev <okdas@users.noreply.github.com>
- Loading branch information
1 parent
5ab966e
commit 9a2f643
Showing
72 changed files
with
2,066 additions
and
485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SELECT schema_name FROM information_schema.schemata; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.