-
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
…429) (#521) ## Description This PR has been extracted from #491 and is, hopefully, more digestible from a code-review and scope point of view. The main goal is to remove hardcoded nodes and move towards a more dynamic environment. It's also highlighting the potential entry points for subsequent P2P work The code leverages the abstractions added recently (`currentHeightProvider` and `addressBookProvider`) to fetch the data from an RPC endpoint. ## Issue Fixes #416 Fixes #429 ## Type of change Please mark the relevant option(s): - [x] New feature, functionality or library - [ ] Bug fix - [ ] Code health or cleanup - [x] Major breaking change - [ ] Documentation - [ ] Other <!-- add details here if it a different type of change --> ## List of changes ### CLI - Updated CLI to use to source the address book and the current height from the RPC server leveraging the `rpcAddressBookProvider` and `rpcCurrentHeightProvider` respectively and the `bus` for dependency injection ### P2P - Modules embed `base_modules.IntegratableModule` and `base_modules.InterruptableModule` for DRYness - Deprecated `debugAddressBookProvider` - Added `rpcAddressBookProvider` to source the address book from the RPC server - Leveraging `bus` for dependency injection of the `addressBookProvider` and `currentHeightProvider` - Deprecated `debugCurrentHeightProvider` - Added `rpcCurrentHeightProvider` to source the current height from the RPC server - Fixed raintree to use the `currentHeightProvider` instead of consensus (that was what we wanted to avoid in the first place) - Added `getAddrBookDelta` to calculate changes to the address book between heights and update the internal state and componentry accordingly - Reacting to `ConsensusNewHeightEventType` to update the address book - Updated tests ### RPC - Updated RPC to expose the node's address book via GET /v1/p2p/staked_actors_address_book ## 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 - [ ] 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 <[email protected]> Co-authored-by: Dmitry K <[email protected]> Co-authored-by: Dmitry Knyazev <[email protected]> Co-authored-by: Daniel Olshansky <[email protected]> Co-authored-by: Daniel Olshansky <[email protected]>
- Loading branch information
1 parent
d7060b1
commit a90d766
Showing
35 changed files
with
789 additions
and
275 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
Oops, something went wrong.