Skip to content

Commit

Permalink
Upgrade btcd
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Aug 22, 2024
1 parent 153a3f1 commit 024e94a
Show file tree
Hide file tree
Showing 47 changed files with 104 additions and 652 deletions.
2 changes: 1 addition & 1 deletion cmd/zetaclientd/gen_pre_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"os"
"time"

"github.com/bnb-chain/tss-lib/ecdsa/keygen"
"github.com/spf13/cobra"
"gitlab.com/thorchain/tss/tss-lib/ecdsa/keygen"
)

func init() {
Expand Down
105 changes: 0 additions & 105 deletions cmd/zetaclientd/hsm.go

This file was deleted.

3 changes: 1 addition & 2 deletions cmd/zetaclientd/keygen_tss.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ func keygenTSS(
keygenLogger zerolog.Logger,
) (string, error) {
keygenLogger.Info().Msgf("Keygen at blocknum %d , TSS signers %s ", keyGen.BlockNumber, keyGen.GranteePubkeys)
var req keygen.Request
req = keygen.NewRequest(keyGen.GranteePubkeys, keyGen.BlockNumber, "0.14.0")
req := keygen.NewRequest(keyGen.GranteePubkeys, keyGen.BlockNumber, "0.14.0", tsscommon.ECDSA)
res, err := tssServer.Keygen(req)
if res.Status != tsscommon.Success || res.PubKey == "" {
keygenLogger.Error().Msgf("keygen fail: reason %s blame nodes %s", res.Blame.FailReason, res.Blame.BlameNodes)
Expand Down
2 changes: 1 addition & 1 deletion cmd/zetaclientd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"os"
"time"

ecdsakeygen "github.com/bnb-chain/tss-lib/ecdsa/keygen"
"github.com/cosmos/cosmos-sdk/server"
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
"github.com/cosmos/cosmos-sdk/types"
ecdsakeygen "gitlab.com/thorchain/tss/tss-lib/ecdsa/keygen"

"github.com/zeta-chain/zetacore/app"
"github.com/zeta-chain/zetacore/cmd"
Expand Down
2 changes: 1 addition & 1 deletion e2e/e2etests/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strconv"

"github.com/btcsuite/btcd/btcjson"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcutil"
ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"

Expand Down
2 changes: 1 addition & 1 deletion e2e/e2etests/test_bitcoin_withdraw_legacy.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package e2etests

import (
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcd/btcutil"
"github.com/stretchr/testify/require"

"github.com/zeta-chain/zetacore/e2e/runner"
Expand Down
2 changes: 1 addition & 1 deletion e2e/e2etests/test_bitcoin_withdraw_p2sh.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package e2etests

import (
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcd/btcutil"
"github.com/stretchr/testify/require"

"github.com/zeta-chain/zetacore/e2e/runner"
Expand Down
2 changes: 1 addition & 1 deletion e2e/e2etests/test_bitcoin_withdraw_p2wsh.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package e2etests

import (
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcd/btcutil"
"github.com/stretchr/testify/require"

"github.com/zeta-chain/zetacore/e2e/runner"
Expand Down
2 changes: 1 addition & 1 deletion e2e/e2etests/test_bitcoin_withdraw_segwit.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package e2etests

import (
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcd/btcutil"
"github.com/stretchr/testify/require"

"github.com/zeta-chain/zetacore/e2e/runner"
Expand Down
2 changes: 1 addition & 1 deletion e2e/e2etests/test_migrate_tss.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

sdkmath "cosmossdk.io/math"
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcd/btcutil"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"

Expand Down
2 changes: 1 addition & 1 deletion e2e/e2etests/test_stress_btc_withdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"math/big"
"time"

"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcd/btcutil"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/stretchr/testify/require"
"golang.org/x/sync/errgroup"
Expand Down
2 changes: 1 addition & 1 deletion e2e/runner/balances.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"math/big"
"strings"

"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcd/btcutil"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/pkg/errors"
)
Expand Down
2 changes: 1 addition & 1 deletion e2e/runner/bitcoin.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"time"

"github.com/btcsuite/btcd/btcjson"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcutil"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/rs/zerolog/log"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion e2e/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"sync"
"time"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/rpcclient"
"github.com/btcsuite/btcutil"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
Expand Down
6 changes: 3 additions & 3 deletions e2e/runner/setup_bitcoin.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"time"

"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/rpcclient"
"github.com/btcsuite/btcutil"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -61,7 +61,7 @@ func (r *E2ERunner) GetBtcAddress() (string, string, error) {
return "", "", err
}

sk, _ := btcec.PrivKeyFromBytes(btcec.S256(), skBytes)
sk, _ := btcec.PrivKeyFromBytes(skBytes)
privkeyWIF, err := btcutil.NewWIF(sk, r.BitcoinParams, true)
if err != nil {
return "", "", err
Expand All @@ -84,7 +84,7 @@ func (r *E2ERunner) SetBtcAddress(name string, rescan bool) {
skBytes, err := hex.DecodeString(r.Account.RawPrivateKey.String())
require.NoError(r, err)

sk, _ := btcec.PrivKeyFromBytes(btcec.S256(), skBytes)
sk, _ := btcec.PrivKeyFromBytes(skBytes)
privkeyWIF, err := btcutil.NewWIF(sk, r.BitcoinParams, true)
require.NoError(r, err)

Expand Down
2 changes: 1 addition & 1 deletion e2e/runner/setup_zeta.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"math/big"
"time"

"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcd/btcutil"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion e2e/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"encoding/hex"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcutil"
"github.com/stretchr/testify/require"
)

Expand Down
20 changes: 9 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,14 @@ require (
cosmossdk.io/errors v1.0.1
cosmossdk.io/math v1.3.0
github.com/99designs/keyring v1.2.1
github.com/btcsuite/btcd v0.23.4
github.com/btcsuite/btcd v0.24.2
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
github.com/emicklei/proto v1.11.1
github.com/evmos/ethermint v0.22.0
github.com/fatih/color v1.13.0
github.com/frumioj/crypto11 v1.2.5-0.20210823151709-946ce662cc0e
github.com/pkg/errors v0.9.1
github.com/rakyll/statik v0.1.7
github.com/zeta-chain/keystone/keys v0.0.0-20231105174229-903bc9405da2
github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20240816144801-7eb673cf8890
google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0
gopkg.in/yaml.v2 v2.4.0
Expand All @@ -59,7 +56,8 @@ require (
require (
cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d
cosmossdk.io/tools/rosetta v0.2.1
github.com/btcsuite/btcd/btcutil v1.1.3
github.com/bnb-chain/tss-lib v1.3.5
github.com/btcsuite/btcd/btcutil v1.1.5
github.com/cockroachdb/errors v1.11.1
github.com/cometbft/cometbft v0.37.4
github.com/cometbft/cometbft-db v0.12.0
Expand All @@ -69,7 +67,6 @@ require (
github.com/near/borsh-go v0.3.1
github.com/onrik/ethrpc v1.2.0
github.com/samber/lo v1.46.0
gitlab.com/thorchain/tss/tss-lib v0.2.0
go.nhat.io/grpcmock v0.25.0
)

Expand All @@ -91,6 +88,7 @@ require (
github.com/cosmos/ics23/go v0.10.0 // indirect
github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect
github.com/decred/dcrd/dcrec/edwards/v2 v2.0.0 // indirect
github.com/dgraph-io/badger/v4 v4.2.0 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
Expand All @@ -111,19 +109,18 @@ require (
github.com/libp2p/go-yamux/v4 v4.0.0 // indirect
github.com/linxGnu/grocksdb v1.8.14 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
github.com/miekg/pkcs11 v1.1.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 // indirect
github.com/onsi/gomega v1.27.7 // indirect
github.com/otiai10/mint v1.3.2 // indirect
github.com/prometheus/tsdb v0.7.1 // indirect
github.com/rjeczalik/notify v0.9.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect
github.com/swaggest/assertjson v1.9.0 // indirect
github.com/tendermint/btcd v0.1.1 // indirect
github.com/thales-e-security/pool v0.0.2 // indirect
github.com/tidwall/gjson v1.14.4 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
Expand Down Expand Up @@ -350,7 +347,6 @@ require (

replace (
github.com/agl/ed25519 => github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43
github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.3
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0

github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
Expand All @@ -366,4 +362,6 @@ replace github.com/evmos/ethermint => github.com/zeta-chain/ethermint v0.0.0-202

replace github.com/libp2p/go-libp2p => github.com/zeta-chain/go-libp2p v0.0.0-20240710192637-567fbaacc2b4

replace gitlab.com/thorchain/tss/go-tss => github.com/zeta-chain/go-tss v0.0.0-20240729195411-9f5ae8189449
replace gitlab.com/thorchain/tss/go-tss => github.com/zeta-chain/go-tss v0.0.0-20240819223347-fce649aca224

replace github.com/bnb-chain/tss-lib => github.com/zeta-chain/tss-lib v0.0.0-20240819214903-774ccaf59fca
Loading

0 comments on commit 024e94a

Please sign in to comment.