-
Notifications
You must be signed in to change notification settings - Fork 79
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
[Backport] Upgrade Go and libp2p versions #3779
Merged
lukasz-zimnoch
merged 10 commits into
releases/mainnet/v2.0.0-m7
from
backport-upgrade-libp2p
Feb 12, 2024
Merged
[Backport] Upgrade Go and libp2p versions #3779
lukasz-zimnoch
merged 10 commits into
releases/mainnet/v2.0.0-m7
from
backport-upgrade-libp2p
Feb 12, 2024
+620
−1,261
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(cherry picked from commit 3c82b0d)
Package `go-libp2p-core` has been deprecated and moved to `go-libp2p`. Here we adjust all imports accordingly. See: https://github.com/libp2p/go-libp2p/releases/tag/v0.22.0 (cherry picked from commit 95d60b8)
The `go-libp2p`'s TLS implementation used within the `transport` struct has a new constructor that accepts the security protocol ID and a list of muxers. Regarding the first, it's enough to pass the TLS protocol ID exposed by `go-libp2p`. For the second, it's enough to pass `nil` as the Keep client does not use Optimized Stream Multiplexer Selection so no mutex is determined upfront. Regarding `authenticatedConnection`, there is a need to implement an additional method `ConnState` that exposes `ConnectionState`. This can be fetched from the secure connection established by the TLS encryption layer. See: - https://github.com/libp2p/go-libp2p/releases/tag/v0.24.0 - https://github.com/libp2p/specs/blob/50e2cd49c3261eeb71936e4e1b371bd3aa3d7d62/connections/inlined-muxer-negotiation.md (cherry picked from commit ac01765)
(cherry picked from commit 6314012)
This test used a dummy curve point that was not on the curve. Since Go 1.19, such a behavior leads to a panic. Here we fix that by using a proper point that is on the curve. See: https://tip.golang.org/doc/go1.19 > Minor changes to the library > crypto/elliptic (cherry picked from commit 50b6bd6)
`go-libp2p` versions prior to `v0.24.0` allowed to pass either a constructed security transport instance or a constructor producing such an instance. Starting from `v0.24.0` only the latter option is supported. See: https://github.com/libp2p/go-libp2p/releases/tag/v0.24.0 (cherry picked from commit 110fbb3)
(cherry picked from commit 3c2274e)
We are also taking an opportunity and bump `protoc-gen-go` to the recent version. (cherry picked from commit 8e07451)
Warnings were all about usage of functions that are deprecated in Go 1.20. We are replacing them as recommended. (cherry picked from commit a87eea3)
Setup of the security transport done after the recent libp2p upgrade was wrong. We configured libp2p host to use `/keep/handshake/1.0.0` as the security protocol but, in the same time, the security protocol implementation (our own `net/libp2p.transport`) returned `/tls/1.0.0` as ID. Here we fix that by using `/keep/handshake/1.0.0` everywhere and re-factoring the security transport constructor passed to the `libp2p.Security` option. Libp2p injects necessary parameters there and the constructor of `net/libp2p.transport` should use them to create the instance. Moreover, we are taking the opportunity and do some housekeeping around Keep-specific protocol names. We now have `securityProtocolID` which holds the ID of the encrypted transport protocol and `authProtocolID` which denotes the custom authentication protocol used by Keep clients. We are leaving original values to maintain backward compatibility with older clients. (cherry picked from commit 6953b79)
tomaszslabon
approved these changes
Feb 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request backports #3771 to the
releases/mainnet/v2.0.0-m7
branch.