-
Notifications
You must be signed in to change notification settings - Fork 75
update btcec dependency #245
update btcec dependency #245
Conversation
@@ -3,34 +3,37 @@ module github.com/libp2p/go-libp2p-core | |||
go 1.17 | |||
|
|||
require ( | |||
github.com/btcsuite/btcd v0.20.1-beta | |||
github.com/btcsuite/btcd/btcec/v2 v2.1.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we only update the btcec dependency in this PR please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I reverted the go.mod and go .sum changes, and then made the change to v2, ran go mod tidy it updated a lot of versions to the semantically compatible updated version. Are you suggesting I manually maintain the files instead of using the tools? Or is there a way of using the tools to only make very specific changes? (I'm reading the manuals, but if there's a pointer I'm happy to follow it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't reproduce this.
go get github.com/btcsuite/btcd/btcec/v2
go mod tidy
works perfectly fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still seeing a bit more change than I expect following the same steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine now. Thanks.
Can you point us to the release notes for the v2? I didn't find anything in the repo. |
I was unable to find it either when I started looking into how to avoid the ambiguous import that was coming into our project. This thread pointed me in this direction, and with minimal changes, it works. |
Looks like there were quite a few changes between v0.22.0-beta and v2.1.3. Not really sure how to review this (or if this is even necessary). The lack of release notes is disturbing though.
|
Totally agree, I found the lack of documentation about V2 to be uncomfortable. I believe the test cases in libp2p-core do cover this change, and that gave me confidence this is a working change. Beyond that, I don't have any deeper insight into how to review this. |
@marten-seemann Do you understand why the "API Compatibility" test is failing? I'm not familiar with this type of test, I will fix, but again, pointers would be appreciated if you can provide them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a rebase, but otherwise this looks fine. It's technically a breaking change because Secp246k1{Public,Private}Key
is a newtype (and we're changing the underlying type). However, I don't personally consider that to be a part of the API.
crypto/secp256k1.go
Outdated
@@ -6,7 +6,8 @@ import ( | |||
|
|||
pb "github.com/libp2p/go-libp2p-core/crypto/pb" | |||
|
|||
"github.com/btcsuite/btcd/btcec" | |||
btcec "github.com/btcsuite/btcd/btcec/v2" | |||
ecdsa "github.com/btcsuite/btcd/btcec/v2/ecdsa" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to btcecdsa (there's an ecdsa in the stdlib).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a rebase, but otherwise this looks fine. It's technically a breaking change because
Secp246k1{Public,Private}Key
is a newtype (and we're changing the underlying type). However, I don't personally consider that to be a part of the API.
I agree that this didn't feel like part of the public interface. I don't know how to reset this to be the new, accepted interface. Can you point me in the right direction to get that test to pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this didn't feel like part of the public interface. I don't know how to reset this to be the new, accepted interface. Can you point me in the right direction to get that test to pass.
It won't pass, but that's fine. It's just a way to let us know very clearly that this is a breaking change. Ideally we'd have something fancier than a failing test... but it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I don't have the permissions to merge or release, how do I request that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marten-seemann has the final decision here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please clean up the commit history? Ideally, just rebase this on top of the current master and have a single commit.
…iguous import of chainhash
…iguous import of chainhash
…iguous import of chainhash
, Proposing this specifically to update to btcec v2 and avoid ambiguous import of chainhash