Closed lukasz-zimnoch closed 2 years ago
hi @lukasz-zimnoch , thank you for reporting, can you suggest ways to fix this issue?
Thoughts on fixing this by simply removed from messages.go
? If the generated pb.go
file takes care of registration, the explicit manual registration in messages.go
seems like it should be unnecessary. The init
function is used in both cases, and both thepb.go
file and messages.go
are in the same package which means both registrations run at the same time during package initialization. That should mean the messages.go
init
function is redundant. I believe this should be true even on earlier versions that may not warn on duplicate registration.
Hey @omershlo,
We've noticed that when both ecdsa
and eddsa
are used depending on the intialization order, protobuf can't handle both at runtime because of name clashes.
I've opened a PR to fix that. As a side effect the warnings have been cleared as well.
Let me know what you think.
This PR also fixed the issue. See go.mod ecdsa/signing/messages.go ecdsa/keygen/ecdsa-keygen.pb.go and other related part.
tss-lib
points to thegithub.com/golang/protobuf v1.3.2
dependency in thego.mod
file. However, according to Go modules version selection policy all versions of protobuf>= v1.3.2
and< v2
can be picked if present in the module list.This can be a problem because
tss-lib
protobuf messages are registered twice which causes a registration conflict. The first registration occurs in the generated*.pb.go
files and then the second registration is performed inmessages.go
files.Example for the
ecdsa/keygen
package:The
github.com/golang/protobuf v1.3.2
doesn't complain but the newergithub.com/golang/protobuf v1.4.0
displays a warning: