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

feat: clean up p2p & implement bootnode (seed peers) support #2852

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

zivkovicmilos
Copy link
Member

Description

This PR introduces bootnode (seed mode) support for TM2 peering, and cleans up parts of the p2p module codebase.

Closes #2308

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@zivkovicmilos zivkovicmilos added 🌱 feature New update to Gno 📦 🌐 tendermint v2 Issues or PRs tm2 related labels Sep 26, 2024
@zivkovicmilos zivkovicmilos self-assigned this Sep 26, 2024
@github-actions github-actions bot added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Sep 26, 2024
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 11 lines in your changes missing coverage. Please review.

Project coverage is 60.91%. Comparing base (ca9eb4b) to head (338c93b).
Report is 29 commits behind head on master.

Files with missing lines Patch % Lines
tm2/pkg/p2p/key.go 70.83% 4 Missing and 3 partials ⚠️
tm2/pkg/crypto/ed25519/ed25519.go 0.00% 2 Missing ⚠️
tm2/pkg/crypto/crypto.go 0.00% 1 Missing ⚠️
tm2/pkg/p2p/switch.go 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2852      +/-   ##
==========================================
- Coverage   60.91%   60.91%   -0.01%     
==========================================
  Files         564      563       -1     
  Lines       75267    74494     -773     
==========================================
- Hits        45849    45375     -474     
+ Misses      26047    25782     -265     
+ Partials     3371     3337      -34     
Flag Coverage Δ
contribs/gnofaucet 14.46% <ø> (ø)
misc/genstd 80.54% <ø> (ø)
misc/logos 19.88% <ø> (-0.36%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zivkovicmilos zivkovicmilos changed the title feat: implement bootnode (seed peers) support feat: clean up p2p & implement bootnode (seed peers) support Oct 1, 2024
@@ -12,7 +12,7 @@ import (
"github.com/gnolang/gno/tm2/pkg/bft/types"
"github.com/gnolang/gno/tm2/pkg/flow"
"github.com/gnolang/gno/tm2/pkg/log"
"github.com/gnolang/gno/tm2/pkg/p2p"
types2 "github.com/gnolang/gno/tm2/pkg/p2p"
Copy link
Member

Choose a reason for hiding this comment

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

The import name seems strange to me. Does it mean something I missed?

Copy link
Member Author

Choose a reason for hiding this comment

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

If this PR can be visualized now 😄

istockphoto-154930761-612x612

It's still a heavy WIP, right now you can't even build correctly since I'm simplifying the imports and types.

I'll ping as soon as it's ready for viewing and testing 🙏

@@ -36,10 +26,10 @@ type P2PConfig struct {
UPNP bool `json:"upnp" toml:"upnp" comment:"UPNP port forwarding"`

// Maximum number of inbound peers
MaxNumInboundPeers int `json:"max_num_inbound_peers" toml:"max_num_inbound_peers" comment:"Maximum number of inbound peers"`
MaxNumInboundPeers uint64 `json:"max_num_inbound_peers" toml:"max_num_inbound_peers" comment:"Maximum number of inbound peers"`
Copy link
Member

Choose a reason for hiding this comment

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

Unsigned may be better than signed if we don't need to use patterns like -1. However, since we're constrained by the OS limits, a size of 64 may be excessive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related 🌱 feature New update to Gno
Projects
Status: No status
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Network peering discovery - Seed mode - Addrbook.json
2 participants