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
[SPIKE][Consensus] Remove validatorMap from the consensusModule struct - (Issue #331) (#425)
## Description
This PR builds upon #402 and removes `validatorMap` from the
`consensusModule` struct, encapsulating the logic so that the validator
set is dynamic and retrieved from the `persistence` module.
Also, since the change introduced the natural dependency on
`persistence`, it made me question and revisit the way the modules
register themselves with the `bus` and also how the modules are
instantiated.
In an effort to simply the codebase and testing, while we improve the
way we do dependency injection, the modules now are instantiated with a
`bus` that will allow them to access to all the dependencies they need.
Previously the modules required a `runtimeMgr` in their constructor and
the bus registration was handled like an after-thought.
## Issue
Fixes#331
## Type of change
Please mark the relevant option(s):
- [x] 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
- Removed `validatorMap` from `consensusModule` and encapsulated the
logic so that it's dynamic, per-height and sourced from `persistence`
- Refactored module registration in `bus`
- Refactored modules instantiation and DI (`runtimeMgr` -> `bus`)
- The `runtimeMgr` is now a dependency and it can be accessed via the
bus
- Minor improvements in tests
## 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
- [ ] I have updated the corresponding CHANGELOG
### If Applicable Checklist
- [x] 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)
Signed-off-by: Alessandro De Blasis <[email protected]>
Co-authored-by: Daniel Olshansky <[email protected]>
Copy file name to clipboardexpand all lines: app/client/cli/doc/CHANGELOG.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
-
## [0.0.0.4] - 2023-01-09
10
+
## [0.0.0.4] - 2023-01-10
11
11
12
12
- The `client` (i.e. CLI) no longer instantiates a `P2P` module along with a bus of optional modules. Instead, it instantiates a `client-only``P2P` module that is disconnected from consensus and persistence. Interactions with the persistence & consensus layer happen via RPC.
13
13
- Replaced previous implementation, reliant on `ValidatorMap`, with a temporary fetch from genesis. This will be replaced with a lightweight peer discovery mechanism in #416
0 commit comments