Skip to content
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

fix: remove ambiguous import by downgrading btcutil v1.1.1 to v1.0.0 #1064

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

D4ryl00
Copy link
Contributor

@D4ryl00 D4ryl00 commented Aug 23, 2023

This PR fixes #1063.
It downgrades github.com/btcsuite/btcd/btcutil v1.1.1 to v1.0.0 to resolve conflicts in the dependency graph for the github.com/btcsuite/btcd package and its dependencies.
More information can be found in the issue above.

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

Copy link
Contributor

@jefft0 jefft0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending review by Gno devs.

Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to try a different approach: #1063 (comment)

Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving this PR because Git history points to the fact that the btcd/btcutil/bech32 directory has been untouched since its creation: https://github.com/btcsuite/btcd/commits/master/btcutil/bech32

In our code base, the single use for the btcd/btcutil module is for bech32:

$ rg -t go btcutil
tm2/pkg/bech32/bech32.go
4:      "github.com/btcsuite/btcd/btcutil/bech32"

tm2/pkg/crypto/secp256k1/secp256k1_test.go
8:      "github.com/btcsuite/btcutil/base58"

(Note the second match is of a different module, untouched by this PR, and on top of things in a test file)

So downgrading this dependency will effectively not change anything in the code that we use, while unblocking berty in their development. I'll still be noting to try to resolve this btcd dependency mess :)

@thehowl thehowl merged commit aa7c1df into gnolang:master Aug 24, 2023
78 checks passed
@D4ryl00 D4ryl00 deleted the fix/ambiguous-import branch August 24, 2023 16:10
piux2 added a commit that referenced this pull request Aug 24, 2023
@piux2
Copy link
Contributor

piux2 commented Aug 24, 2023

@D4ryl00 @thehowl can we find other ways to solve the issue.

We need to use btcutil v1.1.1

please check
gnokey add can't add pubkeys
#241

Also, @D4ryl00 can you check the solution here?

golang/go#60313
golang/go#60313 (comment)

@thehowl
Copy link
Member

thehowl commented Aug 25, 2023

@piux2 Check out the repository. You will see that for the btcutil module, since we only use bech32, for us v1.0.0 is effectively the same as v1.1.1.

@piux2
Copy link
Contributor

piux2 commented Aug 28, 2023

@thehowl Yes, you are right. Thank you for pointing out!

At the time, when btcutil v1.0.2 was in a separate repo, it did not have DecodeNoLimit() in bech32.go. Later, when we fixed issue 241 we chose to use btcd/btcutil v1.1.1 . I guess they made DecodeNoLimit() available for btcd/btcutil v1.0.0, when they merged btcutil to btcd repo. That is where the confusion was from

It is all good now.

Doozers pushed a commit to Doozers/gno that referenced this pull request Aug 31, 2023
…nolang#1064)

This PR fixes gnolang#1063.
It downgrades `github.com/btcsuite/btcd/btcutil v1.1.1` to `v1.0.0` to
resolve conflicts in the dependency graph for the
`github.com/btcsuite/btcd` package and its dependencies.
More information can be found in the issue above.

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [x] Provided any useful hints for running manual tests
- [x] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
@moul moul added this to the 💡Someday/Maybe milestone Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

Ambiguous import in a btcd dependency
5 participants