[Libp2p] Add libp2p based P2P Network implementation (part 3)#540
Merged
bryanchriswhite merged 33 commits intomainfrom Mar 3, 2023
Merged
[Libp2p] Add libp2p based P2P Network implementation (part 3)#540bryanchriswhite merged 33 commits intomainfrom
Network implementation (part 3)#540bryanchriswhite merged 33 commits intomainfrom
Conversation
1cb3837 to
a329579
Compare
6d71f72 to
27cfe05
Compare
a329579 to
1b30f05
Compare
(cherry picked from commit 27cfe05)
27cfe05 to
01e970f
Compare
86b4161 to
a329579
Compare
16 tasks
(cherry picked from commit 2c8989f)
deblasis
reviewed
Feb 28, 2023
deblasis
reviewed
Feb 28, 2023
deblasis
reviewed
Feb 28, 2023
deblasis
reviewed
Feb 28, 2023
deblasis
reviewed
Feb 28, 2023
deblasis
reviewed
Feb 28, 2023
deblasis
reviewed
Feb 28, 2023
Comment on lines
+73
to
+74
| // IMPROVE: receive context in interface methods. | ||
| ctx := context.Background() |
Contributor
There was a problem hiding this comment.
Not actionable: 💯 it's something that we should do across the board more or less. I am dealing with this in persistence at the moment. It's fun!
deblasis
suggested changes
Feb 28, 2023
Contributor
deblasis
left a comment
There was a problem hiding this comment.
Nice one @bryanchriswhite! A couple minor changes but otherwise LGTM 🚀
deblasis
reviewed
Feb 28, 2023
deblasis
approved these changes
Feb 28, 2023
Contributor
deblasis
left a comment
There was a problem hiding this comment.
There's a small typo but I trust you to fix it even if I am approving this. :)
Closed
6 tasks
* main: [Libp2p] Add libp2p module directories and helpers (part 1) (#534) [P2P, Runtime] Update P2P & base config (part 2) (#535) [Utility] Foundational bugs, tests, code cleanup and improvements (2/3) (#550) [CONSENSUS] Find issue with sending metadata request (#548) [Tooling] SLIP-0010 HD Child Key Generation (#510)
This comment was marked as outdated.
This comment was marked as outdated.
bryanchriswhite
added a commit
that referenced
this pull request
Mar 3, 2023
## Description This is another of a series of PRs split out from #500. Here we add a new `modules.P2PModule` implementation which utilizes the `typesP2P.Network` implementation which was added in #540. It will be utilized together with the config changes introduced by #535 in forthcoming changes to the node and debug CLI. ## Issue #347 ## 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 - Added a new `modules.P2PModule` implementation to the `libp2p` module directory ## 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 - [ ] 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)
Olshansk
reviewed
Mar 9, 2023
| // PoktProtocolID is the libp2p protocol ID used when opening a new stream | ||
| // to a remote peer and setting the stream handler for the local peer. | ||
| // Libp2p APIs use this to distinguish which multiplexed protocols/streams to consider. | ||
| PoktProtocolID = protocol.ID("pokt/v1.0.0") |
Collaborator
There was a problem hiding this comment.
One small line of code for a go package, one giant leap for the protocol
Comment on lines
+73
to
+74
| // IMPROVE: receive context in interface methods. | ||
| ctx := context.Background() |
16 tasks
bryanchriswhite
added a commit
that referenced
this pull request
Mar 18, 2023
## Description Due to circumstances and timing, @Olshansk's final review on #540 came in after merging. This PR implements improvements based on that review feedback. ## Issue Related to #347 ## 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 - Correct libp2p module tests - Improve libp2p code quality in response to post-merge review feedback ## Testing - [ ] `make develop_test` - [ ] [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 - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] 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)
dylanlott
pushed a commit
that referenced
this pull request
Mar 24, 2023
## Description Due to circumstances and timing, @Olshansk's final review on #540 came in after merging. This PR implements improvements based on that review feedback. ## Issue Related to #347 ## 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 - Correct libp2p module tests - Improve libp2p code quality in response to post-merge review feedback ## Testing - [ ] `make develop_test` - [ ] [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 - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] 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)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is another of a series of PRs split out from #500. Here we add a new implementation of
typesP2P.Networkin terms of libp2p abstractions, utilizing the helpers which were added in #534.Issue
#347
Type of change
Please mark the relevant option(s):
List of changes
typesP2P.Networkimplementation to thelibp2pmodule directorymodules.InitializableModuleto the P2PAddrBookProviderinterface so that it can be dependency injected as amodules.Modulevia the bus registry.PoktProtocolIDfor use within the libp2p module or by public API consumersTesting
make develop_testREADMERequired Checklist
If Applicable Checklist
shared/docs/*if I updatedshared/*README(s)