Here we upgrade all libp2p libraries to the recent versions. To make it possible, we were also forced to bump the Go version from 1.18 to 1.20. This is the minimum version supported by recent libp2p packages.
I recommend reviewing commit by commit where specific changes are described in detail. Here is a brief summary of what has been done:
Refs: https://github.com/keep-network/keep-core/issues/3770 Closes: https://github.com/keep-network/keep-core/issues/3761
Here we upgrade all libp2p libraries to the recent versions. To make it possible, we were also forced to bump the Go version from 1.18 to 1.20. This is the minimum version supported by recent libp2p packages.
I recommend reviewing commit by commit where specific changes are described in detail. Here is a brief summary of what has been done:
Upgrade Go from 1.18 to 1.20
Upgrade of Go resulted in a need to:
slices.SortFunc
compare function we are using in one unit test. This is because the version of thegolang.org/x/exp
package had to be bumped up as well. The returned type of the compare function used inslices.SortFunc
was changed frombool
toint
somewhere between (https://github.com/keep-network/keep-core/pull/3771/commits/5a980c717b5d76b39680c84561a1a4b984c2b0ac)TestCoordinationExecutor_Coordinate
which started to be flaky due to a changed behavior ofecdsa.GenerateKey
. Since Go 1.20, the returned key no longer depends deterministically on the bytes read from the provided RNG, and may change between calls and/or between versions (https://github.com/keep-network/keep-core/pull/3771/commits/2ed7179f35229ad95a50602731f3857d27375f98)TestWalletRegistry_getWalletByPublicKeyHash_NotFound
which used a dummy curve point. Since Go 1.19, such a behavior leads to a panic (https://github.com/keep-network/keep-core/pull/3771/commits/50b6bd62758695f13877f253ce66ef272e08dc7d)gofmt
version (https://github.com/keep-network/keep-core/pull/3771/commits/3c2274e85fdb18cdc10a67704e6dce4b85d8c675)staticcheck
version used by CI and fix the new warnings about deprecated standard library functions by replacing them as recommended (https://github.com/keep-network/keep-core/pull/3771/commits/a87eea30a48207b74d6510c1785f330791669e37)Upgrade of libp2p libraries
Upgrade of libp2p packages forced us to:
go-libp2p-core
imports to bego-libp/core
as this package was moved to thego-libp2p
monorepo (https://github.com/keep-network/keep-core/pull/3771/commits/95d60b813fee8573e633b1069a162d092f26973b)transport
andauthenticatedConnection
implementations to expose some additional functions required by libp2p interfaces (https://github.com/keep-network/keep-core/pull/3771/commits/ac01765e23fe2b4fd95ed2f2c343e57df6cb4998)transport
differently due to the changes around libp2pSecurity
option (https://github.com/keep-network/keep-core/pull/3771/commits/110fbb3460e2eed2450f76dda1a1975fa230eb6f, https://github.com/keep-network/keep-core/pull/3771/commits/6953b790014c59ef1dd7404b7c558f3b55a85ed7)