Closed mvandeberg closed 10 months ago
We're just calling standard library code here: https://github.com/libp2p/go-libp2p/blob/b438d18924484da7fd8b34fc55e91d9f9835fd39/core/crypto/ecdsa.go#L52-L53
iirc, this was changed in one of the recent Go updates, although I can't find it in the release notes. Anyway, there's nothing that libp2p can do, if you care about this, please open an issue with the Go project.
I recently updated my project to libp2p v0.30.0 from v0.24.2. We were using a user-configured seed to set peer ID to be used as publicly available seed nodes. After the update, the peer ID generated from a given seed is non-deterministically switching between two values, neither of which was the value prior to the update.
Below is a snippet of code that replicates our configuration process:
On libp2p v0.24.2 and go version 1.18.0, the output is:
On libp2p v0.30.0 and go version 1.21.0, the output is:
or
As you can tell, the result of
Rand
is the same on both versions, only the key pair differs.My expectation is that
crypto.GenerateECDSAKeyPair
always returns the same key pair and returns the same key pair across versions of libp2p. If checked through release notes and did not see any direct reference toGenerateECDSAKeyPair
.Below is the result of
go list -m all
on both configurations:libp2p v0.24.2, go version 1.18.0
libp2p v0.30.0, go version 1.12.0
Version Information