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: Add peerID and feature flag #5591

Merged
merged 12 commits into from Jul 28, 2023
Merged

Conversation

Eric-Warehime
Copy link
Contributor

@Eric-Warehime Eric-Warehime commented Jul 20, 2023

Summary

Adds some defaults for generating and loading peer IDs. Only supporting ed25519 which is one of the standard algorithms supported by libp2p.

Also adds some config options for enabling p2p in general and how to locate peerID keys.

Test Plan

Unit tests for now can simulate most of the behavior we care about w/ temp directories. Usage of the private key as peer ID will be further exercised once it's used in the host implementation.

Info

Closes #5580, Closes #5581

@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Merging #5591 (ad0a831) into master (3f32d61) will increase coverage by 0.02%.
Report is 1 commits behind head on master.
The diff coverage is 84.00%.

@@            Coverage Diff             @@
##           master    #5591      +/-   ##
==========================================
+ Coverage   54.97%   54.99%   +0.02%     
==========================================
  Files         462      463       +1     
  Lines       64490    64515      +25     
==========================================
+ Hits        35456    35483      +27     
- Misses      26659    26661       +2     
+ Partials     2375     2371       -4     
Files Changed Coverage Δ
config/localTemplate.go 70.76% <ø> (ø)
network/p2p/peerID.go 84.00% <84.00%> (ø)

... and 15 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@shiqizng shiqizng left a comment

Choose a reason for hiding this comment

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

looks good.

config/localTemplate.go Outdated Show resolved Hide resolved
network/p2p/peerID.go Outdated Show resolved Hide resolved
network/p2p/peerID.go Show resolved Hide resolved
network/p2p/peerID.go Outdated Show resolved Hide resolved
network/p2p/peerID_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@winder winder left a comment

Choose a reason for hiding this comment

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

Looks pretty straight forward. Just had a couple nits.

@winder winder changed the title p2p: Add peer p2p: Add peer and feature flag Jul 21, 2023
@Eric-Warehime Eric-Warehime changed the title p2p: Add peer and feature flag p2p: Add peerID and feature flag Jul 24, 2023
shiqizng
shiqizng previously approved these changes Jul 26, 2023
winder
winder previously approved these changes Jul 27, 2023
iansuvak
iansuvak previously approved these changes Jul 27, 2023
@algorandskiy algorandskiy merged commit 0dbbc91 into algorand:master Jul 28, 2023
17 checks passed
@jsgranados jsgranados added the p2p Work related to the p2p project label Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement p2p Work related to the p2p project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable nodes to supply a PeerID Feature flag p2p network
6 participants