diff --git a/Dockerfile b/Dockerfile index b8433627..87131edf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,15 +14,15 @@ RUN apk add --no-cache --update openssh git make build-base linux-headers libc-d RUN mkdir -p /root/.ssh && ssh-keyscan github.com >> /root/.ssh/known_hosts RUN git config --global url."git@github.com:".insteadOf "https://github.com/" -ENV GOPRIVATE=github.com/babylonchain/* +ENV GOPRIVATE=github.com/babylonlabs-io/* # Build -WORKDIR /go/src/github.com/babylonchain/finality-provider +WORKDIR /go/src/github.com/babylonlabs-io/finality-provider # Cache dependencies -COPY go.mod go.sum /go/src/github.com/babylonchain/finality-provider/ +COPY go.mod go.sum /go/src/github.com/babylonlabs-io/finality-provider/ RUN --mount=type=secret,id=sshKey,target=/root/.ssh/id_rsa go mod download # Copy the rest of the files -COPY ./ /go/src/github.com/babylonchain/finality-provider/ +COPY ./ /go/src/github.com/babylonlabs-io/finality-provider/ # Cosmwasm - Download correct libwasmvm version RUN WASMVM_VERSION=$(grep github.com/CosmWasm/wasmvm go.mod | cut -d' ' -f2) && \ @@ -45,8 +45,8 @@ RUN addgroup --gid 1138 -S finality-provider && adduser --uid 1138 -S finality-p RUN apk add bash curl jq -COPY --from=builder /go/src/github.com/babylonchain/finality-provider/build/fpd /bin/fpd -COPY --from=builder /go/src/github.com/babylonchain/finality-provider/build/eotsd /bin/eotsd +COPY --from=builder /go/src/github.com/babylonlabs-io/finality-provider/build/fpd /bin/fpd +COPY --from=builder /go/src/github.com/babylonlabs-io/finality-provider/build/eotsd /bin/eotsd WORKDIR /home/finality-provider RUN chown -R finality-provider /home/finality-provider diff --git a/Makefile b/Makefile index 72d416d5..4917a0d1 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ BUILDDIR ?= $(CURDIR)/build TOOLS_DIR := tools -BABYLON_PKG := github.com/babylonchain/babylon/cmd/babylond +BABYLON_PKG := github.com/babylonlabs-io/babylon/cmd/babylond WASMD_PKG := github.com/CosmWasm/wasmd/cmd/wasmd BCD_PKG := github.com/babylonchain/babylon-sdk/demo/cmd/bcd @@ -121,7 +121,7 @@ test-e2e-op-ci: clean-e2e install-babylond "xargs go test -race -mod=readonly -timeout=25m -v $(PACKAGES_E2E_OP) -count=1 --tags=e2e_op --run" \ --split-by=name --timings-type=name -DEVNET_REPO_URL := https://github.com/babylonchain/op-e2e-devnet +DEVNET_REPO_URL := https://github.com/babylonlabs-io/op-e2e-devnet TARGET_DIR := ./itest/opstackl2/devnet-data .PHONY: op-e2e-devnet diff --git a/README.md b/README.md index 76e294a0..ffeb8d1c 100644 --- a/README.md +++ b/README.md @@ -46,11 +46,11 @@ the [official Go installation guide](https://golang.org/doc/install). To get started, clone the repository to your local machine from Github: ```bash -git clone https://github.com/babylonchain/finality-provider.git +git clone https://github.com/babylonlabs-io/finality-provider.git ``` You can choose a specific version from -the [official releases page](https://github.com/babylonchain/finality-provider/releases) +the [official releases page](https://github.com/babylonlabs-io/finality-provider/releases) ```bash cd finality-provider # cd into the project directory @@ -113,5 +113,5 @@ A finality provider receives BTC delegations through delegators interacting with Babylon and choosing it as the recipient of their delegations. To perform a self-delegation, the operator can either visit the staking web app we provide, -or run the Babylon [BTC Staker program](https://github.com/babylonchain/btc-staker) once. +or run the Babylon [BTC Staker program](https://github.com/babylonlabs-io/btc-staker) once. The BTC staker connects to a Bitcoin wallet and Babylon to perform delegations. diff --git a/clientcontroller/api/interface.go b/clientcontroller/api/interface.go index 3a470b5e..df905826 100644 --- a/clientcontroller/api/interface.go +++ b/clientcontroller/api/interface.go @@ -5,7 +5,7 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" - "github.com/babylonchain/finality-provider/types" + "github.com/babylonlabs-io/finality-provider/types" ) type ClientController interface { diff --git a/clientcontroller/babylon/babylon.go b/clientcontroller/babylon/babylon.go index ebbb8fce..e1bcbb3b 100644 --- a/clientcontroller/babylon/babylon.go +++ b/clientcontroller/babylon/babylon.go @@ -6,13 +6,13 @@ import ( sdkErr "cosmossdk.io/errors" "cosmossdk.io/math" - bbnclient "github.com/babylonchain/babylon/client/client" - bbntypes "github.com/babylonchain/babylon/types" - btcctypes "github.com/babylonchain/babylon/x/btccheckpoint/types" - btclctypes "github.com/babylonchain/babylon/x/btclightclient/types" - btcstakingtypes "github.com/babylonchain/babylon/x/btcstaking/types" - bsctypes "github.com/babylonchain/babylon/x/btcstkconsumer/types" - finalitytypes "github.com/babylonchain/babylon/x/finality/types" + bbnclient "github.com/babylonlabs-io/babylon/client/client" + bbntypes "github.com/babylonlabs-io/babylon/types" + btcctypes "github.com/babylonlabs-io/babylon/x/btccheckpoint/types" + btclctypes "github.com/babylonlabs-io/babylon/x/btclightclient/types" + btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" + bsctypes "github.com/babylonlabs-io/babylon/x/btcstkconsumer/types" + finalitytypes "github.com/babylonlabs-io/babylon/x/finality/types" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/btcsuite/btcd/btcutil" @@ -23,9 +23,9 @@ import ( "github.com/cosmos/relayer/v2/relayer/provider" "go.uber.org/zap" - "github.com/babylonchain/finality-provider/clientcontroller/api" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/types" + "github.com/babylonlabs-io/finality-provider/clientcontroller/api" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/types" ) var _ api.ClientController = &BabylonController{} diff --git a/clientcontroller/babylon/consumer.go b/clientcontroller/babylon/consumer.go index e766213d..1564a24f 100644 --- a/clientcontroller/babylon/consumer.go +++ b/clientcontroller/babylon/consumer.go @@ -6,13 +6,13 @@ import ( "fmt" sdkErr "cosmossdk.io/errors" - bbnclient "github.com/babylonchain/babylon/client/client" - bbntypes "github.com/babylonchain/babylon/types" - btcstakingtypes "github.com/babylonchain/babylon/x/btcstaking/types" - finalitytypes "github.com/babylonchain/babylon/x/finality/types" - "github.com/babylonchain/finality-provider/clientcontroller/api" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/types" + bbnclient "github.com/babylonlabs-io/babylon/client/client" + bbntypes "github.com/babylonlabs-io/babylon/types" + btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" + finalitytypes "github.com/babylonlabs-io/babylon/x/finality/types" + "github.com/babylonlabs-io/finality-provider/clientcontroller/api" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/types" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/btcsuite/btcd/chaincfg" diff --git a/clientcontroller/cosmwasm/consumer.go b/clientcontroller/cosmwasm/consumer.go index 04a747d7..bf8494bb 100644 --- a/clientcontroller/cosmwasm/consumer.go +++ b/clientcontroller/cosmwasm/consumer.go @@ -9,11 +9,11 @@ import ( sdkErr "cosmossdk.io/errors" wasmdparams "github.com/CosmWasm/wasmd/app/params" wasmdtypes "github.com/CosmWasm/wasmd/x/wasm/types" - bbntypes "github.com/babylonchain/babylon/types" - "github.com/babylonchain/finality-provider/clientcontroller/api" - cwcclient "github.com/babylonchain/finality-provider/cosmwasmclient/client" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - fptypes "github.com/babylonchain/finality-provider/types" + bbntypes "github.com/babylonlabs-io/babylon/types" + "github.com/babylonlabs-io/finality-provider/clientcontroller/api" + cwcclient "github.com/babylonlabs-io/finality-provider/cosmwasmclient/client" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + fptypes "github.com/babylonlabs-io/finality-provider/types" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" cmtcrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" diff --git a/clientcontroller/factory.go b/clientcontroller/factory.go index 53d622c8..1c962c9e 100644 --- a/clientcontroller/factory.go +++ b/clientcontroller/factory.go @@ -3,12 +3,12 @@ package clientcontroller import ( "fmt" - "github.com/babylonchain/finality-provider/clientcontroller/api" - "github.com/babylonchain/finality-provider/clientcontroller/babylon" - "github.com/babylonchain/finality-provider/clientcontroller/cosmwasm" - "github.com/babylonchain/finality-provider/clientcontroller/opstackl2" - cosmwasmcfg "github.com/babylonchain/finality-provider/cosmwasmclient/config" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/clientcontroller/api" + "github.com/babylonlabs-io/finality-provider/clientcontroller/babylon" + "github.com/babylonlabs-io/finality-provider/clientcontroller/cosmwasm" + "github.com/babylonlabs-io/finality-provider/clientcontroller/opstackl2" + cosmwasmcfg "github.com/babylonlabs-io/finality-provider/cosmwasmclient/config" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" "go.uber.org/zap" ) diff --git a/clientcontroller/opstackl2/consumer.go b/clientcontroller/opstackl2/consumer.go index a67e9286..a9c6de82 100644 --- a/clientcontroller/opstackl2/consumer.go +++ b/clientcontroller/opstackl2/consumer.go @@ -10,13 +10,13 @@ import ( sdkErr "cosmossdk.io/errors" wasmdparams "github.com/CosmWasm/wasmd/app/params" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - bbnapp "github.com/babylonchain/babylon/app" - bbntypes "github.com/babylonchain/babylon/types" - "github.com/babylonchain/finality-provider/clientcontroller/api" - cwclient "github.com/babylonchain/finality-provider/cosmwasmclient/client" - cwconfig "github.com/babylonchain/finality-provider/cosmwasmclient/config" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/types" + bbnapp "github.com/babylonlabs-io/babylon/app" + bbntypes "github.com/babylonlabs-io/babylon/types" + "github.com/babylonlabs-io/finality-provider/clientcontroller/api" + cwclient "github.com/babylonlabs-io/finality-provider/cosmwasmclient/client" + cwconfig "github.com/babylonlabs-io/finality-provider/cosmwasmclient/config" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/types" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" cmtcrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" @@ -244,7 +244,7 @@ func (cc *OPStackL2ConsumerController) SubmitBatchFinalitySigs( // QueryFinalityProviderHasPower queries whether the finality provider has voting power at a given height // This interface function only used for checking if the FP is eligible for submitting sigs. // Now we can simply hardcode the voting power to true -// TODO: see this issue https://github.com/babylonchain/finality-provider/issues/390 for more details +// TODO: see this issue https://github.com/babylonlabs-io/finality-provider/issues/390 for more details func (cc *OPStackL2ConsumerController) QueryFinalityProviderHasPower(fpPk *btcec.PublicKey, blockHeight uint64) (bool, error) { return true, nil } diff --git a/clientcontroller/retry_utils.go b/clientcontroller/retry_utils.go index 39748ff7..a0eb1a4c 100644 --- a/clientcontroller/retry_utils.go +++ b/clientcontroller/retry_utils.go @@ -5,8 +5,8 @@ import ( "strings" sdkErr "cosmossdk.io/errors" - btcstakingtypes "github.com/babylonchain/babylon/x/btcstaking/types" - finalitytypes "github.com/babylonchain/babylon/x/finality/types" + btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" + finalitytypes "github.com/babylonlabs-io/babylon/x/finality/types" ) // these errors are considered unrecoverable because they indicate diff --git a/cosmwasmclient/client/client.go b/cosmwasmclient/client/client.go index 8ad9b664..d86d5f36 100644 --- a/cosmwasmclient/client/client.go +++ b/cosmwasmclient/client/client.go @@ -6,8 +6,8 @@ import ( "time" wasmdparams "github.com/CosmWasm/wasmd/app/params" - "github.com/babylonchain/finality-provider/cosmwasmclient/config" - "github.com/babylonchain/finality-provider/cosmwasmclient/query" + "github.com/babylonlabs-io/finality-provider/cosmwasmclient/config" + "github.com/babylonlabs-io/finality-provider/cosmwasmclient/query" rpchttp "github.com/cometbft/cometbft/rpc/client/http" "github.com/cosmos/relayer/v2/relayer/chains/cosmos" "go.uber.org/zap" diff --git a/cosmwasmclient/config/query_config_test.go b/cosmwasmclient/config/query_config_test.go index 4a969aac..f48bb320 100644 --- a/cosmwasmclient/config/query_config_test.go +++ b/cosmwasmclient/config/query_config_test.go @@ -3,7 +3,7 @@ package config_test import ( "testing" - "github.com/babylonchain/finality-provider/cosmwasmclient/config" + "github.com/babylonlabs-io/finality-provider/cosmwasmclient/config" "github.com/stretchr/testify/require" ) diff --git a/cosmwasmclient/query/client.go b/cosmwasmclient/query/client.go index 6e3ac0a2..d132a027 100644 --- a/cosmwasmclient/query/client.go +++ b/cosmwasmclient/query/client.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/babylonchain/finality-provider/cosmwasmclient/config" + "github.com/babylonlabs-io/finality-provider/cosmwasmclient/config" rpcclient "github.com/cometbft/cometbft/rpc/client" "github.com/cosmos/cosmos-sdk/client" ) diff --git a/docs/eots.md b/docs/eots.md index b09b77a7..8b20cb03 100644 --- a/docs/eots.md +++ b/docs/eots.md @@ -127,8 +127,8 @@ You can use your key to create a Schnorr signature over arbitrary data through the `eotsd sign-schnorr` command. The command takes as an argument the file path, hashes the file content using sha256, and signs the hash with the EOTS private key in Schnorr format by the -given `key-name` or `btc-pk`. If both flags `--key-name` and `--btc-pk` are -provided, `btc-pk` takes priority. +given `key-name` or `eots-pk`. If both flags `--key-name` and `--eots-pk` are +provided, `eots-pk` takes priority. ```shell eotsd sign-schnorr /path/to/data/file --home /path/to/eotsd/home/ --key-name my-key-name --keyring-backend file @@ -146,12 +146,12 @@ You can verify the Schnorr signature signed in the previous step through the `eptsd veify-schnorr-sig` command. The command takes as an argument the file path, hashes the file content using sha256 to generate the signed data, and verifies the signature from the `--signature` -flag using the given public key from the `--btc-pk` flag. +flag using the given public key from the `--eots-pk` flag. If the signature is valid, you will see `Verification is successful!` in the output. Otherwise, an error message will be printed out. ```shell -eotsd verify-schnorr-sig /path/to/data/file --btc-pk 50b106208c921b5e8a1c45494306fe1fc2cf68f33b8996420867dc7667fde383 \ +eotsd verify-schnorr-sig /path/to/data/file --eots-pk 50b106208c921b5e8a1c45494306fe1fc2cf68f33b8996420867dc7667fde383 \ --signature b91fc06b30b78c0ca66a7e033184d89b61cd6ab572329b20f6052411ab83502effb5c9a1173ed69f20f6502a741eeb5105519bb3f67d37612bc2bcce411f8d72 \ --keyring-backend file ``` diff --git a/docs/finality-provider.md b/docs/finality-provider.md index 6c8e725f..527eafc6 100644 --- a/docs/finality-provider.md +++ b/docs/finality-provider.md @@ -131,7 +131,7 @@ this value and specify a custom address using the `--rpc-listener` flag. This will also start all the registered finality provider instances except for slashed ones added in [step](#5-create-and-register-a-finality-provider). To start the daemon with a specific finality provider instance, use the -`--btc-pk` flag followed by the hex string of the BTC public key of the finality +`--eots-pk` flag followed by the hex string of the BTC public key of the finality provider (`btc_pk_hex`) obtained in [step](#5-create-and-register-a-finality-provider). @@ -175,7 +175,7 @@ the hash of the Babylon finality provider registration transaction. ```bash fpd register-finality-provider \ - --btc-pk d0fc4db48643fbb4339dc4bbf15f272411716b0d60f18bdfeb3861544bf5ef63 + --eots-pk d0fc4db48643fbb4339dc4bbf15f272411716b0d60f18bdfeb3861544bf5ef63 { "tx_hash": "800AE5BBDADE974C5FA5BD44336C7F1A952FAB9F5F9B43F7D4850BA449319BAA" } @@ -219,11 +219,11 @@ fpd list-finality-providers After the creation of the finality provider in the local db, it is possible to export the finality provider information through the `fpd export-finality-provider` command. This command connects with the `fpd` daemon to retrieve the finality -provider previously created using the flag `--btc-pk` as key. +provider previously created using the flag `--eots-pk` as key. This command also has several flag options: -- `--btc-pk` the hex string of the BTC public key. +- `--eots-pk` the hex string of the BTC public key. - `--daemon-address` the RPC server address of `fpd` daemon. - `--signed` signs the finality provider with the chain key of the PoS chain secured as a proof of untempered exported data. @@ -235,7 +235,7 @@ passphrase is required. - `--hd-path` the hd derivation path of the private key. ```shell -$ fpd export-finality-provider --btc-pk 02face5996b2792114677604ec9dfad4fe66eeace3df92dab834754add5bdd7077 \ +$ fpd export-finality-provider --eots-pk 02face5996b2792114677604ec9dfad4fe66eeace3df92dab834754add5bdd7077 \ --home ./export-fp/fpd --key-name finality-provider --signed ``` diff --git a/eotsmanager/client/rpcclient.go b/eotsmanager/client/rpcclient.go index 53356cc8..821ecb18 100644 --- a/eotsmanager/client/rpcclient.go +++ b/eotsmanager/client/rpcclient.go @@ -9,9 +9,9 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - "github.com/babylonchain/finality-provider/eotsmanager" - "github.com/babylonchain/finality-provider/eotsmanager/proto" - "github.com/babylonchain/finality-provider/eotsmanager/types" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + "github.com/babylonlabs-io/finality-provider/eotsmanager/proto" + "github.com/babylonlabs-io/finality-provider/eotsmanager/types" ) var _ eotsmanager.EOTSManager = &EOTSManagerGRpcClient{} diff --git a/eotsmanager/cmd/eotsd/daemon/flags.go b/eotsmanager/cmd/eotsd/daemon/flags.go index c4679a5b..42ec8901 100644 --- a/eotsmanager/cmd/eotsd/daemon/flags.go +++ b/eotsmanager/cmd/eotsd/daemon/flags.go @@ -6,7 +6,7 @@ const ( homeFlag = "home" forceFlag = "force" rpcListenerFlag = "rpc-listener" - fpPkFlag = "btc-pk" + eotsPkFlag = "eots-pk" signatureFlag = "signature" // flags for keys diff --git a/eotsmanager/cmd/eotsd/daemon/init.go b/eotsmanager/cmd/eotsd/daemon/init.go index 9855ab31..b2f33dcb 100644 --- a/eotsmanager/cmd/eotsd/daemon/init.go +++ b/eotsmanager/cmd/eotsd/daemon/init.go @@ -7,8 +7,8 @@ import ( "github.com/jessevdk/go-flags" "github.com/urfave/cli" - eotscfg "github.com/babylonchain/finality-provider/eotsmanager/config" - "github.com/babylonchain/finality-provider/util" + eotscfg "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + "github.com/babylonlabs-io/finality-provider/util" ) var InitCommand = cli.Command{ diff --git a/eotsmanager/cmd/eotsd/daemon/keys.go b/eotsmanager/cmd/eotsd/daemon/keys.go index f6efa4ca..32db17ec 100644 --- a/eotsmanager/cmd/eotsd/daemon/keys.go +++ b/eotsmanager/cmd/eotsd/daemon/keys.go @@ -11,10 +11,10 @@ import ( "github.com/cosmos/go-bip39" "github.com/urfave/cli" - bbntypes "github.com/babylonchain/babylon/types" - "github.com/babylonchain/finality-provider/eotsmanager" - "github.com/babylonchain/finality-provider/eotsmanager/config" - "github.com/babylonchain/finality-provider/log" + bbntypes "github.com/babylonlabs-io/babylon/types" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + "github.com/babylonlabs-io/finality-provider/log" ) type KeyOutput struct { diff --git a/eotsmanager/cmd/eotsd/daemon/pop.go b/eotsmanager/cmd/eotsd/daemon/pop.go index 22242f38..a0006739 100644 --- a/eotsmanager/cmd/eotsd/daemon/pop.go +++ b/eotsmanager/cmd/eotsd/daemon/pop.go @@ -6,12 +6,12 @@ import ( "github.com/cometbft/cometbft/crypto/tmhash" sdk "github.com/cosmos/cosmos-sdk/types" - bbnparams "github.com/babylonchain/babylon/app/params" - bbn "github.com/babylonchain/babylon/types" - btcstktypes "github.com/babylonchain/babylon/x/btcstaking/types" - "github.com/babylonchain/finality-provider/eotsmanager" - "github.com/babylonchain/finality-provider/eotsmanager/config" - "github.com/babylonchain/finality-provider/log" + bbnparams "github.com/babylonlabs-io/babylon/app/params" + bbn "github.com/babylonlabs-io/babylon/types" + btcstktypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + "github.com/babylonlabs-io/finality-provider/log" "github.com/urfave/cli" ) @@ -20,7 +20,7 @@ func init() { } // PoPExport the data for exporting the PoP. -// The PubKeyHex is the public key of the finality provider BTC key to load +// The PubKeyHex is the public key of the finality provider EOTS key to load // the private key and sign the AddressSiged. type PoPExport struct { PubKeyHex string `json:"pub_key_hex"` @@ -33,8 +33,8 @@ var ExportPoPCommand = cli.Command{ Usage: "Exports the Proof of Possession by signing over the finality provider's Babylon address with the EOTS private key.", UsageText: "pop-export [bbn-address]", Description: `Parse the address received as argument, hash it with - sha256 and sign based on the EOTS key associated with the key-name or btc-pk flag. - If the both flags are supplied, btc-pk takes priority. Use the generated signature + sha256 and sign based on the EOTS key associated with the key-name or eots-pk flag. + If the both flags are supplied, eots-pk takes priority. Use the generated signature to build a Proof of Possession and export it.`, Flags: []cli.Flag{ cli.StringFlag{ @@ -47,7 +47,7 @@ var ExportPoPCommand = cli.Command{ Usage: "The name of the key to load private key for signing", }, cli.StringFlag{ - Name: fpPkFlag, + Name: eotsPkFlag, Usage: "The public key of the finality-provider to load private key for signing", }, cli.StringFlag{ @@ -66,7 +66,7 @@ var ExportPoPCommand = cli.Command{ func ExportPoP(ctx *cli.Context) error { keyName := ctx.String(keyNameFlag) - fpPkStr := ctx.String(fpPkFlag) + fpPkStr := ctx.String(eotsPkFlag) passphrase := ctx.String(passphraseFlag) keyringBackend := ctx.String(keyringBackendFlag) @@ -78,7 +78,7 @@ func ExportPoP(ctx *cli.Context) error { } if len(fpPkStr) == 0 && len(keyName) == 0 { - return fmt.Errorf("at least one of the flags: %s, %s needs to be informed", keyNameFlag, fpPkFlag) + return fmt.Errorf("at least one of the flags: %s, %s needs to be informed", keyNameFlag, eotsPkFlag) } homePath, err := getHomeFlag(ctx) diff --git a/eotsmanager/cmd/eotsd/daemon/pop_test.go b/eotsmanager/cmd/eotsd/daemon/pop_test.go index 6b42b2b3..57bf90bc 100644 --- a/eotsmanager/cmd/eotsd/daemon/pop_test.go +++ b/eotsmanager/cmd/eotsd/daemon/pop_test.go @@ -7,11 +7,11 @@ import ( "path/filepath" "testing" - "github.com/babylonchain/babylon/testutil/datagen" - bbn "github.com/babylonchain/babylon/types" - btcstktypes "github.com/babylonchain/babylon/x/btcstaking/types" - dcli "github.com/babylonchain/finality-provider/eotsmanager/cmd/eotsd/daemon" - "github.com/babylonchain/finality-provider/testutil" + "github.com/babylonlabs-io/babylon/testutil/datagen" + bbn "github.com/babylonlabs-io/babylon/types" + btcstktypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" + dcli "github.com/babylonlabs-io/finality-provider/eotsmanager/cmd/eotsd/daemon" + "github.com/babylonlabs-io/finality-provider/testutil" "github.com/btcsuite/btcd/chaincfg" "github.com/stretchr/testify/require" "github.com/urfave/cli" @@ -43,8 +43,8 @@ func FuzzPoPExport(f *testing.F) { bbnAddr := datagen.GenRandomAccount().GetAddress() - btcPkFlag := fmt.Sprintf("--btc-pk=%s", keyOut.PubKeyHex) - exportedPoP := appRunPoPExport(r, t, app, []string{bbnAddr.String(), hFlag, btcPkFlag}) + eotsBtcPkFlag := fmt.Sprintf("--eots-pk=%s", keyOut.PubKeyHex) + exportedPoP := appRunPoPExport(r, t, app, []string{bbnAddr.String(), hFlag, eotsBtcPkFlag}) pop, err := btcstktypes.NewPoPBTCFromHex(exportedPoP.PoPHex) require.NoError(t, err) diff --git a/eotsmanager/cmd/eotsd/daemon/sign.go b/eotsmanager/cmd/eotsd/daemon/sign.go index abfa14d1..04aca0b5 100644 --- a/eotsmanager/cmd/eotsd/daemon/sign.go +++ b/eotsmanager/cmd/eotsd/daemon/sign.go @@ -9,10 +9,10 @@ import ( "io" "os" - bbntypes "github.com/babylonchain/babylon/types" - "github.com/babylonchain/finality-provider/eotsmanager" - "github.com/babylonchain/finality-provider/eotsmanager/config" - "github.com/babylonchain/finality-provider/log" + bbntypes "github.com/babylonlabs-io/babylon/types" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + "github.com/babylonlabs-io/finality-provider/log" "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/urfave/cli" ) @@ -28,9 +28,9 @@ var SignSchnorrSig = cli.Command{ Name: "sign-schnorr", Usage: "Signs a Schnorr signature over arbitrary data with the EOTS private key.", UsageText: "sign-schnorr [file-path]", - Description: `Read the file received as argument, hash it with - sha256 and sign based on the Schnorr key associated with the key-name or btc-pk flag. - If the both flags are supplied, btc-pk takes priority`, + Description: fmt.Sprintf(`Read the file received as argument, hash it with + sha256 and sign based on the Schnorr key associated with the %s or %s flag. + If the both flags are supplied, %s takes priority`, keyNameFlag, eotsPkFlag, eotsPkFlag), Flags: []cli.Flag{ cli.StringFlag{ Name: homeFlag, @@ -42,7 +42,7 @@ var SignSchnorrSig = cli.Command{ Usage: "The name of the key to load private key for signing", }, cli.StringFlag{ - Name: fpPkFlag, + Name: eotsPkFlag, Usage: "The public key of the finality-provider to load private key for signing", }, cli.StringFlag{ @@ -65,7 +65,7 @@ var VerifySchnorrSig = cli.Command{ UsageText: "verify-schnorr-sig [file-path]", Flags: []cli.Flag{ cli.StringFlag{ - Name: fpPkFlag, + Name: eotsPkFlag, Usage: "The EOTS public key that will be used to verify the signature", Required: true, }, @@ -79,7 +79,7 @@ var VerifySchnorrSig = cli.Command{ } func SignSchnorrVerify(ctx *cli.Context) error { - fpPkStr := ctx.String(fpPkFlag) + fpPkStr := ctx.String(eotsPkFlag) signatureHex := ctx.String(signatureFlag) args := ctx.Args() @@ -123,7 +123,7 @@ func SignSchnorrVerify(ctx *cli.Context) error { func SignSchnorr(ctx *cli.Context) error { keyName := ctx.String(keyNameFlag) - fpPkStr := ctx.String(fpPkFlag) + fpPkStr := ctx.String(eotsPkFlag) passphrase := ctx.String(passphraseFlag) keyringBackend := ctx.String(keyringBackendFlag) @@ -134,7 +134,7 @@ func SignSchnorr(ctx *cli.Context) error { } if len(fpPkStr) == 0 && len(keyName) == 0 { - return fmt.Errorf("at least one of the flags: %s, %s needs to be informed", keyNameFlag, fpPkFlag) + return fmt.Errorf("at least one of the flags: %s, %s needs to be informed", keyNameFlag, eotsPkFlag) } homePath, err := getHomeFlag(ctx) diff --git a/eotsmanager/cmd/eotsd/daemon/sign_test.go b/eotsmanager/cmd/eotsd/daemon/sign_test.go index 9bfe3c08..48a85f98 100644 --- a/eotsmanager/cmd/eotsd/daemon/sign_test.go +++ b/eotsmanager/cmd/eotsd/daemon/sign_test.go @@ -11,8 +11,8 @@ import ( "testing" sdkmath "cosmossdk.io/math" - dcli "github.com/babylonchain/finality-provider/eotsmanager/cmd/eotsd/daemon" - "github.com/babylonchain/finality-provider/testutil" + dcli "github.com/babylonlabs-io/finality-provider/eotsmanager/cmd/eotsd/daemon" + "github.com/babylonlabs-io/finality-provider/testutil" "github.com/stretchr/testify/require" "github.com/urfave/cli" @@ -52,13 +52,13 @@ func FuzzSignAndVerifySchnorrSig(f *testing.F) { fpInfoPath := filepath.Join(tempDir, "fpInfo.json") writeFpInfoToFile(r, t, fpInfoPath, keyOut.PubKeyHex) - btcPkFlag := fmt.Sprintf("--btc-pk=%s", keyOut.PubKeyHex) - dataSignedBtcPk := appRunSignSchnorr(r, t, app, []string{fpInfoPath, hFlag, btcPkFlag}) - err = app.Run([]string{"eotsd", "verify-schnorr-sig", fpInfoPath, btcPkFlag, fmt.Sprintf("--signature=%s", dataSignedBtcPk.SchnorrSignatureHex)}) + eotsBtcPkFlag := fmt.Sprintf("--eots-pk=%s", keyOut.PubKeyHex) + dataSignedBtcPk := appRunSignSchnorr(r, t, app, []string{fpInfoPath, hFlag, eotsBtcPkFlag}) + err = app.Run([]string{"eotsd", "verify-schnorr-sig", fpInfoPath, eotsBtcPkFlag, fmt.Sprintf("--signature=%s", dataSignedBtcPk.SchnorrSignatureHex)}) require.NoError(t, err) dataSignedKeyName := appRunSignSchnorr(r, t, app, []string{fpInfoPath, hFlag, keyNameFlag}) - err = app.Run([]string{"eotsd", "verify-schnorr-sig", fpInfoPath, btcPkFlag, fmt.Sprintf("--signature=%s", dataSignedKeyName.SchnorrSignatureHex)}) + err = app.Run([]string{"eotsd", "verify-schnorr-sig", fpInfoPath, eotsBtcPkFlag, fmt.Sprintf("--signature=%s", dataSignedKeyName.SchnorrSignatureHex)}) require.NoError(t, err) // check if both generated signatures match @@ -66,13 +66,13 @@ func FuzzSignAndVerifySchnorrSig(f *testing.F) { require.Equal(t, dataSignedBtcPk.SchnorrSignatureHex, dataSignedKeyName.SchnorrSignatureHex) require.Equal(t, dataSignedBtcPk.SignedDataHashHex, dataSignedKeyName.SignedDataHashHex) - // sign with both keys and btc-pk, should give btc-pk preference - dataSignedBoth := appRunSignSchnorr(r, t, app, []string{fpInfoPath, hFlag, btcPkFlag, keyNameFlag}) + // sign with both keys and eots-pk, should give eots-pk preference + dataSignedBoth := appRunSignSchnorr(r, t, app, []string{fpInfoPath, hFlag, eotsBtcPkFlag, keyNameFlag}) require.Equal(t, dataSignedBoth, dataSignedKeyName) - // the keyname can even be from a invalid keyname, since it gives btc-pk preference + // the keyname can even be from a invalid keyname, since it gives eots-pk preference badKeyname := "badKeyName" - dataSignedBothBadKeyName := appRunSignSchnorr(r, t, app, []string{fpInfoPath, hFlag, btcPkFlag, fmt.Sprintf("--key-name=%s", badKeyname)}) + dataSignedBothBadKeyName := appRunSignSchnorr(r, t, app, []string{fpInfoPath, hFlag, eotsBtcPkFlag, fmt.Sprintf("--key-name=%s", badKeyname)}) require.Equal(t, badKeyname, dataSignedBothBadKeyName.KeyName) require.Equal(t, dataSignedBtcPk.PubKeyHex, dataSignedBothBadKeyName.PubKeyHex) require.Equal(t, dataSignedBtcPk.SchnorrSignatureHex, dataSignedBothBadKeyName.SchnorrSignatureHex) diff --git a/eotsmanager/cmd/eotsd/daemon/start.go b/eotsmanager/cmd/eotsd/daemon/start.go index 8350d16b..e32513eb 100644 --- a/eotsmanager/cmd/eotsd/daemon/start.go +++ b/eotsmanager/cmd/eotsd/daemon/start.go @@ -8,11 +8,11 @@ import ( "github.com/lightningnetwork/lnd/signal" "github.com/urfave/cli" - "github.com/babylonchain/finality-provider/eotsmanager" - "github.com/babylonchain/finality-provider/eotsmanager/config" - eotsservice "github.com/babylonchain/finality-provider/eotsmanager/service" - "github.com/babylonchain/finality-provider/log" - "github.com/babylonchain/finality-provider/util" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + eotsservice "github.com/babylonlabs-io/finality-provider/eotsmanager/service" + "github.com/babylonlabs-io/finality-provider/log" + "github.com/babylonlabs-io/finality-provider/util" ) var StartCommand = cli.Command{ diff --git a/eotsmanager/cmd/eotsd/main.go b/eotsmanager/cmd/eotsd/main.go index 5e3fba91..285296b5 100644 --- a/eotsmanager/cmd/eotsd/main.go +++ b/eotsmanager/cmd/eotsd/main.go @@ -6,7 +6,7 @@ import ( "github.com/urfave/cli" - dcli "github.com/babylonchain/finality-provider/eotsmanager/cmd/eotsd/daemon" + dcli "github.com/babylonlabs-io/finality-provider/eotsmanager/cmd/eotsd/daemon" ) func fatal(err error) { diff --git a/eotsmanager/config/config.go b/eotsmanager/config/config.go index 9366e265..5cc49d35 100644 --- a/eotsmanager/config/config.go +++ b/eotsmanager/config/config.go @@ -9,8 +9,8 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/jessevdk/go-flags" - "github.com/babylonchain/finality-provider/metrics" - "github.com/babylonchain/finality-provider/util" + "github.com/babylonlabs-io/finality-provider/metrics" + "github.com/babylonlabs-io/finality-provider/util" ) const ( diff --git a/eotsmanager/eotsmanager.go b/eotsmanager/eotsmanager.go index 263a1d87..04d02316 100644 --- a/eotsmanager/eotsmanager.go +++ b/eotsmanager/eotsmanager.go @@ -4,7 +4,7 @@ import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" - "github.com/babylonchain/finality-provider/eotsmanager/types" + "github.com/babylonlabs-io/finality-provider/eotsmanager/types" ) type EOTSManager interface { diff --git a/eotsmanager/localmanager.go b/eotsmanager/localmanager.go index 599517c8..eb819287 100644 --- a/eotsmanager/localmanager.go +++ b/eotsmanager/localmanager.go @@ -6,10 +6,10 @@ import ( "strings" "sync" - "github.com/babylonchain/finality-provider/metrics" + "github.com/babylonlabs-io/finality-provider/metrics" - "github.com/babylonchain/babylon/crypto/eots" - bbntypes "github.com/babylonchain/babylon/types" + "github.com/babylonlabs-io/babylon/crypto/eots" + bbntypes "github.com/babylonlabs-io/babylon/types" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -18,10 +18,10 @@ import ( "github.com/lightningnetwork/lnd/kvdb" "go.uber.org/zap" - "github.com/babylonchain/finality-provider/codec" - "github.com/babylonchain/finality-provider/eotsmanager/randgenerator" - "github.com/babylonchain/finality-provider/eotsmanager/store" - eotstypes "github.com/babylonchain/finality-provider/eotsmanager/types" + "github.com/babylonlabs-io/finality-provider/codec" + "github.com/babylonlabs-io/finality-provider/eotsmanager/randgenerator" + "github.com/babylonlabs-io/finality-provider/eotsmanager/store" + eotstypes "github.com/babylonlabs-io/finality-provider/eotsmanager/types" ) const ( diff --git a/eotsmanager/localmanager_test.go b/eotsmanager/localmanager_test.go index adea480c..4db6fd1c 100644 --- a/eotsmanager/localmanager_test.go +++ b/eotsmanager/localmanager_test.go @@ -6,14 +6,14 @@ import ( "path/filepath" "testing" - "github.com/babylonchain/babylon/testutil/datagen" + "github.com/babylonlabs-io/babylon/testutil/datagen" "github.com/stretchr/testify/require" "go.uber.org/zap" - "github.com/babylonchain/finality-provider/eotsmanager" - eotscfg "github.com/babylonchain/finality-provider/eotsmanager/config" - "github.com/babylonchain/finality-provider/eotsmanager/types" - "github.com/babylonchain/finality-provider/testutil" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + eotscfg "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + "github.com/babylonlabs-io/finality-provider/eotsmanager/types" + "github.com/babylonlabs-io/finality-provider/testutil" ) var ( diff --git a/eotsmanager/proto/buf.yaml b/eotsmanager/proto/buf.yaml index 5ab32f06..4876b4a8 100644 --- a/eotsmanager/proto/buf.yaml +++ b/eotsmanager/proto/buf.yaml @@ -1,5 +1,5 @@ version: v1 -name: buf.build/babylonchain/eotsmanager +name: buf.build/babylonlabs-io/eotsmanager deps: breaking: use: diff --git a/eotsmanager/proto/eotsmanager.pb.go b/eotsmanager/proto/eotsmanager.pb.go index ea5ae2b6..9a512e34 100644 --- a/eotsmanager/proto/eotsmanager.pb.go +++ b/eotsmanager/proto/eotsmanager.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: eotsmanager.proto @@ -788,11 +788,11 @@ var file_eotsmanager_proto_rawDesc = []byte{ 0x6e, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, 0x53, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, 0x53, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x62, 0x61, 0x62, 0x79, 0x6c, 0x6f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x62, 0x74, 0x63, - 0x2d, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x2d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x2f, 0x65, 0x6f, 0x74, 0x73, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x42, 0x3f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x62, 0x61, 0x62, 0x79, 0x6c, 0x6f, 0x6e, 0x6c, 0x61, 0x62, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x66, + 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x2d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x2f, 0x65, 0x6f, 0x74, 0x73, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/eotsmanager/proto/eotsmanager.proto b/eotsmanager/proto/eotsmanager.proto index 866a9de0..cc7efec0 100644 --- a/eotsmanager/proto/eotsmanager.proto +++ b/eotsmanager/proto/eotsmanager.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package proto; -option go_package = "github.com/babylonchain/btc-finality-provider/eotsmanager/proto"; +option go_package = "github.com/babylonlabs-io/finality-provider/eotsmanager/proto"; service EOTSManager { rpc Ping (PingRequest) returns (PingResponse); diff --git a/eotsmanager/proto/eotsmanager_grpc.pb.go b/eotsmanager/proto/eotsmanager_grpc.pb.go index 0a8814ad..75b1e5cf 100644 --- a/eotsmanager/proto/eotsmanager_grpc.pb.go +++ b/eotsmanager/proto/eotsmanager_grpc.pb.go @@ -1,8 +1,4 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: eotsmanager.proto package proto @@ -18,15 +14,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - EOTSManager_Ping_FullMethodName = "/proto.EOTSManager/Ping" - EOTSManager_CreateKey_FullMethodName = "/proto.EOTSManager/CreateKey" - EOTSManager_CreateRandomnessPairList_FullMethodName = "/proto.EOTSManager/CreateRandomnessPairList" - EOTSManager_KeyRecord_FullMethodName = "/proto.EOTSManager/KeyRecord" - EOTSManager_SignEOTS_FullMethodName = "/proto.EOTSManager/SignEOTS" - EOTSManager_SignSchnorrSig_FullMethodName = "/proto.EOTSManager/SignSchnorrSig" -) - // EOTSManagerClient is the client API for EOTSManager service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -54,7 +41,7 @@ func NewEOTSManagerClient(cc grpc.ClientConnInterface) EOTSManagerClient { func (c *eOTSManagerClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) { out := new(PingResponse) - err := c.cc.Invoke(ctx, EOTSManager_Ping_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.EOTSManager/Ping", in, out, opts...) if err != nil { return nil, err } @@ -63,7 +50,7 @@ func (c *eOTSManagerClient) Ping(ctx context.Context, in *PingRequest, opts ...g func (c *eOTSManagerClient) CreateKey(ctx context.Context, in *CreateKeyRequest, opts ...grpc.CallOption) (*CreateKeyResponse, error) { out := new(CreateKeyResponse) - err := c.cc.Invoke(ctx, EOTSManager_CreateKey_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.EOTSManager/CreateKey", in, out, opts...) if err != nil { return nil, err } @@ -72,7 +59,7 @@ func (c *eOTSManagerClient) CreateKey(ctx context.Context, in *CreateKeyRequest, func (c *eOTSManagerClient) CreateRandomnessPairList(ctx context.Context, in *CreateRandomnessPairListRequest, opts ...grpc.CallOption) (*CreateRandomnessPairListResponse, error) { out := new(CreateRandomnessPairListResponse) - err := c.cc.Invoke(ctx, EOTSManager_CreateRandomnessPairList_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.EOTSManager/CreateRandomnessPairList", in, out, opts...) if err != nil { return nil, err } @@ -81,7 +68,7 @@ func (c *eOTSManagerClient) CreateRandomnessPairList(ctx context.Context, in *Cr func (c *eOTSManagerClient) KeyRecord(ctx context.Context, in *KeyRecordRequest, opts ...grpc.CallOption) (*KeyRecordResponse, error) { out := new(KeyRecordResponse) - err := c.cc.Invoke(ctx, EOTSManager_KeyRecord_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.EOTSManager/KeyRecord", in, out, opts...) if err != nil { return nil, err } @@ -90,7 +77,7 @@ func (c *eOTSManagerClient) KeyRecord(ctx context.Context, in *KeyRecordRequest, func (c *eOTSManagerClient) SignEOTS(ctx context.Context, in *SignEOTSRequest, opts ...grpc.CallOption) (*SignEOTSResponse, error) { out := new(SignEOTSResponse) - err := c.cc.Invoke(ctx, EOTSManager_SignEOTS_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.EOTSManager/SignEOTS", in, out, opts...) if err != nil { return nil, err } @@ -99,7 +86,7 @@ func (c *eOTSManagerClient) SignEOTS(ctx context.Context, in *SignEOTSRequest, o func (c *eOTSManagerClient) SignSchnorrSig(ctx context.Context, in *SignSchnorrSigRequest, opts ...grpc.CallOption) (*SignSchnorrSigResponse, error) { out := new(SignSchnorrSigResponse) - err := c.cc.Invoke(ctx, EOTSManager_SignSchnorrSig_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.EOTSManager/SignSchnorrSig", in, out, opts...) if err != nil { return nil, err } @@ -169,7 +156,7 @@ func _EOTSManager_Ping_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EOTSManager_Ping_FullMethodName, + FullMethod: "/proto.EOTSManager/Ping", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EOTSManagerServer).Ping(ctx, req.(*PingRequest)) @@ -187,7 +174,7 @@ func _EOTSManager_CreateKey_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EOTSManager_CreateKey_FullMethodName, + FullMethod: "/proto.EOTSManager/CreateKey", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EOTSManagerServer).CreateKey(ctx, req.(*CreateKeyRequest)) @@ -205,7 +192,7 @@ func _EOTSManager_CreateRandomnessPairList_Handler(srv interface{}, ctx context. } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EOTSManager_CreateRandomnessPairList_FullMethodName, + FullMethod: "/proto.EOTSManager/CreateRandomnessPairList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EOTSManagerServer).CreateRandomnessPairList(ctx, req.(*CreateRandomnessPairListRequest)) @@ -223,7 +210,7 @@ func _EOTSManager_KeyRecord_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EOTSManager_KeyRecord_FullMethodName, + FullMethod: "/proto.EOTSManager/KeyRecord", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EOTSManagerServer).KeyRecord(ctx, req.(*KeyRecordRequest)) @@ -241,7 +228,7 @@ func _EOTSManager_SignEOTS_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EOTSManager_SignEOTS_FullMethodName, + FullMethod: "/proto.EOTSManager/SignEOTS", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EOTSManagerServer).SignEOTS(ctx, req.(*SignEOTSRequest)) @@ -259,7 +246,7 @@ func _EOTSManager_SignSchnorrSig_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: EOTSManager_SignSchnorrSig_FullMethodName, + FullMethod: "/proto.EOTSManager/SignSchnorrSig", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EOTSManagerServer).SignSchnorrSig(ctx, req.(*SignSchnorrSigRequest)) diff --git a/eotsmanager/randgenerator/randgenerator.go b/eotsmanager/randgenerator/randgenerator.go index 570031f0..a1405aad 100644 --- a/eotsmanager/randgenerator/randgenerator.go +++ b/eotsmanager/randgenerator/randgenerator.go @@ -4,7 +4,7 @@ import ( "crypto/hmac" "crypto/sha256" - "github.com/babylonchain/babylon/crypto/eots" + "github.com/babylonlabs-io/babylon/crypto/eots" "github.com/btcsuite/btcd/btcec/v2" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/decred/dcrd/dcrec/secp256k1/v4" diff --git a/eotsmanager/service/rpcserver.go b/eotsmanager/service/rpcserver.go index b8cc4990..bbdd9cf4 100644 --- a/eotsmanager/service/rpcserver.go +++ b/eotsmanager/service/rpcserver.go @@ -5,8 +5,8 @@ import ( "google.golang.org/grpc" - "github.com/babylonchain/finality-provider/eotsmanager" - "github.com/babylonchain/finality-provider/eotsmanager/proto" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + "github.com/babylonlabs-io/finality-provider/eotsmanager/proto" ) // rpcServer is the main RPC server for the EOTS daemon that handles diff --git a/eotsmanager/service/server.go b/eotsmanager/service/server.go index d9e2f310..f566bf65 100644 --- a/eotsmanager/service/server.go +++ b/eotsmanager/service/server.go @@ -7,15 +7,15 @@ import ( "sync" "sync/atomic" - "github.com/babylonchain/finality-provider/metrics" + "github.com/babylonlabs-io/finality-provider/metrics" "github.com/lightningnetwork/lnd/kvdb" "github.com/lightningnetwork/lnd/signal" "go.uber.org/zap" "google.golang.org/grpc" - "github.com/babylonchain/finality-provider/eotsmanager" - "github.com/babylonchain/finality-provider/eotsmanager/config" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + "github.com/babylonlabs-io/finality-provider/eotsmanager/config" ) // Server is the main daemon construct for the EOTS manager server. It handles diff --git a/eotsmanager/store/eotsstore_test.go b/eotsmanager/store/eotsstore_test.go index 16d3d793..4161da0c 100644 --- a/eotsmanager/store/eotsstore_test.go +++ b/eotsmanager/store/eotsstore_test.go @@ -5,13 +5,13 @@ import ( "os" "testing" - "github.com/babylonchain/babylon/testutil/datagen" + "github.com/babylonlabs-io/babylon/testutil/datagen" "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/stretchr/testify/require" - "github.com/babylonchain/finality-provider/eotsmanager/config" - "github.com/babylonchain/finality-provider/eotsmanager/store" - "github.com/babylonchain/finality-provider/testutil" + "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + "github.com/babylonlabs-io/finality-provider/eotsmanager/store" + "github.com/babylonlabs-io/finality-provider/testutil" ) // FuzzEOTSStore tests save and show EOTS key names properly diff --git a/finality-provider/cmd/cmd.go b/finality-provider/cmd/cmd.go index 0375844f..52aa4061 100644 --- a/finality-provider/cmd/cmd.go +++ b/finality-provider/cmd/cmd.go @@ -8,8 +8,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - "github.com/babylonchain/babylon/app" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/babylon/app" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" ) // PersistClientCtx persist some vars from the cmd or config to the client context. diff --git a/finality-provider/cmd/cmd_test.go b/finality-provider/cmd/cmd_test.go index 2c0be72b..811902e5 100644 --- a/finality-provider/cmd/cmd_test.go +++ b/finality-provider/cmd/cmd_test.go @@ -10,10 +10,10 @@ import ( "github.com/spf13/cobra" "github.com/stretchr/testify/require" - "github.com/babylonchain/babylon/testutil/datagen" - fpcmd "github.com/babylonchain/finality-provider/finality-provider/cmd" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/util" + "github.com/babylonlabs-io/babylon/testutil/datagen" + fpcmd "github.com/babylonlabs-io/finality-provider/finality-provider/cmd" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/util" goflags "github.com/jessevdk/go-flags" ) diff --git a/finality-provider/cmd/fpd/daemon/daemon_commands.go b/finality-provider/cmd/fpd/daemon/daemon_commands.go index cce479f9..4a982263 100644 --- a/finality-provider/cmd/fpd/daemon/daemon_commands.go +++ b/finality-provider/cmd/fpd/daemon/daemon_commands.go @@ -8,16 +8,16 @@ import ( "strconv" "cosmossdk.io/math" - bbntypes "github.com/babylonchain/babylon/types" + bbntypes "github.com/babylonlabs-io/babylon/types" "github.com/cosmos/cosmos-sdk/client" sdkflags "github.com/cosmos/cosmos-sdk/client/flags" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/spf13/cobra" "github.com/spf13/pflag" - fpcmd "github.com/babylonchain/finality-provider/finality-provider/cmd" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - dc "github.com/babylonchain/finality-provider/finality-provider/service/client" + fpcmd "github.com/babylonlabs-io/finality-provider/finality-provider/cmd" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + dc "github.com/babylonlabs-io/finality-provider/finality-provider/service/client" ) var ( @@ -217,7 +217,7 @@ func runCommandLsFP(cmd *cobra.Command, args []string) error { // CommandInfoFP returns the finality-provider-info command by connecting to the fpd daemon. func CommandInfoFP() *cobra.Command { var cmd = &cobra.Command{ - Use: "finality-provider-info [fp-pk-btc-hex]", + Use: "finality-provider-info [fp-eots-pk-hex]", Aliases: []string{"fpi"}, Short: "List finality providers stored in the database.", Example: fmt.Sprintf(`fpd finality-provider-info --daemon-address %s`, defaultFpdDaemonAddress), @@ -257,7 +257,7 @@ func runCommandInfoFP(cmd *cobra.Command, args []string) error { // CommandRegisterFP returns the register-finality-provider command by connecting to the fpd daemon. func CommandRegisterFP() *cobra.Command { var cmd = &cobra.Command{ - Use: "register-finality-provider [fp-pk-btc-hex]", + Use: "register-finality-provider [fp-eots-pk-hex]", Aliases: []string{"rfp"}, Short: "Register a created finality provider to Babylon.", Example: fmt.Sprintf(`fpd register-finality-provider --daemon-address %s`, defaultFpdDaemonAddress), @@ -305,7 +305,7 @@ func runCommandRegisterFP(cmd *cobra.Command, args []string) error { // CommandAddFinalitySig returns the add-finality-sig command by connecting to the fpd daemon. func CommandAddFinalitySig() *cobra.Command { var cmd = &cobra.Command{ - Use: "add-finality-sig [fp-pk-btc-hex] [block-height]", + Use: "add-finality-sig [fp-eots-pk-hex] [block-height]", Aliases: []string{"afs"}, Short: "Send a finality signature to the consumer chain. This command should only be used for presentation/testing purposes", Example: fmt.Sprintf(`fpd add-finality-sig --daemon-address %s`, defaultFpdDaemonAddress), diff --git a/finality-provider/cmd/fpd/daemon/export.go b/finality-provider/cmd/fpd/daemon/export.go index f9d83677..c601aa6a 100644 --- a/finality-provider/cmd/fpd/daemon/export.go +++ b/finality-provider/cmd/fpd/daemon/export.go @@ -6,16 +6,16 @@ import ( "fmt" "cosmossdk.io/math" - fpcmd "github.com/babylonchain/finality-provider/finality-provider/cmd" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - dc "github.com/babylonchain/finality-provider/finality-provider/service/client" + fpcmd "github.com/babylonlabs-io/finality-provider/finality-provider/cmd" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + dc "github.com/babylonlabs-io/finality-provider/finality-provider/service/client" "github.com/cosmos/cosmos-sdk/client" sdkflags "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/spf13/cobra" - bbn "github.com/babylonchain/babylon/types" - btcstktypes "github.com/babylonchain/babylon/x/btcstaking/types" + bbn "github.com/babylonlabs-io/babylon/types" + btcstktypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" ) // FinalityProviderSigned wraps the finality provider by adding the @@ -30,9 +30,9 @@ type FinalityProviderSigned struct { // CommandExportFP returns the export-finality-provider command by loading the fp and export the data. func CommandExportFP() *cobra.Command { var cmd = &cobra.Command{ - Use: "export-finality-provider [fp-btc-pk-hex]", + Use: "export-finality-provider [fp-eots-pk-hex]", Aliases: []string{"exfp"}, - Short: "It exports the finality provider by the given BTC public key.", + Short: "It exports the finality provider by the given EOTS public key.", Example: fmt.Sprintf(`fpd export-finality-provider --daemon-address %s`, defaultFpdDaemonAddress), Args: cobra.NoArgs, RunE: fpcmd.RunEWithClientCtx(runCommandExportFP), diff --git a/finality-provider/cmd/fpd/daemon/flags.go b/finality-provider/cmd/fpd/daemon/flags.go index 847a2997..0debceb2 100644 --- a/finality-provider/cmd/fpd/daemon/flags.go +++ b/finality-provider/cmd/fpd/daemon/flags.go @@ -2,7 +2,7 @@ package daemon const ( forceFlag = "force" - fpPkFlag = "btc-pk" + fpEotsPkFlag = "eots-pk" rpcListenerFlag = "rpc-listener" fpdDaemonAddressFlag = "daemon-address" keyNameFlag = "key-name" diff --git a/finality-provider/cmd/fpd/daemon/init.go b/finality-provider/cmd/fpd/daemon/init.go index 723f56ac..3ccea218 100644 --- a/finality-provider/cmd/fpd/daemon/init.go +++ b/finality-provider/cmd/fpd/daemon/init.go @@ -8,9 +8,9 @@ import ( "github.com/jessevdk/go-flags" "github.com/spf13/cobra" - fpcmd "github.com/babylonchain/finality-provider/finality-provider/cmd" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/util" + fpcmd "github.com/babylonlabs-io/finality-provider/finality-provider/cmd" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/util" ) // CommandInit returns the init command of fpd daemon that starts the config dir. @@ -36,7 +36,7 @@ func runInitCmd(ctx client.Context, cmd *cobra.Command, args []string) error { homePath = util.CleanAndExpandPath(homePath) force, err := cmd.Flags().GetBool(forceFlag) if err != nil { - return fmt.Errorf("failed to read flag %s: %w", fpPkFlag, err) + return fmt.Errorf("failed to read flag %s: %w", fpEotsPkFlag, err) } if util.FileExists(homePath) && !force { diff --git a/finality-provider/cmd/fpd/daemon/keys.go b/finality-provider/cmd/fpd/daemon/keys.go index 483e68fb..dbc9fbec 100644 --- a/finality-provider/cmd/fpd/daemon/keys.go +++ b/finality-provider/cmd/fpd/daemon/keys.go @@ -3,8 +3,8 @@ package daemon import ( "strings" - helper "github.com/babylonchain/finality-provider/finality-provider/cmd" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" + helper "github.com/babylonlabs-io/finality-provider/finality-provider/cmd" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" "github.com/cosmos/cosmos-sdk/client" sdkflags "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/keys" diff --git a/finality-provider/cmd/fpd/daemon/start.go b/finality-provider/cmd/fpd/daemon/start.go index 48a30ac3..9a0593cd 100644 --- a/finality-provider/cmd/fpd/daemon/start.go +++ b/finality-provider/cmd/fpd/daemon/start.go @@ -5,18 +5,18 @@ import ( "net" "path/filepath" - "github.com/babylonchain/babylon/types" + "github.com/babylonlabs-io/babylon/types" "github.com/btcsuite/btcwallet/walletdb" "github.com/cosmos/cosmos-sdk/client" "github.com/lightningnetwork/lnd/signal" "github.com/spf13/cobra" "go.uber.org/zap" - fpcmd "github.com/babylonchain/finality-provider/finality-provider/cmd" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/finality-provider/service" - "github.com/babylonchain/finality-provider/log" - "github.com/babylonchain/finality-provider/util" + fpcmd "github.com/babylonlabs-io/finality-provider/finality-provider/cmd" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/service" + "github.com/babylonlabs-io/finality-provider/log" + "github.com/babylonlabs-io/finality-provider/util" ) // CommandStart returns the start command of fpd daemon. @@ -29,7 +29,7 @@ func CommandStart() *cobra.Command { Args: cobra.NoArgs, RunE: fpcmd.RunEWithClientCtx(runStartCmd), } - cmd.Flags().String(fpPkFlag, "", "The public key of the finality-provider to start") + cmd.Flags().String(fpEotsPkFlag, "", "The EOTS public key of the finality-provider to start") cmd.Flags().String(passphraseFlag, "", "The pass phrase used to decrypt the private key") cmd.Flags().String(rpcListenerFlag, "", "The address that the RPC server listens to") return cmd @@ -43,9 +43,9 @@ func runStartCmd(ctx client.Context, cmd *cobra.Command, args []string) error { homePath = util.CleanAndExpandPath(homePath) flags := cmd.Flags() - fpStr, err := flags.GetString(fpPkFlag) + fpStr, err := flags.GetString(fpEotsPkFlag) if err != nil { - return fmt.Errorf("failed to read flag %s: %w", fpPkFlag, err) + return fmt.Errorf("failed to read flag %s: %w", fpEotsPkFlag, err) } rpcListener, err := flags.GetString(rpcListenerFlag) diff --git a/finality-provider/cmd/fpd/daemon/tx.go b/finality-provider/cmd/fpd/daemon/tx.go index 2c8ddbff..f13339d2 100644 --- a/finality-provider/cmd/fpd/daemon/tx.go +++ b/finality-provider/cmd/fpd/daemon/tx.go @@ -1,10 +1,16 @@ package daemon import ( + "fmt" + "strings" + "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" - btcstakingcli "github.com/babylonchain/babylon/x/btcstaking/client/cli" + btcstakingcli "github.com/babylonlabs-io/babylon/x/btcstaking/client/cli" + btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" + sdk "github.com/cosmos/cosmos-sdk/types" + authclient "github.com/cosmos/cosmos-sdk/x/auth/client" authcli "github.com/cosmos/cosmos-sdk/x/auth/client/cli" ) @@ -21,7 +27,91 @@ func CommandTxs() *cobra.Command { cmd.AddCommand( authcli.GetSignCommand(), btcstakingcli.NewCreateFinalityProviderCmd(), + NewValidateSignedFinalityProviderCmd(), ) return cmd } + +// NewValidateSignedFinalityProviderCmd returns the command line for +// tx validate-signed-finality-provider +func NewValidateSignedFinalityProviderCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "validate-signed-finality-provider [file_path_signed_msg]", + Args: cobra.ExactArgs(1), + Short: "Validates the signed MsgCreateFinalityProvider", + Long: strings.TrimSpace(` + Loads the signed MsgCreateFinalityProvider and checks if the basic + information is satisfied and the Proof of Possession is valid against the + signer of the msg and the finality provider's BTC public key + `), + Example: strings.TrimSpace( + `fdp tx validate-signed-finality-provider ./path/to/signed-msg.json`, + ), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + stdTx, err := authclient.ReadTxFromFile(ctx, args[0]) + if err != nil { + return err + } + + msgsV2, err := stdTx.GetMsgsV2() + if err != nil { + return err + } + + msgs := stdTx.GetMsgs() + if len(msgs) == 0 { + return fmt.Errorf("invalid msg, there is no msg inside %s file", args[0]) + } + + for i, sdkMsg := range msgs { + msgV2 := msgsV2[i] + msg, ok := sdkMsg.(*btcstakingtypes.MsgCreateFinalityProvider) + if !ok { + return fmt.Errorf("unable to parse %+v to MsgCreateFinalityProvider", msg) + } + + if err := msg.ValidateBasic(); err != nil { + return fmt.Errorf("error validating basic msg: %w", err) + } + + signers, err := ctx.Codec.GetMsgV2Signers(msgV2) + if err != nil { + return fmt.Errorf("failed to get signers from msg %+v: %w", msg, err) + } + + if len(signers) == 0 { + return fmt.Errorf("no signer at msg %+v", msgV2) + } + + signerAddrStr, err := ctx.Codec.InterfaceRegistry().SigningContext().AddressCodec().BytesToString(signers[0]) + if err != nil { + return err + } + + signerBbnAddr, err := sdk.AccAddressFromBech32(signerAddrStr) + if err != nil { + return fmt.Errorf("invalid signer address %s, please sign with a valid bbn address, err: %w", signerAddrStr, err) + } + + if !strings.EqualFold(msg.Addr, signerAddrStr) { + return fmt.Errorf("signer address: %s is different from finality provider address: %s", signerAddrStr, msg.Addr) + } + + if err := msg.Pop.VerifyBIP340(signerBbnAddr, msg.BtcPk); err != nil { + return fmt.Errorf("invalid Proof of Possession with signer %s: %w", signerBbnAddr.String(), err) + } + } + + _, err = cmd.OutOrStdout().Write([]byte("The signed MsgCreateFinalityProvider is valid")) + return err + }, + } + + return cmd +} diff --git a/finality-provider/cmd/fpd/daemon/tx_test.go b/finality-provider/cmd/fpd/daemon/tx_test.go new file mode 100644 index 00000000..9460ea3b --- /dev/null +++ b/finality-provider/cmd/fpd/daemon/tx_test.go @@ -0,0 +1,172 @@ +package daemon_test + +import ( + "bytes" + "encoding/json" + "fmt" + "math/rand" + "os" + "path/filepath" + "testing" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/keys" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/spf13/cobra" + + "github.com/stretchr/testify/require" + + "github.com/babylonlabs-io/babylon/app" + "github.com/babylonlabs-io/babylon/testutil/datagen" + bbn "github.com/babylonlabs-io/babylon/types" + + btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" + fpcmd "github.com/babylonlabs-io/finality-provider/finality-provider/cmd" + "github.com/babylonlabs-io/finality-provider/finality-provider/cmd/fpd/daemon" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/testutil" +) + +func FuzzNewValidateSignedFinalityProviderCmd(f *testing.F) { + testutil.AddRandomSeedsToFuzzer(f, 10) + tempApp := app.NewTmpBabylonApp() + + f.Fuzz(func(t *testing.T, seed int64) { + r := rand.New(rand.NewSource(seed)) + + rootCmdBuff := new(bytes.Buffer) + root := rootCmd(rootCmdBuff) + + tDir := t.TempDir() + tempHome := filepath.Join(tDir, "homefpnew") + homeFlag := fmt.Sprintf("--home=%s", tempHome) + + exec(t, root, rootCmdBuff, "init", homeFlag) + + keyName := datagen.GenRandomHexStr(r, 5) + kbt := "--keyring-backend=test" + + keyOut := execUnmarshal[keys.KeyOutput](t, root, rootCmdBuff, "keys", "add", keyName, homeFlag, kbt) + require.Equal(t, keyName, keyOut.Name) + + fpAddr, err := sdk.AccAddressFromBech32(keyOut.Address) + require.NoError(t, err) + + btcSK, btcPK, err := datagen.GenRandomBTCKeyPair(r) + require.NoError(t, err) + + pop, err := btcstakingtypes.NewPoPBTC(fpAddr, btcSK) + require.NoError(t, err) + + popHex, err := pop.ToHexStr() + require.NoError(t, err) + + bip340PK := bbn.NewBIP340PubKeyFromBTCPK(btcPK) + + _, unsignedMsgStr := exec( + t, root, rootCmdBuff, "tx", "create-finality-provider", bip340PK.MarshalHex(), popHex, homeFlag, kbt, + fmt.Sprintf("--from=%s", keyName), "--generate-only", "--gas-prices=10ubbn", + "--commission-rate=0.05", "--moniker='niceFP'", "--identity=x", "--website=test.com", + "--security-contact=niceEmail", "--details='no Details'", + ) + + tx, err := tempApp.TxConfig().TxJSONDecoder()([]byte(unsignedMsgStr)) + require.NoError(t, err) + + txMsgs := tx.GetMsgs() + require.Len(t, txMsgs, 1) + sdkMsg := txMsgs[0] + + msg, ok := sdkMsg.(*btcstakingtypes.MsgCreateFinalityProvider) + require.True(t, ok) + require.Equal(t, msg.Addr, fpAddr.String()) + + // sends the unsigned msg to a file to be signed. + unsignedMsgFilePath := writeToTempFile(t, r, unsignedMsgStr) + + _, signedMsgStr := exec(t, root, rootCmdBuff, "tx", "sign", unsignedMsgFilePath, homeFlag, kbt, + fmt.Sprintf("--from=%s", keyName), "--offline", "--account-number=0", "--sequence=0", + ) + // sends the signed msg to a file. + signedMsgFilePath := writeToTempFile(t, r, signedMsgStr) + + tx, err = tempApp.TxConfig().TxJSONDecoder()([]byte(signedMsgStr)) + require.NoError(t, err) + + msgSigned := tx.GetMsgs()[0].(*btcstakingtypes.MsgCreateFinalityProvider) + require.Equal(t, msgSigned.Addr, fpAddr.String()) + + // executes the verification. + _, outputValidate := exec(t, root, rootCmdBuff, "tx", "validate-signed-finality-provider", signedMsgFilePath, homeFlag) + require.Equal(t, "The signed MsgCreateFinalityProvider is valid", outputValidate) + }) +} + +func rootCmd(outputBuff *bytes.Buffer) *cobra.Command { + cmd := &cobra.Command{ + Use: "fpd", + PersistentPreRunE: fpcmd.PersistClientCtx(client.Context{}.WithOutput(outputBuff)), + } + cmd.PersistentFlags().String(flags.FlagHome, fpcfg.DefaultFpdDir, "The application home directory") + + cmd.AddCommand( + daemon.CommandInit(), daemon.CommandStart(), daemon.CommandKeys(), + daemon.CommandGetDaemonInfo(), daemon.CommandCreateFP(), daemon.CommandLsFP(), + daemon.CommandInfoFP(), daemon.CommandRegisterFP(), daemon.CommandAddFinalitySig(), + daemon.CommandExportFP(), daemon.CommandTxs(), + ) + + return cmd +} + +// exec executes a command based on the cmd passed, the args should only search for subcommands, not parent commands +// it also receives rootCmdBuf as a parameter, which is the buff set in the cmd context standard output for the commands +// that do print to the context stdout instead of the root stdout. +func exec(t *testing.T, root *cobra.Command, rootCmdBuf *bytes.Buffer, args ...string) (c *cobra.Command, output string) { + buf := new(bytes.Buffer) + root.SetOut(buf) + root.SetErr(buf) + root.SetArgs(args) + + c, err := root.ExecuteC() + require.NoError(t, err) + + outStr := buf.String() + if len(outStr) > 0 { + return c, outStr + } + + _, err = buf.Write(rootCmdBuf.Bytes()) + require.NoError(t, err) + + return c, buf.String() +} + +func execUnmarshal[structure any](t *testing.T, root *cobra.Command, rootCmdBuf *bytes.Buffer, args ...string) (output structure) { + var typed structure + _, outStr := exec(t, root, rootCmdBuf, args...) + + // helpfull for debug + // fmt.Printf("\nargs %s", strings.Join(args, " ")) + // fmt.Printf("\nout %s", outStr) + + err := json.Unmarshal([]byte(outStr), &typed) + require.NoError(t, err) + + return typed +} + +func writeToTempFile(t *testing.T, r *rand.Rand, str string) (outputFilePath string) { + outputFilePath = filepath.Join(t.TempDir(), datagen.GenRandomHexStr(r, 5)) + + outPutFile, err := os.Create(outputFilePath) + require.NoError(t, err) + defer outPutFile.Close() + + _, err = outPutFile.WriteString(str) + require.NoError(t, err) + + return outputFilePath +} diff --git a/finality-provider/cmd/fpd/main.go b/finality-provider/cmd/fpd/main.go index f549398a..b898de30 100644 --- a/finality-provider/cmd/fpd/main.go +++ b/finality-provider/cmd/fpd/main.go @@ -8,9 +8,9 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - fpcmd "github.com/babylonchain/finality-provider/finality-provider/cmd" - "github.com/babylonchain/finality-provider/finality-provider/cmd/fpd/daemon" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" + fpcmd "github.com/babylonlabs-io/finality-provider/finality-provider/cmd" + "github.com/babylonlabs-io/finality-provider/finality-provider/cmd/fpd/daemon" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" ) // NewRootCmd creates a new root command for fpd. It is called once in the main function. diff --git a/finality-provider/config/babylon.go b/finality-provider/config/babylon.go index 3fea0e9c..18b601a5 100644 --- a/finality-provider/config/babylon.go +++ b/finality-provider/config/babylon.go @@ -3,7 +3,7 @@ package config import ( "time" - bbncfg "github.com/babylonchain/babylon/client/config" + bbncfg "github.com/babylonlabs-io/babylon/client/config" ) type BBNConfig struct { diff --git a/finality-provider/config/config.go b/finality-provider/config/config.go index a662e8a3..2afe7b53 100644 --- a/finality-provider/config/config.go +++ b/finality-provider/config/config.go @@ -12,9 +12,9 @@ import ( "github.com/jessevdk/go-flags" "go.uber.org/zap/zapcore" - eotscfg "github.com/babylonchain/finality-provider/eotsmanager/config" - "github.com/babylonchain/finality-provider/metrics" - "github.com/babylonchain/finality-provider/util" + eotscfg "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + "github.com/babylonlabs-io/finality-provider/metrics" + "github.com/babylonlabs-io/finality-provider/util" ) const ( @@ -187,22 +187,13 @@ func (cfg *Config) Validate() error { // Multiple networks can't be selected simultaneously. Count number of // network flags passed; assign active network params // while we're at it. - switch cfg.BitcoinNetwork { - case "mainnet": - cfg.BTCNetParams = chaincfg.MainNetParams - case "testnet": - cfg.BTCNetParams = chaincfg.TestNet3Params - case "regtest": - cfg.BTCNetParams = chaincfg.RegressionNetParams - case "simnet": - cfg.BTCNetParams = chaincfg.SimNetParams - case "signet": - cfg.BTCNetParams = chaincfg.SigNetParams - default: - return fmt.Errorf("invalid network: %v", cfg.BitcoinNetwork) + btcNetConfig, err := NetParamsBTC(cfg.BitcoinNetwork) + if err != nil { + return err } + cfg.BTCNetParams = btcNetConfig - _, err := net.ResolveTCPAddr("tcp", cfg.RpcListener) + _, err = net.ResolveTCPAddr("tcp", cfg.RpcListener) if err != nil { return fmt.Errorf("invalid RPC listener address %s, %w", cfg.RpcListener, err) } @@ -218,3 +209,21 @@ func (cfg *Config) Validate() error { // All good, return the sanitized result. return nil } + +// NetParamsBTC parses the BTC net params from config. +func NetParamsBTC(btcNet string) (p chaincfg.Params, err error) { + switch btcNet { + case "mainnet": + return chaincfg.MainNetParams, nil + case "testnet": + return chaincfg.TestNet3Params, nil + case "regtest": + return chaincfg.RegressionNetParams, nil + case "simnet": + return chaincfg.SimNetParams, nil + case "signet": + return chaincfg.SigNetParams, nil + default: + return p, fmt.Errorf("invalid network: %v", btcNet) + } +} diff --git a/finality-provider/config/cosmwasm.go b/finality-provider/config/cosmwasm.go index 36f911fa..464ad23d 100644 --- a/finality-provider/config/cosmwasm.go +++ b/finality-provider/config/cosmwasm.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/babylonchain/finality-provider/cosmwasmclient/config" + "github.com/babylonlabs-io/finality-provider/cosmwasmclient/config" "github.com/cosmos/btcutil/bech32" ) diff --git a/finality-provider/config/opstackl2.go b/finality-provider/config/opstackl2.go index 6408c7cb..17aa510c 100644 --- a/finality-provider/config/opstackl2.go +++ b/finality-provider/config/opstackl2.go @@ -6,7 +6,7 @@ import ( "strings" "time" - cwcfg "github.com/babylonchain/finality-provider/cosmwasmclient/config" + cwcfg "github.com/babylonlabs-io/finality-provider/cosmwasmclient/config" "github.com/cosmos/btcutil/bech32" ) diff --git a/finality-provider/proto/buf.yaml b/finality-provider/proto/buf.yaml index baa1a86c..efc77370 100644 --- a/finality-provider/proto/buf.yaml +++ b/finality-provider/proto/buf.yaml @@ -1,5 +1,5 @@ version: v1 -name: buf.build/babylonchain/btc-finality-provider +name: buf.build/babylonlabs-io/finality-provider deps: - buf.build/cosmos/cosmos-sdk:v0.50.0 - buf.build/cosmos/cosmos-proto:1935555c206d4afb9e94615dfd0fad31 diff --git a/finality-provider/proto/finality_providers.go b/finality-provider/proto/finality_providers.go index 2b573a88..fefa8111 100644 --- a/finality-provider/proto/finality_providers.go +++ b/finality-provider/proto/finality_providers.go @@ -3,7 +3,7 @@ package proto import ( "fmt" - bbn "github.com/babylonchain/babylon/types" + bbn "github.com/babylonlabs-io/babylon/types" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/cosmos/cosmos-sdk/x/staking/types" diff --git a/finality-provider/proto/finality_providers.pb.go b/finality-provider/proto/finality_providers.pb.go index 9ec5dd2c..e36c1b1f 100644 --- a/finality-provider/proto/finality_providers.pb.go +++ b/finality-provider/proto/finality_providers.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: finality_providers.proto @@ -195,7 +195,7 @@ type CreateFinalityProviderRequest struct { Passphrase string `protobuf:"bytes,2,opt,name=passphrase,proto3" json:"passphrase,omitempty"` // hd_path is the hd path for private key derivation HdPath string `protobuf:"bytes,3,opt,name=hd_path,json=hdPath,proto3" json:"hd_path,omitempty"` - // chain_id is the identifier of the consumer chain that the finality provider connected to + // chain_id is the identifier of the consumer chain that the finality provider is connected to ChainId string `protobuf:"bytes,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // description defines the description terms for the finality provider Description []byte `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` @@ -1500,11 +1500,11 @@ var file_finality_providers_proto_rawDesc = []byte{ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, - 0x62, 0x79, 0x6c, 0x6f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2f, 0x66, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x74, 0x79, 0x2d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x66, 0x69, 0x6e, - 0x61, 0x6c, 0x69, 0x74, 0x79, 0x2d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, + 0x62, 0x79, 0x6c, 0x6f, 0x6e, 0x6c, 0x61, 0x62, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x66, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x74, 0x79, 0x2d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x66, + 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x2d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/finality-provider/proto/finality_providers.proto b/finality-provider/proto/finality_providers.proto index 7a0f9be3..73082b49 100644 --- a/finality-provider/proto/finality_providers.proto +++ b/finality-provider/proto/finality_providers.proto @@ -6,7 +6,7 @@ import "gogoproto/gogo.proto"; import "cosmos/staking/v1beta1/staking.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/babylonchain/finality-provider/finality-provider/proto"; +option go_package = "github.com/babylonlabs-io/finality-provider/finality-provider/proto"; service FinalityProviders { // GetInfo returns the information of the daemon diff --git a/finality-provider/proto/finality_providers_grpc.pb.go b/finality-provider/proto/finality_providers_grpc.pb.go index e2d7bdca..6480c381 100644 --- a/finality-provider/proto/finality_providers_grpc.pb.go +++ b/finality-provider/proto/finality_providers_grpc.pb.go @@ -1,8 +1,4 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: finality_providers.proto package proto @@ -18,16 +14,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - FinalityProviders_GetInfo_FullMethodName = "/proto.FinalityProviders/GetInfo" - FinalityProviders_CreateFinalityProvider_FullMethodName = "/proto.FinalityProviders/CreateFinalityProvider" - FinalityProviders_RegisterFinalityProvider_FullMethodName = "/proto.FinalityProviders/RegisterFinalityProvider" - FinalityProviders_AddFinalitySignature_FullMethodName = "/proto.FinalityProviders/AddFinalitySignature" - FinalityProviders_QueryFinalityProvider_FullMethodName = "/proto.FinalityProviders/QueryFinalityProvider" - FinalityProviders_QueryFinalityProviderList_FullMethodName = "/proto.FinalityProviders/QueryFinalityProviderList" - FinalityProviders_SignMessageFromChainKey_FullMethodName = "/proto.FinalityProviders/SignMessageFromChainKey" -) - // FinalityProvidersClient is the client API for FinalityProviders service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -60,7 +46,7 @@ func NewFinalityProvidersClient(cc grpc.ClientConnInterface) FinalityProvidersCl func (c *finalityProvidersClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) { out := new(GetInfoResponse) - err := c.cc.Invoke(ctx, FinalityProviders_GetInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.FinalityProviders/GetInfo", in, out, opts...) if err != nil { return nil, err } @@ -69,7 +55,7 @@ func (c *finalityProvidersClient) GetInfo(ctx context.Context, in *GetInfoReques func (c *finalityProvidersClient) CreateFinalityProvider(ctx context.Context, in *CreateFinalityProviderRequest, opts ...grpc.CallOption) (*CreateFinalityProviderResponse, error) { out := new(CreateFinalityProviderResponse) - err := c.cc.Invoke(ctx, FinalityProviders_CreateFinalityProvider_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.FinalityProviders/CreateFinalityProvider", in, out, opts...) if err != nil { return nil, err } @@ -78,7 +64,7 @@ func (c *finalityProvidersClient) CreateFinalityProvider(ctx context.Context, in func (c *finalityProvidersClient) RegisterFinalityProvider(ctx context.Context, in *RegisterFinalityProviderRequest, opts ...grpc.CallOption) (*RegisterFinalityProviderResponse, error) { out := new(RegisterFinalityProviderResponse) - err := c.cc.Invoke(ctx, FinalityProviders_RegisterFinalityProvider_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.FinalityProviders/RegisterFinalityProvider", in, out, opts...) if err != nil { return nil, err } @@ -87,7 +73,7 @@ func (c *finalityProvidersClient) RegisterFinalityProvider(ctx context.Context, func (c *finalityProvidersClient) AddFinalitySignature(ctx context.Context, in *AddFinalitySignatureRequest, opts ...grpc.CallOption) (*AddFinalitySignatureResponse, error) { out := new(AddFinalitySignatureResponse) - err := c.cc.Invoke(ctx, FinalityProviders_AddFinalitySignature_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.FinalityProviders/AddFinalitySignature", in, out, opts...) if err != nil { return nil, err } @@ -96,7 +82,7 @@ func (c *finalityProvidersClient) AddFinalitySignature(ctx context.Context, in * func (c *finalityProvidersClient) QueryFinalityProvider(ctx context.Context, in *QueryFinalityProviderRequest, opts ...grpc.CallOption) (*QueryFinalityProviderResponse, error) { out := new(QueryFinalityProviderResponse) - err := c.cc.Invoke(ctx, FinalityProviders_QueryFinalityProvider_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.FinalityProviders/QueryFinalityProvider", in, out, opts...) if err != nil { return nil, err } @@ -105,7 +91,7 @@ func (c *finalityProvidersClient) QueryFinalityProvider(ctx context.Context, in func (c *finalityProvidersClient) QueryFinalityProviderList(ctx context.Context, in *QueryFinalityProviderListRequest, opts ...grpc.CallOption) (*QueryFinalityProviderListResponse, error) { out := new(QueryFinalityProviderListResponse) - err := c.cc.Invoke(ctx, FinalityProviders_QueryFinalityProviderList_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.FinalityProviders/QueryFinalityProviderList", in, out, opts...) if err != nil { return nil, err } @@ -114,7 +100,7 @@ func (c *finalityProvidersClient) QueryFinalityProviderList(ctx context.Context, func (c *finalityProvidersClient) SignMessageFromChainKey(ctx context.Context, in *SignMessageFromChainKeyRequest, opts ...grpc.CallOption) (*SignMessageFromChainKeyResponse, error) { out := new(SignMessageFromChainKeyResponse) - err := c.cc.Invoke(ctx, FinalityProviders_SignMessageFromChainKey_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/proto.FinalityProviders/SignMessageFromChainKey", in, out, opts...) if err != nil { return nil, err } @@ -192,7 +178,7 @@ func _FinalityProviders_GetInfo_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: FinalityProviders_GetInfo_FullMethodName, + FullMethod: "/proto.FinalityProviders/GetInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinalityProvidersServer).GetInfo(ctx, req.(*GetInfoRequest)) @@ -210,7 +196,7 @@ func _FinalityProviders_CreateFinalityProvider_Handler(srv interface{}, ctx cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: FinalityProviders_CreateFinalityProvider_FullMethodName, + FullMethod: "/proto.FinalityProviders/CreateFinalityProvider", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinalityProvidersServer).CreateFinalityProvider(ctx, req.(*CreateFinalityProviderRequest)) @@ -228,7 +214,7 @@ func _FinalityProviders_RegisterFinalityProvider_Handler(srv interface{}, ctx co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: FinalityProviders_RegisterFinalityProvider_FullMethodName, + FullMethod: "/proto.FinalityProviders/RegisterFinalityProvider", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinalityProvidersServer).RegisterFinalityProvider(ctx, req.(*RegisterFinalityProviderRequest)) @@ -246,7 +232,7 @@ func _FinalityProviders_AddFinalitySignature_Handler(srv interface{}, ctx contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: FinalityProviders_AddFinalitySignature_FullMethodName, + FullMethod: "/proto.FinalityProviders/AddFinalitySignature", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinalityProvidersServer).AddFinalitySignature(ctx, req.(*AddFinalitySignatureRequest)) @@ -264,7 +250,7 @@ func _FinalityProviders_QueryFinalityProvider_Handler(srv interface{}, ctx conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: FinalityProviders_QueryFinalityProvider_FullMethodName, + FullMethod: "/proto.FinalityProviders/QueryFinalityProvider", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinalityProvidersServer).QueryFinalityProvider(ctx, req.(*QueryFinalityProviderRequest)) @@ -282,7 +268,7 @@ func _FinalityProviders_QueryFinalityProviderList_Handler(srv interface{}, ctx c } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: FinalityProviders_QueryFinalityProviderList_FullMethodName, + FullMethod: "/proto.FinalityProviders/QueryFinalityProviderList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinalityProvidersServer).QueryFinalityProviderList(ctx, req.(*QueryFinalityProviderListRequest)) @@ -300,7 +286,7 @@ func _FinalityProviders_SignMessageFromChainKey_Handler(srv interface{}, ctx con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: FinalityProviders_SignMessageFromChainKey_FullMethodName, + FullMethod: "/proto.FinalityProviders/SignMessageFromChainKey", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FinalityProvidersServer).SignMessageFromChainKey(ctx, req.(*SignMessageFromChainKeyRequest)) diff --git a/finality-provider/service/app.go b/finality-provider/service/app.go index edd3b2d6..e0bcf68f 100644 --- a/finality-provider/service/app.go +++ b/finality-provider/service/app.go @@ -7,8 +7,8 @@ import ( "time" sdkmath "cosmossdk.io/math" - bbntypes "github.com/babylonchain/babylon/types" - bstypes "github.com/babylonchain/babylon/x/btcstaking/types" + bbntypes "github.com/babylonlabs-io/babylon/types" + bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" "github.com/btcsuite/btcd/btcec/v2" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -17,16 +17,16 @@ import ( "github.com/lightningnetwork/lnd/kvdb" "go.uber.org/zap" - fpcc "github.com/babylonchain/finality-provider/clientcontroller" - ccapi "github.com/babylonchain/finality-provider/clientcontroller/api" - "github.com/babylonchain/finality-provider/eotsmanager" - "github.com/babylonchain/finality-provider/eotsmanager/client" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/finality-provider/proto" - "github.com/babylonchain/finality-provider/finality-provider/store" - fpkr "github.com/babylonchain/finality-provider/keyring" - "github.com/babylonchain/finality-provider/metrics" - "github.com/babylonchain/finality-provider/types" + fpcc "github.com/babylonlabs-io/finality-provider/clientcontroller" + ccapi "github.com/babylonlabs-io/finality-provider/clientcontroller/api" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + "github.com/babylonlabs-io/finality-provider/eotsmanager/client" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" + "github.com/babylonlabs-io/finality-provider/finality-provider/store" + fpkr "github.com/babylonlabs-io/finality-provider/keyring" + "github.com/babylonlabs-io/finality-provider/metrics" + "github.com/babylonlabs-io/finality-provider/types" ) type FinalityProviderApp struct { diff --git a/finality-provider/service/app_test.go b/finality-provider/service/app_test.go index 0ea4c505..04da235a 100644 --- a/finality-provider/service/app_test.go +++ b/finality-provider/service/app_test.go @@ -6,19 +6,19 @@ import ( "path/filepath" "testing" - bbntypes "github.com/babylonchain/babylon/types" - bstypes "github.com/babylonchain/babylon/x/btcstaking/types" + bbntypes "github.com/babylonlabs-io/babylon/types" + bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "go.uber.org/zap" - "github.com/babylonchain/finality-provider/eotsmanager" - eotscfg "github.com/babylonchain/finality-provider/eotsmanager/config" - "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/finality-provider/proto" - "github.com/babylonchain/finality-provider/finality-provider/service" - "github.com/babylonchain/finality-provider/testutil" - "github.com/babylonchain/finality-provider/types" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + eotscfg "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" + "github.com/babylonlabs-io/finality-provider/finality-provider/service" + "github.com/babylonlabs-io/finality-provider/testutil" + "github.com/babylonlabs-io/finality-provider/types" ) var ( diff --git a/finality-provider/service/chain_poller.go b/finality-provider/service/chain_poller.go index 9ac34a5d..ec969ffe 100644 --- a/finality-provider/service/chain_poller.go +++ b/finality-provider/service/chain_poller.go @@ -9,10 +9,10 @@ import ( "go.uber.org/atomic" "go.uber.org/zap" - ccapi "github.com/babylonchain/finality-provider/clientcontroller/api" - cfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/metrics" - "github.com/babylonchain/finality-provider/types" + ccapi "github.com/babylonlabs-io/finality-provider/clientcontroller/api" + cfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/metrics" + "github.com/babylonlabs-io/finality-provider/types" ) var ( diff --git a/finality-provider/service/chain_poller_test.go b/finality-provider/service/chain_poller_test.go index 6d777f2d..4ba4d0fd 100644 --- a/finality-provider/service/chain_poller_test.go +++ b/finality-provider/service/chain_poller_test.go @@ -10,12 +10,12 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/finality-provider/service" - "github.com/babylonchain/finality-provider/metrics" - "github.com/babylonchain/finality-provider/testutil" - "github.com/babylonchain/finality-provider/testutil/mocks" - "github.com/babylonchain/finality-provider/types" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/service" + "github.com/babylonlabs-io/finality-provider/metrics" + "github.com/babylonlabs-io/finality-provider/testutil" + "github.com/babylonlabs-io/finality-provider/testutil/mocks" + "github.com/babylonlabs-io/finality-provider/types" ) // FuzzChainPoller_Start tests the poller polling blocks diff --git a/finality-provider/service/client/rpcclient.go b/finality-provider/service/client/rpcclient.go index b14b528d..06a4a1aa 100644 --- a/finality-provider/service/client/rpcclient.go +++ b/finality-provider/service/client/rpcclient.go @@ -5,12 +5,12 @@ import ( "fmt" sdkmath "cosmossdk.io/math" - bbntypes "github.com/babylonchain/babylon/types" + bbntypes "github.com/babylonlabs-io/babylon/types" "github.com/cosmos/cosmos-sdk/x/staking/types" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - "github.com/babylonchain/finality-provider/finality-provider/proto" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" ) type FinalityProviderServiceGRpcClient struct { diff --git a/finality-provider/service/eots_manager_adapter.go b/finality-provider/service/eots_manager_adapter.go index 765f7e1d..e5c20dad 100644 --- a/finality-provider/service/eots_manager_adapter.go +++ b/finality-provider/service/eots_manager_adapter.go @@ -3,8 +3,8 @@ package service import ( "fmt" - bbntypes "github.com/babylonchain/babylon/types" - "github.com/babylonchain/finality-provider/types" + bbntypes "github.com/babylonlabs-io/babylon/types" + "github.com/babylonlabs-io/finality-provider/types" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/cometbft/cometbft/crypto/tmhash" diff --git a/finality-provider/service/fastsync.go b/finality-provider/service/fastsync.go index 0e1c6a52..85871297 100644 --- a/finality-provider/service/fastsync.go +++ b/finality-provider/service/fastsync.go @@ -5,7 +5,7 @@ import ( "go.uber.org/zap" - "github.com/babylonchain/finality-provider/types" + "github.com/babylonlabs-io/finality-provider/types" ) type FastSyncResult struct { diff --git a/finality-provider/service/fastsync_test.go b/finality-provider/service/fastsync_test.go index ce0750ad..8664a0e7 100644 --- a/finality-provider/service/fastsync_test.go +++ b/finality-provider/service/fastsync_test.go @@ -4,12 +4,12 @@ import ( "math/rand" "testing" - "github.com/babylonchain/babylon/testutil/datagen" + "github.com/babylonlabs-io/babylon/testutil/datagen" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - "github.com/babylonchain/finality-provider/testutil" - "github.com/babylonchain/finality-provider/types" + "github.com/babylonlabs-io/finality-provider/testutil" + "github.com/babylonlabs-io/finality-provider/types" ) // FuzzFastSync_SufficientRandomness tests a case where we have sufficient diff --git a/finality-provider/service/fp_instance.go b/finality-provider/service/fp_instance.go index f33b68df..8b36e77f 100644 --- a/finality-provider/service/fp_instance.go +++ b/finality-provider/service/fp_instance.go @@ -10,23 +10,23 @@ import ( "time" "github.com/avast/retry-go/v4" - bbntypes "github.com/babylonchain/babylon/types" - bstypes "github.com/babylonchain/babylon/x/btcstaking/types" - ftypes "github.com/babylonchain/babylon/x/finality/types" + bbntypes "github.com/babylonlabs-io/babylon/types" + bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" + ftypes "github.com/babylonlabs-io/babylon/x/finality/types" "github.com/btcsuite/btcd/btcec/v2" "github.com/cosmos/relayer/v2/relayer/provider" "github.com/gogo/protobuf/jsonpb" "go.uber.org/atomic" "go.uber.org/zap" - fpcc "github.com/babylonchain/finality-provider/clientcontroller" - ccapi "github.com/babylonchain/finality-provider/clientcontroller/api" - "github.com/babylonchain/finality-provider/eotsmanager" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/finality-provider/proto" - "github.com/babylonchain/finality-provider/finality-provider/store" - "github.com/babylonchain/finality-provider/metrics" - "github.com/babylonchain/finality-provider/types" + fpcc "github.com/babylonlabs-io/finality-provider/clientcontroller" + ccapi "github.com/babylonlabs-io/finality-provider/clientcontroller/api" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" + "github.com/babylonlabs-io/finality-provider/finality-provider/store" + "github.com/babylonlabs-io/finality-provider/metrics" + "github.com/babylonlabs-io/finality-provider/types" ) type FinalityProviderInstance struct { diff --git a/finality-provider/service/fp_instance_test.go b/finality-provider/service/fp_instance_test.go index 63f585ef..07dcd5a4 100644 --- a/finality-provider/service/fp_instance_test.go +++ b/finality-provider/service/fp_instance_test.go @@ -10,16 +10,16 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" - "github.com/babylonchain/babylon/testutil/datagen" - ccapi "github.com/babylonchain/finality-provider/clientcontroller/api" - "github.com/babylonchain/finality-provider/eotsmanager" - eotscfg "github.com/babylonchain/finality-provider/eotsmanager/config" - "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/finality-provider/proto" - "github.com/babylonchain/finality-provider/finality-provider/service" - "github.com/babylonchain/finality-provider/metrics" - "github.com/babylonchain/finality-provider/testutil" - "github.com/babylonchain/finality-provider/types" + "github.com/babylonlabs-io/babylon/testutil/datagen" + ccapi "github.com/babylonlabs-io/finality-provider/clientcontroller/api" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + eotscfg "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" + "github.com/babylonlabs-io/finality-provider/finality-provider/service" + "github.com/babylonlabs-io/finality-provider/metrics" + "github.com/babylonlabs-io/finality-provider/testutil" + "github.com/babylonlabs-io/finality-provider/types" ) func FuzzCommitPubRandList(f *testing.F) { diff --git a/finality-provider/service/fp_manager.go b/finality-provider/service/fp_manager.go index 21b4e4df..1c9f4b8b 100644 --- a/finality-provider/service/fp_manager.go +++ b/finality-provider/service/fp_manager.go @@ -7,17 +7,17 @@ import ( "time" "github.com/avast/retry-go/v4" - bbntypes "github.com/babylonchain/babylon/types" - btcstakingtypes "github.com/babylonchain/babylon/x/btcstaking/types" + bbntypes "github.com/babylonlabs-io/babylon/types" + btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" "go.uber.org/atomic" "go.uber.org/zap" - ccapi "github.com/babylonchain/finality-provider/clientcontroller/api" - "github.com/babylonchain/finality-provider/eotsmanager" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/finality-provider/proto" - "github.com/babylonchain/finality-provider/finality-provider/store" - "github.com/babylonchain/finality-provider/metrics" + ccapi "github.com/babylonlabs-io/finality-provider/clientcontroller/api" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" + "github.com/babylonlabs-io/finality-provider/finality-provider/store" + "github.com/babylonlabs-io/finality-provider/metrics" ) const instanceTerminatingMsg = "terminating the finality-provider instance due to critical error" @@ -249,7 +249,7 @@ func (fpm *FinalityProviderManager) StartAll() error { for _, fp := range storedFps { if fp.Status == proto.FinalityProviderStatus_CREATED || fp.Status == proto.FinalityProviderStatus_SLASHED { fpm.logger.Info("the finality provider cannot be started with status", - zap.String("btc-pk", fp.GetBIP340BTCPK().MarshalHex()), + zap.String("eots-pk", fp.GetBIP340BTCPK().MarshalHex()), zap.String("status", fp.Status.String())) continue } diff --git a/finality-provider/service/fp_manager_test.go b/finality-provider/service/fp_manager_test.go index 8aa8a945..bfa48709 100644 --- a/finality-provider/service/fp_manager_test.go +++ b/finality-provider/service/fp_manager_test.go @@ -8,24 +8,24 @@ import ( "testing" "time" - "github.com/babylonchain/babylon/testutil/datagen" - bbntypes "github.com/babylonchain/babylon/types" + "github.com/babylonlabs-io/babylon/testutil/datagen" + bbntypes "github.com/babylonlabs-io/babylon/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "go.uber.org/zap" - ccapi "github.com/babylonchain/finality-provider/clientcontroller/api" - "github.com/babylonchain/finality-provider/eotsmanager" - eotscfg "github.com/babylonchain/finality-provider/eotsmanager/config" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/finality-provider/proto" - "github.com/babylonchain/finality-provider/finality-provider/service" - fpstore "github.com/babylonchain/finality-provider/finality-provider/store" - "github.com/babylonchain/finality-provider/keyring" - "github.com/babylonchain/finality-provider/metrics" - "github.com/babylonchain/finality-provider/testutil" - "github.com/babylonchain/finality-provider/types" - "github.com/babylonchain/finality-provider/util" + ccapi "github.com/babylonlabs-io/finality-provider/clientcontroller/api" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + eotscfg "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" + "github.com/babylonlabs-io/finality-provider/finality-provider/service" + fpstore "github.com/babylonlabs-io/finality-provider/finality-provider/store" + "github.com/babylonlabs-io/finality-provider/keyring" + "github.com/babylonlabs-io/finality-provider/metrics" + "github.com/babylonlabs-io/finality-provider/testutil" + "github.com/babylonlabs-io/finality-provider/types" + "github.com/babylonlabs-io/finality-provider/util" ) var ( diff --git a/finality-provider/service/fp_store_adapter.go b/finality-provider/service/fp_store_adapter.go index a27f4c42..a7a09c1b 100644 --- a/finality-provider/service/fp_store_adapter.go +++ b/finality-provider/service/fp_store_adapter.go @@ -4,15 +4,15 @@ import ( "sync" sdkmath "cosmossdk.io/math" - bbntypes "github.com/babylonchain/babylon/types" - btcstakingtypes "github.com/babylonchain/babylon/x/btcstaking/types" + bbntypes "github.com/babylonlabs-io/babylon/types" + btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" "github.com/btcsuite/btcd/btcec/v2" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "go.uber.org/zap" - "github.com/babylonchain/finality-provider/finality-provider/proto" - "github.com/babylonchain/finality-provider/finality-provider/store" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" + "github.com/babylonlabs-io/finality-provider/finality-provider/store" ) type createFinalityProviderResponse struct { diff --git a/finality-provider/service/pub_rand_store_adapter.go b/finality-provider/service/pub_rand_store_adapter.go index 65e11697..f03a2836 100644 --- a/finality-provider/service/pub_rand_store_adapter.go +++ b/finality-provider/service/pub_rand_store_adapter.go @@ -1,7 +1,7 @@ package service import ( - "github.com/babylonchain/finality-provider/finality-provider/store" + "github.com/babylonlabs-io/finality-provider/finality-provider/store" "github.com/btcsuite/btcd/btcec/v2" "github.com/cometbft/cometbft/crypto/merkle" ) diff --git a/finality-provider/service/rpcserver.go b/finality-provider/service/rpcserver.go index 10d24f53..f1196f27 100644 --- a/finality-provider/service/rpcserver.go +++ b/finality-provider/service/rpcserver.go @@ -7,13 +7,13 @@ import ( "sync/atomic" "cosmossdk.io/math" - bbntypes "github.com/babylonchain/babylon/types" + bbntypes "github.com/babylonlabs-io/babylon/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "google.golang.org/grpc" - "github.com/babylonchain/finality-provider/finality-provider/proto" - "github.com/babylonchain/finality-provider/types" - "github.com/babylonchain/finality-provider/version" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" + "github.com/babylonlabs-io/finality-provider/types" + "github.com/babylonlabs-io/finality-provider/version" ) // rpcServer is the main RPC server for the Finality Provider daemon that handles diff --git a/finality-provider/service/server.go b/finality-provider/service/server.go index 94050b81..c6eb2743 100644 --- a/finality-provider/service/server.go +++ b/finality-provider/service/server.go @@ -12,8 +12,8 @@ import ( "go.uber.org/zap" "google.golang.org/grpc" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/metrics" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/metrics" ) // Server is the main daemon construct for the Finality Provider server. It handles diff --git a/finality-provider/store/fpstore.go b/finality-provider/store/fpstore.go index 6277a3db..3afb4252 100644 --- a/finality-provider/store/fpstore.go +++ b/finality-provider/store/fpstore.go @@ -12,7 +12,7 @@ import ( "github.com/lightningnetwork/lnd/kvdb" pm "google.golang.org/protobuf/proto" - "github.com/babylonchain/finality-provider/finality-provider/proto" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" ) var ( diff --git a/finality-provider/store/fpstore_test.go b/finality-provider/store/fpstore_test.go index 1766e356..54feccf7 100644 --- a/finality-provider/store/fpstore_test.go +++ b/finality-provider/store/fpstore_test.go @@ -5,12 +5,12 @@ import ( "os" "testing" - "github.com/babylonchain/babylon/testutil/datagen" + "github.com/babylonlabs-io/babylon/testutil/datagen" "github.com/stretchr/testify/require" - "github.com/babylonchain/finality-provider/finality-provider/config" - fpstore "github.com/babylonchain/finality-provider/finality-provider/store" - "github.com/babylonchain/finality-provider/testutil" + "github.com/babylonlabs-io/finality-provider/finality-provider/config" + fpstore "github.com/babylonlabs-io/finality-provider/finality-provider/store" + "github.com/babylonlabs-io/finality-provider/testutil" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/finality-provider/store/storedfp.go b/finality-provider/store/storedfp.go index 9923c353..25b74e10 100644 --- a/finality-provider/store/storedfp.go +++ b/finality-provider/store/storedfp.go @@ -4,12 +4,12 @@ import ( "fmt" sdkmath "cosmossdk.io/math" - bbn "github.com/babylonchain/babylon/types" + bbn "github.com/babylonlabs-io/babylon/types" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/babylonchain/finality-provider/finality-provider/proto" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" ) type StoredFinalityProvider struct { diff --git a/go.mod b/go.mod index ebbc8c25..92cb6b67 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/babylonchain/finality-provider +module github.com/babylonlabs-io/finality-provider go 1.21 @@ -10,9 +10,9 @@ require ( cosmossdk.io/math v1.3.0 github.com/CosmWasm/wasmd v0.51.0 github.com/avast/retry-go/v4 v4.5.1 - github.com/babylonchain/babylon v0.9.0-rc.2 github.com/babylonchain/babylon-sdk/demo v0.0.0-20240705194516-4e2c5650cde8 - github.com/babylonlabs-io/babylon-finality-gadget v0.0.0-20240731203740-07d2ddabc4fb + github.com/babylonlabs-io/babylon v0.9.0 + github.com/babylonlabs-io/babylon-finality-gadget v0.0.0-20240801002122-6d6bca47ec56 github.com/btcsuite/btcd v0.24.2 github.com/btcsuite/btcd/btcec/v2 v2.3.2 github.com/btcsuite/btcd/btcutil v1.1.5 @@ -46,6 +46,7 @@ require ( github.com/BurntSushi/toml v1.4.0 // indirect github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect + github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.0.0-20240429153234-e1e6da7e4ead // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/protolambda/ctxlock v0.1.0 // indirect ) @@ -438,7 +439,7 @@ require ( replace ( // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - github.com/babylonchain/babylon => github.com/babylonchain/babylon-private v0.9.0-rc.2.0.20240717044248-3d8f190c9b0c + github.com/babylonlabs-io/babylon => github.com/babylonlabs-io/babylon-private v0.9.0-rc.3.0.20240801001431-74a24c962ce2 github.com/cockroachdb/pebble => github.com/cockroachdb/pebble v0.0.0-20231018212520-f6cde3fc2fa4 github.com/ethereum-optimism/optimism => github.com/babylonlabs-io/optimism v1.8.1-0.20240731214220-e7d71bf38866 github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101315.1-rc.5 diff --git a/go.sum b/go.sum index 14c6649d..75f2118a 100644 --- a/go.sum +++ b/go.sum @@ -296,14 +296,14 @@ github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX github.com/aws/aws-sdk-go v1.44.312 h1:llrElfzeqG/YOLFFKjg1xNpZCFJ2xraIi3PqSuP+95k= github.com/aws/aws-sdk-go v1.44.312/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/babylonchain/babylon-private v0.9.0-rc.2.0.20240717044248-3d8f190c9b0c h1:Q8vNr512o6zxxTg1rC41j+s5IS13B1c5kduQmps6pho= -github.com/babylonchain/babylon-private v0.9.0-rc.2.0.20240717044248-3d8f190c9b0c/go.mod h1:eVovUiLvCvHRpXV7f8KzC4FND1UryaZmZc3bEdBvB8w= github.com/babylonchain/babylon-sdk/demo v0.0.0-20240705194516-4e2c5650cde8 h1:VzLjjsynyYaOsIiLwVwMQDXbh1nsQWVpLYLi09R0mh0= github.com/babylonchain/babylon-sdk/demo v0.0.0-20240705194516-4e2c5650cde8/go.mod h1:X4QovCWMwqMjoTriu18w4gfqX1sYqOWRnZwXGYD8bnE= github.com/babylonchain/babylon-sdk/x v0.0.0-20240705194516-4e2c5650cde8 h1:W8jr9BHOLD9RJviI6TmnWPwZpMSjliQNIbNuflBx6vo= github.com/babylonchain/babylon-sdk/x v0.0.0-20240705194516-4e2c5650cde8/go.mod h1:Ojrlnwh9z7fvmTUzYH4Tk+8hWSctCrZYWiC5+t4X32I= -github.com/babylonlabs-io/babylon-finality-gadget v0.0.0-20240731203740-07d2ddabc4fb h1:p5y2YqO6y7ORPiJ/L3v1FPb3RKwXjkbuVq6jnI8LlL4= -github.com/babylonlabs-io/babylon-finality-gadget v0.0.0-20240731203740-07d2ddabc4fb/go.mod h1:JDmZ9JfYh0DgYs6r6mxEonRNDN+0XQf/7RErIbg/sH0= +github.com/babylonlabs-io/babylon-finality-gadget v0.0.0-20240801002122-6d6bca47ec56 h1:xZ+x4nfezT99jbBYDfqxQx+KBmqICbJtu8WLrjS1sVY= +github.com/babylonlabs-io/babylon-finality-gadget v0.0.0-20240801002122-6d6bca47ec56/go.mod h1:IZUMNT4MCzKPzsniq5EeNITWy/HeNX5k8hPoJNjFSqQ= +github.com/babylonlabs-io/babylon-private v0.9.0-rc.3.0.20240801001431-74a24c962ce2 h1:sFsAJkrYe1eIkKzWTn4sj7G6QrPQ3IK33/UlOVgeA5M= +github.com/babylonlabs-io/babylon-private v0.9.0-rc.3.0.20240801001431-74a24c962ce2/go.mod h1:pyFZgF85gUhfiCJKbYjnxo5+9prDkti48tW4FDEu9js= github.com/babylonlabs-io/optimism v1.8.1-0.20240731214220-e7d71bf38866 h1:FjrkthFS4JRGCckPh/uTdznhqwQOzjD8JJ0blcrS1VY= github.com/babylonlabs-io/optimism v1.8.1-0.20240731214220-e7d71bf38866/go.mod h1:MAppo9HosEUwyUCNnvJxJb3GQr5iP72HYb0Xv5YY4JE= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -467,6 +467,8 @@ github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= +github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.0.0-20240429153234-e1e6da7e4ead h1:QB50+AmrEVqFr2hzvIxMkICziWQ/uuebze0vNYKMnBg= +github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.0.0-20240429153234-e1e6da7e4ead/go.mod h1:AJeroAXnPKeFpD1AfEfjYBHGEWt5gBfzUjgs4SYn2ZY= github.com/cosmos/ibc-go/v8 v8.3.0 h1:fdW2S7NjZYFhSwmCaFjjyDv80kI1ePOJDQmco4qrnD0= github.com/cosmos/ibc-go/v8 v8.3.0/go.mod h1:izwHZvn9lKrBn8xWj0aXWut6HKcwHMPD3uyuvOJoPSA= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= diff --git a/itest/babylon/babylon_e2e_test.go b/itest/babylon/babylon_e2e_test.go index 43dc7b7c..ac00af4e 100644 --- a/itest/babylon/babylon_e2e_test.go +++ b/itest/babylon/babylon_e2e_test.go @@ -8,13 +8,13 @@ import ( "testing" "time" - "github.com/babylonchain/babylon/testutil/datagen" - e2eutils "github.com/babylonchain/finality-provider/itest" + "github.com/babylonlabs-io/babylon/testutil/datagen" + e2eutils "github.com/babylonlabs-io/finality-provider/itest" "github.com/btcsuite/btcd/btcec/v2" "github.com/stretchr/testify/require" - "github.com/babylonchain/finality-provider/finality-provider/proto" - "github.com/babylonchain/finality-provider/types" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" + "github.com/babylonlabs-io/finality-provider/types" ) // TestFinalityProviderLifeCycle tests the whole life cycle of a finality-provider diff --git a/itest/babylon/babylon_test_manager.go b/itest/babylon/babylon_test_manager.go index 65726727..480dc940 100644 --- a/itest/babylon/babylon_test_manager.go +++ b/itest/babylon/babylon_test_manager.go @@ -11,22 +11,22 @@ import ( "time" sdkmath "cosmossdk.io/math" - "github.com/babylonchain/babylon/testutil/datagen" - bbntypes "github.com/babylonchain/babylon/types" - btclctypes "github.com/babylonchain/babylon/x/btclightclient/types" - "github.com/babylonchain/finality-provider/clientcontroller" - e2eutils "github.com/babylonchain/finality-provider/itest" - base_test_manager "github.com/babylonchain/finality-provider/itest/test-manager" + "github.com/babylonlabs-io/babylon/testutil/datagen" + bbntypes "github.com/babylonlabs-io/babylon/types" + btclctypes "github.com/babylonlabs-io/babylon/x/btclightclient/types" + "github.com/babylonlabs-io/finality-provider/clientcontroller" + e2eutils "github.com/babylonlabs-io/finality-provider/itest" + base_test_manager "github.com/babylonlabs-io/finality-provider/itest/test-manager" "github.com/btcsuite/btcd/btcec/v2" "github.com/stretchr/testify/require" "go.uber.org/zap" - bbncc "github.com/babylonchain/finality-provider/clientcontroller/babylon" - "github.com/babylonchain/finality-provider/eotsmanager/client" - eotsconfig "github.com/babylonchain/finality-provider/eotsmanager/config" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/finality-provider/service" - "github.com/babylonchain/finality-provider/types" + bbncc "github.com/babylonlabs-io/finality-provider/clientcontroller/babylon" + "github.com/babylonlabs-io/finality-provider/eotsmanager/client" + eotsconfig "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/service" + "github.com/babylonlabs-io/finality-provider/types" ) type BaseTestManager = base_test_manager.BaseTestManager diff --git a/itest/babylon_node_handler.go b/itest/babylon_node_handler.go index 1c409b62..cac0c9a4 100644 --- a/itest/babylon_node_handler.go +++ b/itest/babylon_node_handler.go @@ -13,7 +13,7 @@ import ( "strings" "testing" - "github.com/babylonchain/babylon/types" + "github.com/babylonlabs-io/babylon/types" "github.com/stretchr/testify/require" ) diff --git a/itest/cosmwasm/bcd/bcd_consumer_e2e_test.go b/itest/cosmwasm/bcd/bcd_consumer_e2e_test.go index da5bcd56..92d3a9c0 100644 --- a/itest/cosmwasm/bcd/bcd_consumer_e2e_test.go +++ b/itest/cosmwasm/bcd/bcd_consumer_e2e_test.go @@ -9,7 +9,7 @@ import ( "testing" sdkmath "cosmossdk.io/math" - e2eutils "github.com/babylonchain/finality-provider/itest" + e2eutils "github.com/babylonlabs-io/finality-provider/itest" sdk "github.com/cosmos/cosmos-sdk/types" sdkquerytypes "github.com/cosmos/cosmos-sdk/types/query" "github.com/stretchr/testify/require" diff --git a/itest/cosmwasm/bcd/bcd_handler.go b/itest/cosmwasm/bcd/bcd_handler.go index 9cad92eb..3af5b6de 100644 --- a/itest/cosmwasm/bcd/bcd_handler.go +++ b/itest/cosmwasm/bcd/bcd_handler.go @@ -14,7 +14,7 @@ import ( "strings" "testing" - common "github.com/babylonchain/finality-provider/itest" + common "github.com/babylonlabs-io/finality-provider/itest" "github.com/stretchr/testify/require" ) diff --git a/itest/cosmwasm/bcd/bcd_test_manager.go b/itest/cosmwasm/bcd/bcd_test_manager.go index 3de5ef81..e1437eb5 100644 --- a/itest/cosmwasm/bcd/bcd_test_manager.go +++ b/itest/cosmwasm/bcd/bcd_test_manager.go @@ -18,18 +18,18 @@ import ( wasmparams "github.com/CosmWasm/wasmd/app/params" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" _ "github.com/babylonchain/babylon-sdk/demo/app" - "github.com/babylonchain/babylon/testutil/datagen" - bbntypes "github.com/babylonchain/babylon/types" - fpcc "github.com/babylonchain/finality-provider/clientcontroller" - bbncc "github.com/babylonchain/finality-provider/clientcontroller/babylon" - cwcc "github.com/babylonchain/finality-provider/clientcontroller/cosmwasm" - "github.com/babylonchain/finality-provider/eotsmanager/client" - eotsconfig "github.com/babylonchain/finality-provider/eotsmanager/config" - "github.com/babylonchain/finality-provider/finality-provider/config" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/finality-provider/service" - e2eutils "github.com/babylonchain/finality-provider/itest" - "github.com/babylonchain/finality-provider/types" + "github.com/babylonlabs-io/babylon/testutil/datagen" + bbntypes "github.com/babylonlabs-io/babylon/types" + fpcc "github.com/babylonlabs-io/finality-provider/clientcontroller" + bbncc "github.com/babylonlabs-io/finality-provider/clientcontroller/babylon" + cwcc "github.com/babylonlabs-io/finality-provider/clientcontroller/cosmwasm" + "github.com/babylonlabs-io/finality-provider/eotsmanager/client" + eotsconfig "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/config" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/service" + e2eutils "github.com/babylonlabs-io/finality-provider/itest" + "github.com/babylonlabs-io/finality-provider/types" "github.com/btcsuite/btcd/btcec/v2" dbm "github.com/cosmos/cosmos-db" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" diff --git a/itest/cosmwasm/wasmd/wasmd_e2e_test.go b/itest/cosmwasm/wasmd/wasmd_e2e_test.go index 6299829b..31696375 100644 --- a/itest/cosmwasm/wasmd/wasmd_e2e_test.go +++ b/itest/cosmwasm/wasmd/wasmd_e2e_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/babylonchain/babylon/testutil/datagen" - common "github.com/babylonchain/finality-provider/itest" + "github.com/babylonlabs-io/babylon/testutil/datagen" + common "github.com/babylonlabs-io/finality-provider/itest" sdk "github.com/cosmos/cosmos-sdk/types" sdkquerytypes "github.com/cosmos/cosmos-sdk/types/query" diff --git a/itest/cosmwasm/wasmd/wasmd_handler.go b/itest/cosmwasm/wasmd/wasmd_handler.go index ee9f17e8..bc15c7be 100644 --- a/itest/cosmwasm/wasmd/wasmd_handler.go +++ b/itest/cosmwasm/wasmd/wasmd_handler.go @@ -13,7 +13,7 @@ import ( "testing" "time" - common "github.com/babylonchain/finality-provider/itest" + common "github.com/babylonlabs-io/finality-provider/itest" "github.com/stretchr/testify/require" ) diff --git a/itest/cosmwasm/wasmd/wasmd_test_manager.go b/itest/cosmwasm/wasmd/wasmd_test_manager.go index 9da3cd46..c8c8d180 100644 --- a/itest/cosmwasm/wasmd/wasmd_test_manager.go +++ b/itest/cosmwasm/wasmd/wasmd_test_manager.go @@ -13,17 +13,17 @@ import ( wasmapp "github.com/CosmWasm/wasmd/app" wasmparams "github.com/CosmWasm/wasmd/app/params" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - "github.com/babylonchain/babylon/testutil/datagen" - bbntypes "github.com/babylonchain/babylon/types" - fpcc "github.com/babylonchain/finality-provider/clientcontroller" - bbncc "github.com/babylonchain/finality-provider/clientcontroller/babylon" - cwcc "github.com/babylonchain/finality-provider/clientcontroller/cosmwasm" - "github.com/babylonchain/finality-provider/eotsmanager/client" - eotsconfig "github.com/babylonchain/finality-provider/eotsmanager/config" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/finality-provider/service" - e2eutils "github.com/babylonchain/finality-provider/itest" - "github.com/babylonchain/finality-provider/types" + "github.com/babylonlabs-io/babylon/testutil/datagen" + bbntypes "github.com/babylonlabs-io/babylon/types" + fpcc "github.com/babylonlabs-io/finality-provider/clientcontroller" + bbncc "github.com/babylonlabs-io/finality-provider/clientcontroller/babylon" + cwcc "github.com/babylonlabs-io/finality-provider/clientcontroller/cosmwasm" + "github.com/babylonlabs-io/finality-provider/eotsmanager/client" + eotsconfig "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/service" + e2eutils "github.com/babylonlabs-io/finality-provider/itest" + "github.com/babylonlabs-io/finality-provider/types" "github.com/btcsuite/btcd/btcec/v2" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/crypto/keyring" diff --git a/itest/eotsmanager_handler.go b/itest/eotsmanager_handler.go index 37de409d..5e65e470 100644 --- a/itest/eotsmanager_handler.go +++ b/itest/eotsmanager_handler.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" - "github.com/babylonchain/finality-provider/eotsmanager" - "github.com/babylonchain/finality-provider/eotsmanager/config" - "github.com/babylonchain/finality-provider/eotsmanager/service" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + "github.com/babylonlabs-io/finality-provider/eotsmanager/service" ) type EOTSServerHandler struct { diff --git a/itest/opstackl2/op_e2e_test.go b/itest/opstackl2/op_e2e_test.go index 3dcc25c6..445c7fe9 100644 --- a/itest/opstackl2/op_e2e_test.go +++ b/itest/opstackl2/op_e2e_test.go @@ -8,10 +8,10 @@ import ( "testing" "time" - e2eutils "github.com/babylonchain/finality-provider/itest" - "github.com/babylonchain/finality-provider/testutil/log" sdkclient "github.com/babylonlabs-io/babylon-finality-gadget/sdk/client" "github.com/babylonlabs-io/babylon-finality-gadget/sdk/cwclient" + e2eutils "github.com/babylonlabs-io/finality-provider/itest" + "github.com/babylonlabs-io/finality-provider/testutil/log" "github.com/stretchr/testify/require" ) diff --git a/itest/opstackl2/op_test_manager.go b/itest/opstackl2/op_test_manager.go index 163c0da9..2156d18d 100644 --- a/itest/opstackl2/op_test_manager.go +++ b/itest/opstackl2/op_test_manager.go @@ -14,24 +14,24 @@ import ( "time" sdkmath "cosmossdk.io/math" - bbncfg "github.com/babylonchain/babylon/client/config" - bbntypes "github.com/babylonchain/babylon/types" - api "github.com/babylonchain/finality-provider/clientcontroller/api" - bbncc "github.com/babylonchain/finality-provider/clientcontroller/babylon" - "github.com/babylonchain/finality-provider/clientcontroller/opstackl2" - opcc "github.com/babylonchain/finality-provider/clientcontroller/opstackl2" - "github.com/babylonchain/finality-provider/eotsmanager/client" - eotsconfig "github.com/babylonchain/finality-provider/eotsmanager/config" - fpcfg "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/finality-provider/service" - e2eutils "github.com/babylonchain/finality-provider/itest" - base_test_manager "github.com/babylonchain/finality-provider/itest/test-manager" - "github.com/babylonchain/finality-provider/metrics" - "github.com/babylonchain/finality-provider/testutil/log" - "github.com/babylonchain/finality-provider/types" "github.com/babylonlabs-io/babylon-finality-gadget/sdk/btcclient" sdkclient "github.com/babylonlabs-io/babylon-finality-gadget/sdk/client" sdkcfg "github.com/babylonlabs-io/babylon-finality-gadget/sdk/config" + bbncfg "github.com/babylonlabs-io/babylon/client/config" + bbntypes "github.com/babylonlabs-io/babylon/types" + api "github.com/babylonlabs-io/finality-provider/clientcontroller/api" + bbncc "github.com/babylonlabs-io/finality-provider/clientcontroller/babylon" + "github.com/babylonlabs-io/finality-provider/clientcontroller/opstackl2" + opcc "github.com/babylonlabs-io/finality-provider/clientcontroller/opstackl2" + "github.com/babylonlabs-io/finality-provider/eotsmanager/client" + eotsconfig "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/service" + e2eutils "github.com/babylonlabs-io/finality-provider/itest" + base_test_manager "github.com/babylonlabs-io/finality-provider/itest/test-manager" + "github.com/babylonlabs-io/finality-provider/metrics" + "github.com/babylonlabs-io/finality-provider/testutil/log" + "github.com/babylonlabs-io/finality-provider/types" "github.com/btcsuite/btcd/btcec/v2" sdkquerytypes "github.com/cosmos/cosmos-sdk/types/query" ope2e "github.com/ethereum-optimism/optimism/op-e2e" @@ -728,7 +728,7 @@ func (ctm *OpL2ConsumerTestManager) SetupFinalityProviders( stakingParams []stakingParam, ) []*service.FinalityProviderInstance { // A BTC delegation has to stake to at least one Babylon finality provider - // https://github.com/babylonchain/babylon-private/blob/3d8f190c9b0c0795f6546806e3b8582de716cd60/x/btcstaking/keeper/msg_server.go#L220 + // https://github.com/babylonlabs-io/babylon-private/blob/74a24c962ce2cf64e5216edba9383fe0b460070c/x/btcstaking/keeper/msg_server.go#L220 // So we have to register a Babylon chain FP bbnFpPk := ctm.RegisterBabylonFinalityProvider(t) diff --git a/itest/test-manager/base_test_manager.go b/itest/test-manager/base_test_manager.go index 1dc5c77f..42ef687b 100644 --- a/itest/test-manager/base_test_manager.go +++ b/itest/test-manager/base_test_manager.go @@ -5,22 +5,22 @@ import ( "testing" "time" - "github.com/babylonchain/babylon/btcstaking" - asig "github.com/babylonchain/babylon/crypto/schnorr-adaptor-signature" - "github.com/babylonchain/babylon/testutil/datagen" - bbntypes "github.com/babylonchain/babylon/types" - btcctypes "github.com/babylonchain/babylon/x/btccheckpoint/types" - btclctypes "github.com/babylonchain/babylon/x/btclightclient/types" - bstypes "github.com/babylonchain/babylon/x/btcstaking/types" - e2eutils "github.com/babylonchain/finality-provider/itest" + "github.com/babylonlabs-io/babylon/btcstaking" + asig "github.com/babylonlabs-io/babylon/crypto/schnorr-adaptor-signature" + "github.com/babylonlabs-io/babylon/testutil/datagen" + bbntypes "github.com/babylonlabs-io/babylon/types" + btcctypes "github.com/babylonlabs-io/babylon/x/btccheckpoint/types" + btclctypes "github.com/babylonlabs-io/babylon/x/btclightclient/types" + bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" + e2eutils "github.com/babylonlabs-io/finality-provider/itest" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcutil" "github.com/btcsuite/btcd/wire" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - bbncc "github.com/babylonchain/finality-provider/clientcontroller/babylon" - "github.com/babylonchain/finality-provider/types" + bbncc "github.com/babylonlabs-io/finality-provider/clientcontroller/babylon" + "github.com/babylonlabs-io/finality-provider/types" ) type BaseTestManager struct { diff --git a/itest/test_helpers.go b/itest/test_helpers.go index e83c8639..b2973d74 100644 --- a/itest/test_helpers.go +++ b/itest/test_helpers.go @@ -6,12 +6,12 @@ import ( "time" sdkmath "cosmossdk.io/math" - "github.com/babylonchain/babylon/crypto/eots" - "github.com/babylonchain/babylon/testutil/datagen" - bbn "github.com/babylonchain/babylon/types" - bstypes "github.com/babylonchain/babylon/x/btcstaking/types" - ftypes "github.com/babylonchain/babylon/x/finality/types" - "github.com/babylonchain/finality-provider/clientcontroller/cosmwasm" + "github.com/babylonlabs-io/babylon/crypto/eots" + "github.com/babylonlabs-io/babylon/testutil/datagen" + bbn "github.com/babylonlabs-io/babylon/types" + bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" + ftypes "github.com/babylonlabs-io/babylon/x/finality/types" + "github.com/babylonlabs-io/finality-provider/clientcontroller/cosmwasm" "github.com/btcsuite/btcd/btcec/v2" "github.com/stretchr/testify/require" diff --git a/itest/utils.go b/itest/utils.go index e1bf18fa..b4730bb1 100644 --- a/itest/utils.go +++ b/itest/utils.go @@ -9,14 +9,14 @@ import ( "encoding/hex" - "github.com/babylonchain/finality-provider/finality-provider/config" - "github.com/babylonchain/finality-provider/finality-provider/service" + "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/service" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/chaincfg" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - bbntypes "github.com/babylonchain/babylon/types" - bstypes "github.com/babylonchain/babylon/x/btcstaking/types" + bbntypes "github.com/babylonlabs-io/babylon/types" + bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" "github.com/stretchr/testify/require" ) @@ -132,7 +132,7 @@ func DefaultFpConfigWithPorts(keyringDir, homeDir string, fpRpcPort, fpMetricsPo // ParseRespBTCDelToBTCDel parses an BTC delegation response to BTC Delegation // adapted from -// https://github.com/babylonchain/babylon/blob/1a3c50da64885452c8d669fcea2a2fad78c8a028/test/e2e/btc_staking_e2e_test.go#L548 +// https://github.com/babylonlabs-io/babylon-private/blob/74a24c962ce2cf64e5216edba9383fe0b460070c/test/e2e/btc_staking_e2e_test.go#L773 func ParseRespBTCDelToBTCDel( resp *bstypes.BTCDelegationResponse, ) (btcDel *bstypes.BTCDelegation, err error) { diff --git a/keyring/keyring.go b/keyring/keyring.go index 36b526b3..c8312907 100644 --- a/keyring/keyring.go +++ b/keyring/keyring.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/babylonchain/finality-provider/codec" + "github.com/babylonlabs-io/finality-provider/codec" ) func CreateKeyring(keyringDir string, chainId string, backend string, input *strings.Reader) (keyring.Keyring, error) { diff --git a/keyring/keyringcontroller.go b/keyring/keyringcontroller.go index 9cb6e81d..fd0bf84a 100644 --- a/keyring/keyringcontroller.go +++ b/keyring/keyringcontroller.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - bstypes "github.com/babylonchain/babylon/x/btcstaking/types" + bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" "github.com/btcsuite/btcd/btcec/v2" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -12,7 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/go-bip39" - "github.com/babylonchain/finality-provider/types" + "github.com/babylonlabs-io/finality-provider/types" ) const ( diff --git a/keyring/keyringcontroller_test.go b/keyring/keyringcontroller_test.go index 0ec247de..19c2315b 100644 --- a/keyring/keyringcontroller_test.go +++ b/keyring/keyringcontroller_test.go @@ -8,17 +8,17 @@ import ( "go.uber.org/zap" - "github.com/babylonchain/babylon/types" + "github.com/babylonlabs-io/babylon/types" "github.com/btcsuite/btcd/chaincfg" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/stretchr/testify/require" - eotscfg "github.com/babylonchain/finality-provider/eotsmanager/config" + eotscfg "github.com/babylonlabs-io/finality-provider/eotsmanager/config" - fpkr "github.com/babylonchain/finality-provider/keyring" + fpkr "github.com/babylonlabs-io/finality-provider/keyring" - "github.com/babylonchain/finality-provider/eotsmanager" - "github.com/babylonchain/finality-provider/testutil" + "github.com/babylonlabs-io/finality-provider/eotsmanager" + "github.com/babylonlabs-io/finality-provider/testutil" ) var ( diff --git a/log/log.go b/log/log.go index 4b05ed39..f81f79e9 100644 --- a/log/log.go +++ b/log/log.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/babylonchain/finality-provider/util" + "github.com/babylonlabs-io/finality-provider/util" zaplogfmt "github.com/jsternberg/zap-logfmt" "go.uber.org/zap" diff --git a/metrics/fp_collectors.go b/metrics/fp_collectors.go index 82c6e0fc..b9a0e135 100644 --- a/metrics/fp_collectors.go +++ b/metrics/fp_collectors.go @@ -6,8 +6,8 @@ import ( "github.com/prometheus/client_golang/prometheus" - "github.com/babylonchain/finality-provider/finality-provider/proto" - "github.com/babylonchain/finality-provider/finality-provider/store" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" + "github.com/babylonlabs-io/finality-provider/finality-provider/store" ) type FpMetrics struct { diff --git a/testutil/datagen.go b/testutil/datagen.go index 1865b81e..d9d5264f 100644 --- a/testutil/datagen.go +++ b/testutil/datagen.go @@ -6,25 +6,25 @@ import ( "testing" "time" - "github.com/babylonchain/babylon/crypto/eots" + "github.com/babylonlabs-io/babylon/crypto/eots" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/babylonchain/finality-provider/finality-provider/store" + "github.com/babylonlabs-io/finality-provider/finality-provider/store" sdkmath "cosmossdk.io/math" - "github.com/babylonchain/babylon/testutil/datagen" - bbn "github.com/babylonchain/babylon/types" - bstypes "github.com/babylonchain/babylon/x/btcstaking/types" + "github.com/babylonlabs-io/babylon/testutil/datagen" + bbn "github.com/babylonlabs-io/babylon/types" + bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" "github.com/btcsuite/btcd/chaincfg" "github.com/cosmos/cosmos-sdk/client" "github.com/stretchr/testify/require" - "github.com/babylonchain/finality-provider/codec" - "github.com/babylonchain/finality-provider/finality-provider/proto" - "github.com/babylonchain/finality-provider/finality-provider/service" - "github.com/babylonchain/finality-provider/types" + "github.com/babylonlabs-io/finality-provider/codec" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" + "github.com/babylonlabs-io/finality-provider/finality-provider/service" + "github.com/babylonlabs-io/finality-provider/types" ) func GenRandomByteArray(r *rand.Rand, length uint64) []byte { diff --git a/testutil/mocks/clientcontroller.go b/testutil/mocks/clientcontroller.go index f52efce4..7cc7474c 100644 --- a/testutil/mocks/clientcontroller.go +++ b/testutil/mocks/clientcontroller.go @@ -8,7 +8,7 @@ import ( reflect "reflect" math "cosmossdk.io/math" - types "github.com/babylonchain/finality-provider/types" + types "github.com/babylonlabs-io/finality-provider/types" btcec "github.com/btcsuite/btcd/btcec/v2" schnorr "github.com/btcsuite/btcd/btcec/v2/schnorr" gomock "github.com/golang/mock/gomock" diff --git a/testutil/utils.go b/testutil/utils.go index 669f0ae5..ed827a0e 100644 --- a/testutil/utils.go +++ b/testutil/utils.go @@ -7,8 +7,8 @@ import ( sdkmath "cosmossdk.io/math" "github.com/golang/mock/gomock" - "github.com/babylonchain/finality-provider/testutil/mocks" - "github.com/babylonchain/finality-provider/types" + "github.com/babylonlabs-io/finality-provider/testutil/mocks" + "github.com/babylonlabs-io/finality-provider/types" ) const TestPubRandNum = 25 diff --git a/tools/go.mod b/tools/go.mod index 5dbbd954..7392a1ed 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,4 +1,4 @@ -module github.com/babylonchain/finality-provider/tools +module github.com/babylonlabs-io/finality-provider/tools go 1.21 @@ -6,8 +6,8 @@ toolchain go1.21.4 require ( github.com/CosmWasm/wasmd v0.51.0 - github.com/babylonchain/babylon v0.9.0-rc.2 github.com/babylonchain/babylon-sdk/demo v0.0.0-20240705194516-4e2c5650cde8 + github.com/babylonlabs-io/babylon v0.9.0 ) require ( @@ -34,7 +34,7 @@ require ( filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/CosmWasm/wasmvm/v2 v2.0.0 // indirect + github.com/CosmWasm/wasmvm/v2 v2.0.1 // indirect github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/aead/siphash v1.0.1 // indirect @@ -60,7 +60,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7 // indirect github.com/cometbft/cometbft-db v0.9.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect @@ -71,7 +71,8 @@ require ( github.com/cosmos/gogoproto v1.4.12 // indirect github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ibc-go/modules/capability v1.0.0 // indirect - github.com/cosmos/ibc-go/v8 v8.2.0 // indirect + github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.0.0-20240429153234-e1e6da7e4ead // indirect + github.com/cosmos/ibc-go/v8 v8.3.0 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/creachadair/atomicfile v0.3.1 // indirect @@ -226,6 +227,6 @@ require ( replace ( // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - github.com/babylonchain/babylon => github.com/babylonchain/babylon-private v0.9.0-rc.2.0.20240717044248-3d8f190c9b0c + github.com/babylonlabs-io/babylon => github.com/babylonlabs-io/babylon-private v0.9.0-rc.3.0.20240801001431-74a24c962ce2 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) diff --git a/tools/go.sum b/tools/go.sum index c193fef9..0b662306 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -225,8 +225,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/CosmWasm/wasmd v0.51.0 h1:3A2o20RrdF7P1D3Xb+R7A/pHbbHWsYCDXrHLa7S0SC8= github.com/CosmWasm/wasmd v0.51.0/go.mod h1:7TSaj5HoolghujuVWeExqmcUKgpcYWEySGLSODbnnwY= -github.com/CosmWasm/wasmvm/v2 v2.0.0 h1:IqNCI2G0mvs7K6ej17/I28805rVqnu+Y1cWDqIdwb08= -github.com/CosmWasm/wasmvm/v2 v2.0.0/go.mod h1:su9lg5qLr7adV95eOfzjZWkGiky8WNaNIHDr7Fpu7Ck= +github.com/CosmWasm/wasmvm/v2 v2.0.1 h1:0YCQ7MKGNri7NFeRp75erPJXrqyCtH4gdc9jMstyMzk= +github.com/CosmWasm/wasmvm/v2 v2.0.1/go.mod h1:su9lg5qLr7adV95eOfzjZWkGiky8WNaNIHDr7Fpu7Ck= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= @@ -266,12 +266,12 @@ github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX github.com/aws/aws-sdk-go v1.44.312 h1:llrElfzeqG/YOLFFKjg1xNpZCFJ2xraIi3PqSuP+95k= github.com/aws/aws-sdk-go v1.44.312/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/babylonchain/babylon-private v0.9.0-rc.2.0.20240717044248-3d8f190c9b0c h1:Q8vNr512o6zxxTg1rC41j+s5IS13B1c5kduQmps6pho= -github.com/babylonchain/babylon-private v0.9.0-rc.2.0.20240717044248-3d8f190c9b0c/go.mod h1:eVovUiLvCvHRpXV7f8KzC4FND1UryaZmZc3bEdBvB8w= github.com/babylonchain/babylon-sdk/demo v0.0.0-20240705194516-4e2c5650cde8 h1:VzLjjsynyYaOsIiLwVwMQDXbh1nsQWVpLYLi09R0mh0= github.com/babylonchain/babylon-sdk/demo v0.0.0-20240705194516-4e2c5650cde8/go.mod h1:X4QovCWMwqMjoTriu18w4gfqX1sYqOWRnZwXGYD8bnE= github.com/babylonchain/babylon-sdk/x v0.0.0-20240705194516-4e2c5650cde8 h1:W8jr9BHOLD9RJviI6TmnWPwZpMSjliQNIbNuflBx6vo= github.com/babylonchain/babylon-sdk/x v0.0.0-20240705194516-4e2c5650cde8/go.mod h1:Ojrlnwh9z7fvmTUzYH4Tk+8hWSctCrZYWiC5+t4X32I= +github.com/babylonlabs-io/babylon-private v0.9.0-rc.3.0.20240801001431-74a24c962ce2 h1:sFsAJkrYe1eIkKzWTn4sj7G6QrPQ3IK33/UlOVgeA5M= +github.com/babylonlabs-io/babylon-private v0.9.0-rc.3.0.20240801001431-74a24c962ce2/go.mod h1:pyFZgF85gUhfiCJKbYjnxo5+9prDkti48tW4FDEu9js= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -366,8 +366,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= +github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -397,8 +397,10 @@ github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= -github.com/cosmos/ibc-go/v8 v8.2.0 h1:7oCzyy1sZCcgpeQLnHxC56brsSz3KWwQGKXalXwXFzE= -github.com/cosmos/ibc-go/v8 v8.2.0/go.mod h1:wj3qx75iC/XNnsMqbPDCIGs0G6Y3E/lo3bdqCyoCy+8= +github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.0.0-20240429153234-e1e6da7e4ead h1:QB50+AmrEVqFr2hzvIxMkICziWQ/uuebze0vNYKMnBg= +github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.0.0-20240429153234-e1e6da7e4ead/go.mod h1:AJeroAXnPKeFpD1AfEfjYBHGEWt5gBfzUjgs4SYn2ZY= +github.com/cosmos/ibc-go/v8 v8.3.0 h1:fdW2S7NjZYFhSwmCaFjjyDv80kI1ePOJDQmco4qrnD0= +github.com/cosmos/ibc-go/v8 v8.3.0/go.mod h1:izwHZvn9lKrBn8xWj0aXWut6HKcwHMPD3uyuvOJoPSA= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= diff --git a/tools/tools.go b/tools/tools.go index 17c6f345..134d08ac 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -6,5 +6,5 @@ package finalityprovider import ( _ "github.com/CosmWasm/wasmd/cmd/wasmd" _ "github.com/babylonchain/babylon-sdk/demo/cmd/bcd" - _ "github.com/babylonchain/babylon/cmd/babylond" + _ "github.com/babylonlabs-io/babylon/cmd/babylond" ) diff --git a/types/pub_rand_commit.go b/types/pub_rand_commit.go index 97e61bbd..56a7f713 100644 --- a/types/pub_rand_commit.go +++ b/types/pub_rand_commit.go @@ -3,7 +3,7 @@ package types import ( "fmt" - bbn "github.com/babylonchain/babylon/types" + bbn "github.com/babylonlabs-io/babylon/types" "github.com/btcsuite/btcd/btcec/v2" "github.com/cometbft/cometbft/crypto/merkle" )