-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[P2P] Refactor/consolidate P2P modules #576
Conversation
807d771
to
2263be9
Compare
## Description This was a `TECHDEBT` item that became trivial to do as work progressed on another task which also required use of `mockdns` (#576). ## Issue Not related to any specific issue. ## 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 - Adds `mockdns` as a test dependency - Mocks DNS resolution in `url_conversion_test.go` - Adds regression tests to `url_conversion_test.go` for single- and multi-record DNS responses ## 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 - [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)
9b1dff8
to
5fef7f3
Compare
98b4761
to
1665e5b
Compare
7276db9
to
4bfa96b
Compare
1665e5b
to
96ad4fb
Compare
c24e361
to
79c81cc
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
@Olshansk, still working through it and got some help from @deblasis. We paired for a bit this morning and thought through how to proceed. I put the notes from our session in notion. UPDATE (resolved): As embarrassing as it is to admit, may it go as a reminder to others (because apparently we all need one from time to time 😅), to Postmortem
// Wait for completion
defer waitForNetworkSimulationCompletion(t, &wg) // <--
// Send the first message (by the originator) to trigger a RainTree broadcast
p := &anypb.Any{}
p2pMod := p2pModules[origNode]
require.NoError(t, p2pMod.Broadcast(p))
// Stop all p2p modules outside of loop
for _, p2pMod := range p2pModules {
err := p2pMod.Stop() // <--
require.NoError(t, err)
} 🤦🤦🤦🤦🤦🤦 |
6db30a9
to
ec1a481
Compare
ec1a481
to
e11be8d
Compare
The check succeeded, dismissing the review comment.
e0038e7
to
9d88684
Compare
The check succeeded, dismissing the review comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bryanchriswhite I appreciate all the comments you added after the last PR.
Please do a last sanity check with localnet (docker-compose and k8s) before merging to avoid breaking main, but otherwise, let's merge this in!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing changelog in module: charts/
Changelog verification failed. See error messages for more detail.
Please update the relevant CHANGELOG.md files and ensure they follow the correct format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do a last sanity check with localnet (docker-compose and k8s) before merging to avoid breaking main, but otherwise, let's merge this in!
@Olshansk so I have good news and bad news.
Good news: both docker compose and tilt localnets were able to run in autonomous mode past 250 blocks before I shut them down. 🙌
Bad news: after merging the tilt validator refactor which introduces the validator helm chart (#658) there is a new class of error presenting with respect to DNS resolution. This error isn't present in main
and it's not immediately clear to me how this issue wouldn't be presenting there as well as I've not modified genesis (where those hostnames come from) and both branches are resolving DNS and the diff there in the code is quite minimal (net.DefaultResolver#LookupHost
instead of net.ResolveTCPAddr
).
{"level":"fatal","error":"setting up network: converting peer info, pokt address: 00404a570febd061274f72b50d0a37f611dfe339: resolving peer IP for hostname: v1-validator004: resolving peer IP for hostname: v1-validator004, lookup v1-validator004 on 10.96.0.10:53: no such host; converting peer info, pokt address: 00104055c00bed7c983a48aac7dc6335d7c607a7: resolving peer IP for hostname: v1-validator001: resolving peer IP for hostname: v1-validator001, lookup v1-validator001 on 10.96.0.10:53: no such host; converting peer info, pokt address: 00204737d2a165ebe4be3a7d5b0af905b0ea91d8: resolving peer IP for hostname: v1-validator002: resolving peer IP for hostname: v1-validator002, lookup v1-validator002 on 10.96.0.10:53: no such host; converting peer info, pokt address: 00304d0101847b37fd62e7bebfbdddecdbb7133e: resolving peer IP for hostname: v1-validator003: resolving peer IP for hostname: v1-validator003, lookup v1-validator003 on 10.96.0.10:53: no such host","time":"2023-04-17T07:20:31Z","message":"Failed to start pocket node"}
Tapping @okdas once more for help. 😅
@Olshansk (or @okdas) I would like to ask if I may please delegate the responsibility of subsequent manual testing and merging of this PR after this (last last last) fix? It seems that due to the timezones, by the time I'm both online and have approval to merge, there is always something new on main
that needs to be merged in and manually tested which more often than not leads to the need for more small changes in this PR, causing a cycle. That combined with the PR fatigue that everyone is feeling makes me feel like we should all push to merge this as soon as possible. Let's be catching these issues in other PRs instead of collecting them all here and perpetuating further divergence from main
.
@@ -93,6 +92,7 @@ config: | |||
max_conn_idle_time: 1m | |||
health_check_period: 30s | |||
p2p: | |||
hostname: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-applying #576 (comment) in the helm values.
- name: POCKET_P2P_HOSTNAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.podIP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-applying bb07e7e
…p-modules * pokt/main: [Consensus] Log warnings if server module is not enabled (#679)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check succeeded, dismissing the review comment.
* pokt/main: [P2P] Refactor/consolidate P2P modules (#576)
* pokt/main: [P2P] Refactor/consolidate P2P modules (#576)
@Reviewer
This PR may be more digestible / reviewable on a commit-by-commit basis. Commits are organized logically and any given line is only modified in a single commit, with few exceptions.
Description
Re-consolidates Libp2p and P2P modules and types.
Issue
Fixes #554
Type of change
Please mark the relevant option(s):
List of changes
p2p/utils
packagegetPeerIP
to usenet.DefaultResolver
for easier testinghost.Host
setup util top2p/utils
modules.Module
implementationsstdnetwork
typesP2P.Network
implementationstypesP2P.Network
implementation to use libp2pshared/p2p
package intop2p/types
packagesTrnasport
interface and implementationsConnectionFactory
type and related membershost.Host
mock generatorshared/p2p
packageruntime/configs.Config#UseLibp2p
fieldLIBP2P_DEBUG
env varPOCKET_P2P_HOSTNAME
env var to the pod IPp2p.hostname
config value to empty string so that the env var appliesTesting
make develop_test
README
Required Checklist
If Applicable Checklist
shared/docs/*
if I updatedshared/*
README(s)