Skip to content
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, Runtime] Update P2P & base config (part 2) #535

Merged
merged 22 commits into from
Mar 1, 2023
Merged

Conversation

bryanchriswhite
Copy link
Contributor

@bryanchriswhite bryanchriswhite commented Feb 22, 2023

Description

This is another of a series of PRs split out from #500. Here we update the base and P2P configs in preparation for the addition of the libp2p module.

Issue

#347

Type of change

Please mark the relevant option(s):

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Major breaking change
  • Documentation
  • Other

List of changes

  • Replace consensus_port with port in P2P config.
  • Update default P2P config port to from 8080 to 42069.
  • Add use_libp2p field to base config.
  • Add hostname field to P2P config.
  • Update state hash test after modifying genesis (updated port numbers).

Testing

  • make develop_test
  • LocalNet w/ all of the steps outlined in the README

Required Checklist

  • 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 diagrams in the corresponding README(s)
  • I have added, or updated, documentation and mermaid.js diagrams in shared/docs/* if I updated shared/*README(s)

@bryanchriswhite bryanchriswhite self-assigned this Feb 22, 2023
@bryanchriswhite bryanchriswhite linked an issue Feb 22, 2023 that may be closed by this pull request
6 tasks
@bryanchriswhite bryanchriswhite changed the title [P2P] Add hostname and rename consensus_port on P2P config [P2P] Update P2P config Feb 22, 2023
@bryanchriswhite bryanchriswhite added the p2p P2P specific changes label Feb 22, 2023
@bryanchriswhite bryanchriswhite changed the title [P2P] Update P2P config [P2P, Runtime] Update P2P & base config Feb 22, 2023
@bryanchriswhite bryanchriswhite force-pushed the chore/config branch 2 times, most recently from a3dc8c7 to b5fbd24 Compare February 23, 2023 08:59
@bryanchriswhite

This comment was marked as outdated.

@bryanchriswhite bryanchriswhite marked this pull request as ready for review February 23, 2023 11:48
@bryanchriswhite bryanchriswhite changed the title [P2P, Runtime] Update P2P & base config [P2P, Runtime] Update P2P & base config (part 2) Feb 23, 2023
Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one minor place where we still use "8080".

  1. Can you do a global search for 8080-8084 and update all of them for consistency? E.g. see build/deployments/.env.example as well.

  2. I know you tested it with the docker-compose localnet, but please double check that the k8s localnet works too. Bonus points: updating the github template to include it.

runtime/manager_test.go Outdated Show resolved Hide resolved
runtime/manager_test.go Outdated Show resolved Hide resolved
@bryanchriswhite
Copy link
Contributor Author

Still have to add hostname to the k8s P2P config but I'm not sure how to do that just yet and won't have time in this sitting. Perhaps we can tag-team?

(cc @okdas @Olshansk)

@Olshansk
Copy link
Member

Still have to add hostname to the k8s P2P config but I'm not sure how to do that just yet and won't have time in this sitting. Perhaps we can tag-team?

(cc @okdas @Olshansk)

Similar to the configs you updated in build/config/config1.json, you would do the same in build/localnet/manifests/configs.yaml and some of the other manifests. It seems like you already renamed the port from consensus_port but didn't add the hostname there.

Regarding Localnet and Tiltfile, a good starting point would be to look at build/localnet/templates/v1-validator-template.yaml.tpl which is used as a template by build/localnet/templates/v1-validator-template.sh. Since the naming convention for the scaling k8s validators is v1-validatorXXXX, that will likely need to be the hostname (don't quote me on this) for the cluster to resolve each container separately.

Hopefully that's a good enough starting point. Seeing how I'm OOO for ETH Denver next week, hopefully @okdas can help out with some pointers as well.

@bryanchriswhite bryanchriswhite force-pushed the chore/config branch 2 times, most recently from c86dcec to 4973429 Compare February 27, 2023 10:34
Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just have one question (not a blocker but might involve a change).

Also, let's have @okdas review the Tiltfile changes as well to make sure I didn't miss anything there.

runtime/manager_test.go Show resolved Hide resolved
Copy link
Member

@okdas okdas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you feel strongly about this, I would suggest keeping just one template file for StatefulSet and a Service to avoid creating more templates. I've supplied an example on how an existing pattern can be utilized to achieve the same result.

Copy link
Member

@okdas okdas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you!

* main:
  [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)
@gitguardian
Copy link

gitguardian bot commented Mar 1, 2023

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
5841025 Generic High Entropy Secret 75e529d build/config/genesis.json View secret
5841025 Generic High Entropy Secret 75e529d build/localnet/manifests/configs.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@bryanchriswhite bryanchriswhite merged commit d09cd8d into main Mar 1, 2023
bryanchriswhite added a commit that referenced this pull request Mar 3, 2023
* 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)
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)
bryanchriswhite added a commit that referenced this pull request Mar 3, 2023
## Description

This is another (last, probably) in a series of PRs split out from
#500. Here we finally enable
support for use of the new libp2p module (and dependent packages) by
considering the config changes made in #535 in 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

- Support libp2p module in node
- Support libp2p module in debug CLI

## 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)
@Olshansk Olshansk deleted the chore/config branch March 7, 2023 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2p P2P specific changes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[P2P] Integrate LibP2P
3 participants