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: upgrade libp2p #6142

Merged
merged 4 commits into from
Sep 27, 2024
Merged

Conversation

algorandskiy
Copy link
Contributor

@algorandskiy algorandskiy commented Sep 24, 2024

Summary

Upgraded go-libp2p, go-libp2p-pubsub, go-libp2p-pubsub to the latest versions supporting go1.21 (go-libp2p is one patch version behind).

Fixed *basichost.BasicHost casting since libp2p.New does not return *basichost.BasicHost anymore.
Fixed private addresses test:

  • /ip6/2001:db8::/ipcidr/32 is supported natively by multiaddr lib (i.e. fixed a known TODO item)
  • /ip6/200:11::/tcp/1234 ended up to be a bad example for testing public IPv6 addresses after some improvements in multiaddr

Extra upgrades

Upgrading libp2p also triggered some other dependencies upgrades, notable golang.org/x/crypto v0.21 -> v0.26.
go-algorand directly uses acme/autocert,, blake2b, sha3, hkdf, nacl/secretbox and scrypt submodules.
The 4 latter (sha3 ... scrypt) might potentially affect on-chain data through AVM and kmd.

Version history v0.21 -> v0.26 shows only sha3 was changed and both changes (xor, buf) looks good/safe.

Test Plan

Existing unit tests. Performance test showed some regression but we have to upgrade anyway.

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 56.27%. Comparing base (2a02530) to head (29da8cb).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
network/p2p/p2p.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6142      +/-   ##
==========================================
- Coverage   56.27%   56.27%   -0.01%     
==========================================
  Files         494      494              
  Lines       69943    69946       +3     
==========================================
+ Hits        39358    39359       +1     
- Misses      27910    27916       +6     
+ Partials     2675     2671       -4     
Flag Coverage Δ
56.27% <0.00%> (?)

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.

go.mod Show resolved Hide resolved
Copy link
Contributor

@gmalouf gmalouf left a comment

Choose a reason for hiding this comment

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

I'm good with this in general, would like @jannotti to skim on thoughts around any libraries affecting AVM.

Copy link
Contributor

@jannotti jannotti left a comment

Choose a reason for hiding this comment

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

Seems like the crypto changes are minimal, so I don't see any problems.

@algorandskiy algorandskiy merged commit 8b6c443 into algorand:master Sep 27, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants