You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Persistence] TxIndexer to StateHash Bridge (Issue-#315) (#332)
## Description
**TL;DR Encapsulate and commit the block and block parts within a persistence context**
The objective of this issue is to "bridge" the work being done in #302 (tx indexer integration) and #285 (first state hash implementation.
The interface and diagrams for the state hash computation were being done in #252 while the first implementation began in #285. However, since both of these are dependent on the integration of the tx indexer in #302, some conflicting design decisions arose.
The goal of this ticket is to unblock #302, while also capturing the results of an offline discussion that led to a decision where the "ephemeral block state" should be wholly managed by the persistence context, being a single, "roll-backable" point of reference
- [x] **Enable committing of a block to persistence by simply committing the persistence context**
- [x] Remove ephemeral block-related state from the consensus module & utility module, and only maintain it in the persistence module
- [x] Simply outward-facing module interfaces to only rely on primitive types
- [ ] Remove validatorMap from the consensusModule struct state & access it from the persistence layer (added n the past)
Opened new issue for last one to prevent scope from getting out of hand: #331
## Issue
Fixes#315
## Type of change
Please mark the relevant option(s):
- [ ] New feature, functionality or library
- [ ] Bug fix
- [x] Code health or cleanup
- [x] Major breaking change
- [ ] Documentation
- [ ] Other <!-- add details here if it a different type of change -->
## List of changes
<!-- List out all the changes made-->
- Removed `apphash` and `txResults` from `consensus Module` structure
- Modified lifecycle to `set` the proposal block within a Persistence Context
- Allow block and parts to be committed with the persistence context
- Ported over storing blocks and block parts to persistence module from Consensus and Utility
- Encapsulate TxIndexer logic only inside the persistence context
- Remove TxResult from the utility module interface (added in [TxIndexer] Integration of transaction indexer (issue-#168) #302)
- Combined creation and application of block in proposer lifecycle
## 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`
## 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
- [ ] 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)
0 commit comments