node icon indicating copy to clipboard operation
node copied to clipboard

chore: upgrade github.com/btcsuite/btcd

Open gartnera opened this issue 1 year ago • 2 comments

Upgrade github.com/btcsuite/btcd.

TODO:

  • [ ] restore HSM code
  • [ ] simplify key conversion logic
  • [ ] improve BIP 341/342 compliance by removing txscript.NewCannedPrevOutputFetcher([]byte{}, 0)
  • [ ] merge https://github.com/zeta-chain/go-tss/pull/23

Closes #2728

Summary by CodeRabbit

  • New Features

    • Updated key generation process with a new import for the keygen package, enhancing functionality.
    • Simplified the transaction signing process by modifying the SignTx method.
  • Bug Fixes

    • Improved error messaging in test functions for better clarity.
  • Chores

    • Updated import paths for various packages to ensure compatibility and maintainability.
    • Updated version numbers of dependencies to their latest releases for improved performance and security.

gartnera avatar Aug 19 '24 23:08 gartnera

[!IMPORTANT]

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Walkthrough

The recent code changes primarily focus on upgrading the btcsuite library across the project to streamline dependencies and enable support for Taproot scripts. This update involves modifying import paths for several packages, particularly shifting to versioned imports of btcd, thereby enhancing the codebase's clarity and maintainability without altering the core functionality.

Changes

Files Change Summary
cmd/zetaclientd/gen_pre_params.go, cmd/zetaclientd/keygen_tss.go, cmd/zetaclientd/main.go Updated import paths for keygen and ecdsakeygen from gitlab.com/thorchain to github.com/bnb-chain.
e2e/e2etests/helpers.go, e2e/e2etests/test_* Reorganized or updated btcutil import paths, indicating a shift in source without functional changes.
e2e/runner/.go, zetaclient/chains/bitcoin/.go Reordered btcutil imports and updated btcec to version 2, improving structure and supporting new features.
go.mod Updated various dependencies, including btcsuite/btcd to v0.24.2, and introduced bnb-chain/tss-lib.
pkg/chains/.go, pkg/crypto/.go Adjusted btcutil imports and refined existing code for better organization and clarity.
x/crosschain/types/tx_body_verification.go Updated btcec import path and simplified verifyOutboundBodyBTC function.
zetaclient/tss/tss_signer.go Added keygen import from bnb-chain, enhancing key generation capabilities.
zetaclient/zetacore/broadcast.go Simplified SignTx method by removing conditional checks, streamlining the process.

Assessment against linked issues

Objective Addressed Explanation
Upgrade btcsuite project-wise (2728)

This assessment confirms that the primary objective of upgrading the btcsuite library to improve dependency management and support for Taproot scripts has been effectively addressed through the recent code changes.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example: -- I pushed a fix in commit <commit_id>, please review it. -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples: -- @coderabbitai generate unit testing code for this file. -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: -- @coderabbitai generate interesting stats about this repository and render them as a table. -- @coderabbitai read src/utils.ts and generate unit testing code. -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Aug 19 '24 23:08 coderabbitai[bot]

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Please upload report for BASE (develop@17f26e6). Learn more about missing BASE report. Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
zetaclient/chains/bitcoin/signer/signer.go 0.00% 6 Missing :warning:
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #2750   +/-   ##
==========================================
  Coverage           ?   67.12%           
==========================================
  Files              ?      378           
  Lines              ?    21121           
  Branches           ?        0           
==========================================
  Hits               ?    14178           
  Misses             ?     6276           
  Partials           ?      667           
Files with missing lines Coverage Δ
pkg/chains/address.go 86.79% <ø> (ø)
pkg/chains/address_taproot.go 58.42% <ø> (ø)
pkg/crypto/tss.go 82.60% <ø> (ø)
pkg/proofs/bitcoin/proof.go 100.00% <ø> (ø)
pkg/proofs/headers.go 71.76% <ø> (ø)
pkg/proofs/proof.go 76.47% <ø> (ø)
x/lightclient/keeper/grpc_query_prove.go 71.79% <ø> (ø)
zetaclient/chains/bitcoin/fee.go 37.98% <ø> (ø)
zetaclient/chains/bitcoin/observer/observer.go 38.31% <ø> (ø)
zetaclient/chains/bitcoin/rpc/rpc.go 0.00% <ø> (ø)
... and 4 more

codecov[bot] avatar Aug 19 '24 23:08 codecov[bot]