From a15bba47262985d4e0ebeb631669fb26d0e3f65b Mon Sep 17 00:00:00 2001 From: Runchao Han Date: Wed, 7 Aug 2024 15:25:36 +1000 Subject: [PATCH 1/9] wip --- README.md | 2 +- babylon-private | 2 +- btc-staker-phase-3 | 2 +- contrib/images/Makefile | 14 +-- contrib/images/ibcsim-bcd/Dockerfile | 6 +- contrib/images/ibcsim-gaia/Dockerfile | 30 ------- contrib/images/ibcsim-gaia/wrapper.sh | 86 ------------------- .../artifacts/docker-compose.yml | 28 +++--- .../btcstaking-integration-demo.sh | 8 +- .../pre-deployment.sh | 4 +- finality-provider-phase-3 | 2 +- 11 files changed, 33 insertions(+), 151 deletions(-) delete mode 100644 contrib/images/ibcsim-gaia/Dockerfile delete mode 100755 contrib/images/ibcsim-gaia/wrapper.sh diff --git a/README.md b/README.md index a57b9fab..37feab15 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ This repository contains artifacts and instructions for setting up and running a 4. **Repository Setup**: ```shell - git clone git@github.com:babylonchain/babylon-deployment.git + git clone git@github.com:babylonlabs-io/babylon-integration-deployment.git git submodule init && git submodule update ``` diff --git a/babylon-private b/babylon-private index caa90988..74a24c96 160000 --- a/babylon-private +++ b/babylon-private @@ -1 +1 @@ -Subproject commit caa9098894847d9768c2809dae5c709360d2ea0d +Subproject commit 74a24c962ce2cf64e5216edba9383fe0b460070c diff --git a/btc-staker-phase-3 b/btc-staker-phase-3 index 4454e59a..7dd8646b 160000 --- a/btc-staker-phase-3 +++ b/btc-staker-phase-3 @@ -1 +1 @@ -Subproject commit 4454e59a4cbac3a88a91790f787e6c6332ede280 +Subproject commit 7dd8646b89551118cab0f71578be81f91f994f2d diff --git a/contrib/images/Makefile b/contrib/images/Makefile index 3e495dad..c6a401a5 100644 --- a/contrib/images/Makefile +++ b/contrib/images/Makefile @@ -8,28 +8,28 @@ endif all: bitcoinsim bitcoindsim: - docker build --platform "linux/amd64" --tag babylonchain/bitcoindsim:$(BITCOINDSIM_TAG) -f bitcoindsim/Dockerfile \ + docker build --platform "linux/amd64" --tag babylonlabs-io/bitcoindsim:$(BITCOINDSIM_TAG) -f bitcoindsim/Dockerfile \ $(shell git rev-parse --show-toplevel)/contrib/images/bitcoindsim $(BITCOINDSIM_BUILD_ARG) ibcsim-gaia: - docker build --tag babylonchain/ibcsim-gaia -f ibcsim-gaia/Dockerfile \ + docker build --tag babylonlabs-io/ibcsim-gaia -f ibcsim-gaia/Dockerfile \ $(shell git rev-parse --show-toplevel)/contrib/images/ibcsim-gaia ibcsim-bcd: docker build --secret id=sshKey,src=${BBN_PRIV_DEPLOY_KEY} \ - --tag babylonchain/ibcsim-bcd -f ibcsim-bcd/Dockerfile \ + --tag babylonlabs-io/ibcsim-bcd -f ibcsim-bcd/Dockerfile \ $(shell git rev-parse --show-toplevel)/contrib/images/ibcsim-bcd btcdsim-rmi: - docker rmi babylonchain/btcdsim 2>/dev/null; true + docker rmi babylonlabs-io/btcdsim 2>/dev/null; true bitcoindsim-rmi: - docker rmi babylonchain/bitcoindsim 2>/dev/null; true + docker rmi babylonlabs-io/bitcoindsim 2>/dev/null; true ibcsim-gaia-rmi: - docker rmi babylonchain/ibcsim-gaia 2>/dev/null; true + docker rmi babylonlabs-io/ibcsim-gaia 2>/dev/null; true ibcsim-bcd-rmi: - docker rmi babylonchain/ibcsim-bcd 2>/dev/null; true + docker rmi babylonlabs-io/ibcsim-bcd 2>/dev/null; true .PHONY: all btcdsim btcdsim-rmi bitcoindsim bitcoindsim-rmi ibcsim-gaia ibcsim-gaia-rmi ibcsim-bcd ibcsim-bcd-rmi diff --git a/contrib/images/ibcsim-bcd/Dockerfile b/contrib/images/ibcsim-bcd/Dockerfile index 7fbae468..aaf1abf4 100644 --- a/contrib/images/ibcsim-bcd/Dockerfile +++ b/contrib/images/ibcsim-bcd/Dockerfile @@ -27,11 +27,11 @@ RUN git clone https://github.com/cosmos/relayer.git RUN cd relayer && git fetch origin && git checkout ${RELAYER_TAG} && make install && cd - # Install bcd -RUN git clone https://github.com/babylonchain/babylon-sdk.git +RUN git clone https://github.com/babylonlabs-io/babylon-sdk.git 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/* RUN --mount=type=secret,id=sshKey,target=/root/.ssh/id_rsa cd babylon-sdk && git fetch origin && git checkout ${BABYLON_SDK_TAG} && make install && cd - @@ -44,7 +44,7 @@ RUN apt-get update && apt-get install -y bash curl jq wget COPY --from=build-env /work/babylon-sdk/demo/go.mod /tmp RUN WASMVM_VERSION=$(grep github.com/CosmWasm/wasmvm /tmp/go.mod | cut -d' ' -f2) && \ wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm.$(uname -m).so \ - -O /lib/libwasmvm.$(uname -m).so && \ + -O /lib/libwasmvm.$(uname -m).so && \ # verify checksum wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \ sha256sum /lib/libwasmvm.$(uname -m).so | grep $(cat /tmp/checksums.txt | grep libwasmvm.$(uname -m) | cut -d ' ' -f 1) diff --git a/contrib/images/ibcsim-gaia/Dockerfile b/contrib/images/ibcsim-gaia/Dockerfile deleted file mode 100644 index a5705f5a..00000000 --- a/contrib/images/ibcsim-gaia/Dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -FROM golang:1.20-alpine AS build - -RUN apk add --no-cache openssh-client git make build-base linux-headers libc-dev - -WORKDIR /work - -ENV GO111MODULE=on - -# Install gaia -# NOTE: we need gaia that runs over go 1.20 -RUN git clone https://github.com/cosmos/gaia.git -RUN cd gaia && git fetch origin && git checkout cb523c09bba68c1ac54e71bf4d4408628211532d && make install && cd - - -# Install the relayer -RUN git clone https://github.com/babylonchain/babylon-relayer.git -RUN cd babylon-relayer && git checkout dev && make install && cd - - -RUN apk add bash jq -WORKDIR /ibcsim-gaia -COPY wrapper.sh /ibcsim-gaia/wrapper.sh - -ENV BABYLON_HOME=/data/node1/babylond -ENV BABYLON_NODE_RPC="http://babylondnode1:26657" -ENV RELAYER_CONF_DIR=/data/relayer -ENV GAIA_CONF=/data/gaia -ENV UPDATE_CLIENTS_INTERVAL=20s - -ENTRYPOINT ["/ibcsim-gaia/wrapper.sh"] -CMD [] -STOPSIGNAL SIGTERM diff --git a/contrib/images/ibcsim-gaia/wrapper.sh b/contrib/images/ibcsim-gaia/wrapper.sh deleted file mode 100755 index 7b58cfed..00000000 --- a/contrib/images/ibcsim-gaia/wrapper.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env sh -set -euo pipefail -#set -x - -# 0. Define configuration -BABYLON_KEY="babylon-key" -BABYLON_CHAIN_ID="chain-test" -GAIA_CHAIN_ID="gaia-test" - -mkdir -p $RELAYER_CONF_DIR -babylon-relayer --home $RELAYER_CONF_DIR config init -RELAYER_CONF=$RELAYER_CONF_DIR/config/config.yaml - -cat < $RELAYER_CONF -global: - api-listen-addr: :5183 - timeout: 20s - memo: "" - light-cache-size: 10 -chains: - babylon: - type: cosmos - value: - key: $BABYLON_KEY - chain-id: $BABYLON_CHAIN_ID - rpc-addr: $BABYLON_NODE_RPC - account-prefix: bbn - keyring-backend: test - gas-adjustment: 1.5 - gas-prices: 0.002ubbn - min-gas-amount: 1 - debug: true - timeout: 10s - output-format: json - sign-mode: direct - extra-codecs: [] - gaia: - type: cosmos - value: - chain-id: $GAIA_CHAIN_ID - rpc-addr: http://localhost:26657 - keyring-backend: test - timeout: 10s -paths: - gaia: - src: - chain-id: $BABYLON_CHAIN_ID - dst: - chain-id: $GAIA_CHAIN_ID -EOT - -# 1. Create a gaiad testnet - -# Create testnet dirs for one validator -echo "Creating testnet dirs..." -gaiad testnet \ - --v 1 \ - --output-dir $GAIA_CONF \ - --starting-ip-address 192.168.10.2 \ - --keyring-backend test \ - --minimum-gas-prices "0.00002stake" \ - --chain-id $GAIA_CHAIN_ID - -echo "$(sed 's/cors_allowed_origins = \[\]/cors_allowed_origins = \[\"*\"\]/g' $GAIA_CONF/node0/gaiad/config/config.toml)" > $GAIA_CONF/node0/gaiad/config/config.toml -# Start the gaiad service -echo "Starting the gaiad service..." -GAIA_LOG=$GAIA_CONF/node0/gaiad/gaiad.log -gaiad --home $GAIA_CONF/node0/gaiad start \ - --pruning=nothing --grpc-web.enable=false \ - --rpc.unsafe true \ - --grpc.address="0.0.0.0:9091" > $GAIA_LOG 2>&1 & - -echo "gaiad started. Logs outputted at $GAIA_LOG" -sleep 10 -echo "Status of Gaia node" -gaiad status - -sleep 30 - -# 2. Create the relayer -echo "Inserting Babylon key" -BABYLON_MEMO=$(cat $BABYLON_HOME/key_seed.json | jq .secret | tr -d '"') -babylon-relayer --home $RELAYER_CONF_DIR keys restore babylon $BABYLON_KEY "$BABYLON_MEMO" - -echo "Start the Babylon relayer" -babylon-relayer --home $RELAYER_CONF_DIR keep-update-clients --interval $UPDATE_CLIENTS_INTERVAL diff --git a/deployments/btc-staking-integration-bitcoind/artifacts/docker-compose.yml b/deployments/btc-staking-integration-bitcoind/artifacts/docker-compose.yml index 34479261..006e390f 100644 --- a/deployments/btc-staking-integration-bitcoind/artifacts/docker-compose.yml +++ b/deployments/btc-staking-integration-bitcoind/artifacts/docker-compose.yml @@ -1,7 +1,7 @@ services: babylondnode0: container_name: babylondnode0 - image: "babylonchain/babylond" + image: "babylonlabs-io/babylond" command: > babylond --home /babylondhome start --log_format 'plain' 2>&1 | tee /babylondhome/babylond.log cap_add: @@ -21,7 +21,7 @@ services: babylondnode1: container_name: babylondnode1 - image: "babylonchain/babylond" + image: "babylonlabs-io/babylond" command: > babylond --home /babylondhome start --log_format 'plain' 2>&1 | tee /babylondhome/babylond.log cap_add: @@ -43,7 +43,7 @@ services: build: context: contrib/images/bitcoindsim/ dockerfile: ./Dockerfile - image: babylonchain/bitcoindsim:latest + image: babylonlabs-io/bitcoindsim:latest platform: linux/amd64 container_name: bitcoindsim networks: @@ -69,7 +69,7 @@ services: vigilante-reporter: container_name: vigilante-reporter - image: babylonchain/vigilante + image: babylonlabs-io/vigilante command: > vigilante reporter --config /home/vigilante/config/vigilante.yml 2>&1 | tee /home/vigilante/config/reporter.log networks: @@ -84,7 +84,7 @@ services: vigilante-submitter: container_name: vigilante-submitter - image: babylonchain/vigilante + image: babylonlabs-io/vigilante command: > vigilante submitter --config /home/vigilante/config/vigilante.yml 2>&1 | tee /home/vigilante/config/submitter.log networks: @@ -99,7 +99,7 @@ services: vigilante-monitor: container_name: vigilante-monitor - image: babylonchain/vigilante + image: babylonlabs-io/vigilante command: > vigilante monitor --config /home/vigilante/config/vigilante.yml --genesis /home/vigilante/config/bbnconfig/genesis.json 2>&1 | tee /home/vigilante/config/monitor.log networks: @@ -114,7 +114,7 @@ services: vigilante-bstracker: container_name: vigilante-bstracker - image: babylonchain/vigilante + image: babylonlabs-io/vigilante command: > vigilante bstracker --config /home/vigilante/config/vigilante.yml 2>&1 | tee /home/vigilante/config/unbonding-watcher.log networks: @@ -129,7 +129,7 @@ services: btc-staker: container_name: btc-staker - image: babylonchain/btc-staker + image: babylonlabs-io/btc-staker networks: localnet: ipv4_address: 192.168.10.11 @@ -144,7 +144,7 @@ services: finality-provider: container_name: finality-provider - image: babylonchain/finality-provider + image: babylonlabs-io/finality-provider command: fpd start networks: localnet: @@ -159,7 +159,7 @@ services: consumer-fp: container_name: consumer-fp - image: babylonchain/finality-provider + image: babylonlabs-io/finality-provider command: fpd start networks: localnet: @@ -174,7 +174,7 @@ services: eotsmanager: container_name: eotsmanager - image: babylonchain/finality-provider + image: babylonlabs-io/finality-provider command: eotsd start networks: localnet: @@ -189,7 +189,7 @@ services: consumer-eotsmanager: container_name: consumer-eotsmanager - image: babylonchain/finality-provider + image: babylonlabs-io/finality-provider command: eotsd start networks: localnet: @@ -202,7 +202,7 @@ services: covenant-emulator: container_name: covenant-emulator - image: babylonchain/covenant-emulator + image: babylonlabs-io/covenant-emulator command: covd start networks: localnet: @@ -215,7 +215,7 @@ services: ibcsim-bcd: container_name: ibcsim-bcd - image: babylonchain/ibcsim-bcd + image: babylonlabs-io/ibcsim-bcd ports: - "5183:5183" volumes: diff --git a/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh b/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh index 479538d6..535a1235 100755 --- a/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh +++ b/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh @@ -123,18 +123,16 @@ i=0 for cz_btc_pk in $cz_btc_pks; do stakingTime=50000 - echo "Delegating 1 million Satoshis from BTC address ${delAddrs[i]} to Finality Provider with CZ finality provider $cz_btc_pk and Babylon finality provider $bbn_btc_pk for $stakingTime BTC blocks"; + echo "Delegating 1 million Satoshis from BTC address ${delAddrs[i]} to Finality Provider with CZ finality provider $cz_btc_pk and Babylon finality provider $bbn_btc_pk for $stakingTime BTC blocks" btcTxHash=$(docker exec btc-staker /bin/sh -c \ "/bin/stakercli dn stake --staker-address ${delAddrs[i]} --staking-amount 1000000 --finality-providers-pks $bbn_btc_pk --finality-providers-pks $cz_btc_pk --staking-time $stakingTime | jq -r '.tx_hash'") echo "Delegation was successful; staking tx hash is $btcTxHash" - i=$((i+1)) + i=$((i + 1)) done echo "Made a delegation to each of the finality providers" # Query babylon and check if the delegations are active -# NOTE: avoid querying finality provider as it might be down -# https://github.com/babylonchain/finality-provider/issues/327 echo "" echo "Wait a few minutes for the delegations to become active..." while true; do @@ -176,7 +174,7 @@ while true; do if [ $(echo "$fp_by_info" | jq '.data.fps | length') -ne "$NUM_COMSUMER_FPS" ]; then echo "There are less than $NUM_COMSUMER_FPS finality providers" sleep 10 - elif jq -e '.data.fps[].power | select(. <= 0)' <<<"$fp_by_info" > /dev/null; then + elif jq -e '.data.fps[].power | select(. <= 0)' <<<"$fp_by_info" >/dev/null; then echo "Some finality providers have zero voting power" sleep 10 else diff --git a/deployments/btc-staking-integration-bitcoind/pre-deployment.sh b/deployments/btc-staking-integration-bitcoind/pre-deployment.sh index a46d6f0b..d5ef3c33 100755 --- a/deployments/btc-staking-integration-bitcoind/pre-deployment.sh +++ b/deployments/btc-staking-integration-bitcoind/pre-deployment.sh @@ -2,7 +2,7 @@ # Create new directory that will hold node and services' configuration mkdir -p .testnets && chmod -R 777 .testnets -docker run --rm -v $(pwd)/.testnets:/data babylonchain/babylond \ +docker run --rm -v $(pwd)/.testnets:/data babylonlabs-io/babylond \ babylond testnet init-files --v 2 -o /data \ --starting-ip-address 192.168.10.2 --keyring-backend=test \ --chain-id chain-test --epoch-interval 10 \ @@ -35,4 +35,4 @@ cp artifacts/consumer-eotsd.conf .testnets/consumer-eotsmanager/eotsd.conf cp artifacts/covd.conf .testnets/covenant-emulator/covd.conf cp -R artifacts/covenant-keyring .testnets/covenant-emulator/keyring-test -chmod -R 777 .testnets \ No newline at end of file +chmod -R 777 .testnets diff --git a/finality-provider-phase-3 b/finality-provider-phase-3 index 3ed1c3e6..678f0a3a 160000 --- a/finality-provider-phase-3 +++ b/finality-provider-phase-3 @@ -1 +1 @@ -Subproject commit 3ed1c3e606779579e15d6f3cc4707b3b7d271b62 +Subproject commit 678f0a3ad963d73dcf7ee01babbdf13a4f4af704 From f11512685b21722acadc08de8bddefdbef4fc47d Mon Sep 17 00:00:00 2001 From: Runchao Han Date: Wed, 7 Aug 2024 17:27:55 +1000 Subject: [PATCH 2/9] bump all dependencies --- covenant-emulator | 2 +- finality-provider-phase-3 | 2 +- vigilante | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/covenant-emulator b/covenant-emulator index 56edbc6c..5fd91be4 160000 --- a/covenant-emulator +++ b/covenant-emulator @@ -1 +1 @@ -Subproject commit 56edbc6cd4aa7427521a89a48240232a29fda8a1 +Subproject commit 5fd91be4fe38e293d2fb46ad615badb2dfa922ad diff --git a/finality-provider-phase-3 b/finality-provider-phase-3 index 678f0a3a..b19c5b32 160000 --- a/finality-provider-phase-3 +++ b/finality-provider-phase-3 @@ -1 +1 @@ -Subproject commit 678f0a3ad963d73dcf7ee01babbdf13a4f4af704 +Subproject commit b19c5b329e94e96471c887c977b6f18366fdb7ef diff --git a/vigilante b/vigilante index 251c6c27..a8f1c827 160000 --- a/vigilante +++ b/vigilante @@ -1 +1 @@ -Subproject commit 251c6c27e2236c386031029942dece828656157a +Subproject commit a8f1c82721063a097d5970a5911ba739c1c96481 From ff77b022dd17f5c9aad689f942da810f103ac20f Mon Sep 17 00:00:00 2001 From: Runchao Han Date: Wed, 7 Aug 2024 17:50:22 +1000 Subject: [PATCH 3/9] fix some cmd --- .../btcstaking-integration-demo.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh b/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh index 535a1235..fc7b066c 100755 --- a/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh +++ b/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh @@ -40,10 +40,10 @@ sleep 10 echo "" echo "Create 1 Babylon finality provider" docker exec finality-provider /bin/sh -c " - BTC_PK=\$(/bin/fpcli create-finality-provider --key-name finality-provider0 \ + BTC_PK=\$(/bin/fpd create-finality-provider --key-name finality-provider0 \ --chain-id $BBN_CHAIN_ID \ --moniker \"Babylon finality provider 0\" | jq -r .btc_pk_hex ); \ - /bin/fpcli rfp --btc-pk \$BTC_PK + /bin/fpd register-finality-provider \$BTC_PK " # Get the public keys of the Babylon finality providers @@ -62,10 +62,10 @@ echo "" echo "Creating $NUM_COMSUMER_FPS consumer chain finality providers" for idx in $(seq 1 $((NUM_COMSUMER_FPS))); do docker exec consumer-fp /bin/sh -c " - BTC_PK=\$(/bin/fpcli create-finality-provider --key-name finality-provider$idx \ + BTC_PK=\$(/bin/fpd create-finality-provider --key-name finality-provider$idx \ --chain-id \"$CONSUMER_ID\" \ --moniker \"Finality Provider $idx\" | jq -r .btc_pk_hex ); \ - /bin/fpcli rfp --btc-pk \$BTC_PK + /bin/fpd register-finality-provider \$BTC_PK " done echo "Created $NUM_COMSUMER_FPS consumer chain finality providers" From 65bfdcdfdadf0838bfaf79c9778fec22ba7b8ba4 Mon Sep 17 00:00:00 2001 From: Runchao Han Date: Thu, 8 Aug 2024 17:39:54 +1000 Subject: [PATCH 4/9] bump vigilante --- vigilante | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vigilante b/vigilante index a8f1c827..1bf10b01 160000 --- a/vigilante +++ b/vigilante @@ -1 +1 @@ -Subproject commit a8f1c82721063a097d5970a5911ba739c1c96481 +Subproject commit 1bf10b01b9e5f9eaf89d4c41c96ea550b8e2b427 From 08a12663f5cc89d5a63cce1a25652a5b291f127d Mon Sep 17 00:00:00 2001 From: Runchao Han Date: Fri, 9 Aug 2024 15:18:45 +1000 Subject: [PATCH 5/9] use same keyname as in config for fps --- .../btcstaking-integration-demo.sh | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh b/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh index fc7b066c..3bdaeccf 100755 --- a/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh +++ b/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh @@ -39,8 +39,9 @@ sleep 10 # create FP for Babylon echo "" echo "Create 1 Babylon finality provider" +FP_KEYNAME="finality-provider" docker exec finality-provider /bin/sh -c " - BTC_PK=\$(/bin/fpd create-finality-provider --key-name finality-provider0 \ + BTC_PK=\$(/bin/fpd create-finality-provider --key-name $FP_KEYNAME \ --chain-id $BBN_CHAIN_ID \ --moniker \"Babylon finality provider 0\" | jq -r .btc_pk_hex ); \ /bin/fpd register-finality-provider \$BTC_PK @@ -57,12 +58,13 @@ docker exec babylondnode0 /bin/sh -c "/bin/babylond --home /babylondhome tx btcs echo "Registered a consumer chain with consumer ID $CONSUMER_ID" # create FPs for the consumer chain -NUM_COMSUMER_FPS=3 +NUM_COMSUMER_FPS=1 +CONSUMER_FP_KEYNAME="finality-provider" echo "" echo "Creating $NUM_COMSUMER_FPS consumer chain finality providers" for idx in $(seq 1 $((NUM_COMSUMER_FPS))); do docker exec consumer-fp /bin/sh -c " - BTC_PK=\$(/bin/fpd create-finality-provider --key-name finality-provider$idx \ + BTC_PK=\$(/bin/fpd create-finality-provider --key-name $CONSUMER_FP_KEYNAME \ --chain-id \"$CONSUMER_ID\" \ --moniker \"Finality Provider $idx\" | jq -r .btc_pk_hex ); \ /bin/fpd register-finality-provider \$BTC_PK @@ -71,9 +73,9 @@ done echo "Created $NUM_COMSUMER_FPS consumer chain finality providers" # Get the public keys of the consumer chain finality providers -cz_btc_pks=$(docker exec babylondnode0 /bin/sh -c "/bin/babylond query btcstkconsumer finality-providers \"$CONSUMER_ID\" --output json" | jq -r ".finality_providers[].btc_pk") +CONSUMER_BTC_PKS=$(docker exec babylondnode0 /bin/sh -c "/bin/babylond query btcstkconsumer finality-providers \"$CONSUMER_ID\" --output json" | jq -r ".finality_providers[].btc_pk") echo "" -echo "BTC PK of consumer chain finality providers: $cz_btc_pks" +echo "BTC PK of consumer chain finality providers: $CONSUMER_BTC_PKS" # Query contract state and check the count of finality providers echo "" @@ -97,18 +99,18 @@ echo "" echo "Ensuring all finality providers have committed public randomness..." while true; do cnt=0 - for cz_btc_pk in $cz_btc_pks; do - pr_commit_info=$(docker exec ibcsim-bcd /bin/sh -c "bcd query wasm contract-state smart $btcStakingContractAddr '{\"last_pub_rand_commit\":{\"btc_pk_hex\":\"$cz_btc_pk\"}}' -o json") + for consumer_btc_pk in $CONSUMER_BTC_PKS; do + pr_commit_info=$(docker exec ibcsim-bcd /bin/sh -c "bcd query wasm contract-state smart $btcStakingContractAddr '{\"last_pub_rand_commit\":{\"btc_pk_hex\":\"$consumer_btc_pk\"}}' -o json") if [ $(echo "$pr_commit_info" | jq '.data | length') -ne "1" ]; then - echo "The finality provider $cz_btc_pk hasn't committed any public randomness yet" + echo "The finality provider $consumer_btc_pk hasn't committed any public randomness yet" sleep 10 else - echo "The finality provider $cz_btc_pk has committed public randomness" + echo "The finality provider $consumer_btc_pk has committed public randomness" cnt=$((cnt + 1)) fi done if [ "$cnt" -eq $NUM_COMSUMER_FPS ]; then - echo "All of $cz_btc_pk finality providers have committed public randomness!" + echo "All of $consumer_btc_pk finality providers have committed public randomness!" break fi done @@ -120,13 +122,13 @@ sleep 10 # Get the available BTC addresses for delegations delAddrs=($(docker exec btc-staker /bin/sh -c '/bin/stakercli dn list-outputs | jq -r ".outputs[].address" | sort | uniq')) i=0 -for cz_btc_pk in $cz_btc_pks; do +for consumer_btc_pk in $CONSUMER_BTC_PKS; do stakingTime=50000 - echo "Delegating 1 million Satoshis from BTC address ${delAddrs[i]} to Finality Provider with CZ finality provider $cz_btc_pk and Babylon finality provider $bbn_btc_pk for $stakingTime BTC blocks" + echo "Delegating 1 million Satoshis from BTC address ${delAddrs[i]} to Finality Provider with CZ finality provider $consumer_btc_pk and Babylon finality provider $bbn_btc_pk for $stakingTime BTC blocks" btcTxHash=$(docker exec btc-staker /bin/sh -c \ - "/bin/stakercli dn stake --staker-address ${delAddrs[i]} --staking-amount 1000000 --finality-providers-pks $bbn_btc_pk --finality-providers-pks $cz_btc_pk --staking-time $stakingTime | jq -r '.tx_hash'") + "/bin/stakercli dn stake --staker-address ${delAddrs[i]} --staking-amount 1000000 --finality-providers-pks $bbn_btc_pk --finality-providers-pks $consumer_btc_pk --staking-time $stakingTime | jq -r '.tx_hash'") echo "Delegation was successful; staking tx hash is $btcTxHash" i=$((i + 1)) done @@ -188,18 +190,18 @@ echo "Ensuring all finality providers have submitted finality signatures..." last_block_height=$(docker exec ibcsim-bcd /bin/sh -c "bcd query blocks --query \"block.height > 1\" --page 1 --limit 1 --order_by desc -o json | jq -r '.blocks[0].header.height'") while true; do cnt=0 - for cz_btc_pk in $cz_btc_pks; do - finality_sig_info=$(docker exec ibcsim-bcd /bin/sh -c "bcd query wasm contract-state smart $btcStakingContractAddr '{\"finality_signature\":{\"btc_pk_hex\":\"$cz_btc_pk\",\"height\":$last_block_height}}' -o json") + for consumer_btc_pk in $CONSUMER_BTC_PKS; do + finality_sig_info=$(docker exec ibcsim-bcd /bin/sh -c "bcd query wasm contract-state smart $btcStakingContractAddr '{\"finality_signature\":{\"btc_pk_hex\":\"$consumer_btc_pk\",\"height\":$last_block_height}}' -o json") if [ $(echo "$finality_sig_info" | jq '.data | length') -ne "1" ]; then - echo "The finality provider $cz_btc_pk hasn't submitted finality signature to $last_block_height yet" + echo "The finality provider $consumer_btc_pk hasn't submitted finality signature to $last_block_height yet" sleep 10 else - echo "The finality provider $cz_btc_pk has submitted finality signature to $last_block_height" + echo "The finality provider $consumer_btc_pk has submitted finality signature to $last_block_height" cnt=$((cnt + 1)) fi done if [ "$cnt" -eq $NUM_COMSUMER_FPS ]; then - echo "All of $cz_btc_pk finality providers have submitted finality signatures!" + echo "All of $consumer_btc_pk finality providers have submitted finality signatures!" break fi done From f48990b375bd6ac87d011e1df24a79ba7e603661 Mon Sep 17 00:00:00 2001 From: Runchao Han Date: Tue, 13 Aug 2024 16:14:02 +1000 Subject: [PATCH 6/9] fix everything --- contrib/images/ibcsim-bcd/Dockerfile | 2 +- .../artifacts/consumer-fpd.conf | 4 ++-- .../btc-staking-integration-bitcoind/artifacts/fpd.conf | 4 ++-- .../btcstaking-integration-demo.sh | 2 +- finality-provider-phase-3 | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/images/ibcsim-bcd/Dockerfile b/contrib/images/ibcsim-bcd/Dockerfile index aaf1abf4..f2146c60 100644 --- a/contrib/images/ibcsim-bcd/Dockerfile +++ b/contrib/images/ibcsim-bcd/Dockerfile @@ -20,7 +20,7 @@ WORKDIR /work ENV GO111MODULE on ENV RELAYER_TAG v2.5.2 -ENV BABYLON_SDK_TAG v0.2.0-rc.1 +ENV BABYLON_SDK_TAG bump-contract # Install the relayer RUN git clone https://github.com/cosmos/relayer.git diff --git a/deployments/btc-staking-integration-bitcoind/artifacts/consumer-fpd.conf b/deployments/btc-staking-integration-bitcoind/artifacts/consumer-fpd.conf index 90bf36dd..2b29be35 100644 --- a/deployments/btc-staking-integration-bitcoind/artifacts/consumer-fpd.conf +++ b/deployments/btc-staking-integration-bitcoind/artifacts/consumer-fpd.conf @@ -2,8 +2,8 @@ ; Logging level for all subsystems {trace, debug, info, warn, error, fatal} LogLevel = debug -; the name of the consumer chain -ChainName = wasm +; the type of the consumer chain +ChainType = wasm ; The number of Schnorr public randomness for each commitment NumPubRand = 100 diff --git a/deployments/btc-staking-integration-bitcoind/artifacts/fpd.conf b/deployments/btc-staking-integration-bitcoind/artifacts/fpd.conf index 7a5fb4bd..f93be1b0 100644 --- a/deployments/btc-staking-integration-bitcoind/artifacts/fpd.conf +++ b/deployments/btc-staking-integration-bitcoind/artifacts/fpd.conf @@ -2,8 +2,8 @@ ; Logging level for all subsystems {trace, debug, info, warn, error, fatal} LogLevel = debug -; the name of the consumer chain -ChainName = babylon +; the type of the consumer chain +ChainType = babylon ; The number of Schnorr public randomness for each commitment NumPubRand = 100 diff --git a/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh b/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh index 3bdaeccf..1cb7094a 100755 --- a/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh +++ b/deployments/btc-staking-integration-bitcoind/btcstaking-integration-demo.sh @@ -101,7 +101,7 @@ while true; do cnt=0 for consumer_btc_pk in $CONSUMER_BTC_PKS; do pr_commit_info=$(docker exec ibcsim-bcd /bin/sh -c "bcd query wasm contract-state smart $btcStakingContractAddr '{\"last_pub_rand_commit\":{\"btc_pk_hex\":\"$consumer_btc_pk\"}}' -o json") - if [ $(echo "$pr_commit_info" | jq '.data | length') -ne "1" ]; then + if [[ "$(echo "$pr_commit_info" | jq '.data')" == *"null"* ]]; then echo "The finality provider $consumer_btc_pk hasn't committed any public randomness yet" sleep 10 else diff --git a/finality-provider-phase-3 b/finality-provider-phase-3 index b19c5b32..f6563583 160000 --- a/finality-provider-phase-3 +++ b/finality-provider-phase-3 @@ -1 +1 @@ -Subproject commit b19c5b329e94e96471c887c977b6f18366fdb7ef +Subproject commit f656358384b8d3411bff4b2e1105683dc417320d From f82d7b529a4fa0fd96a83bbb56dfc5d094dd87e6 Mon Sep 17 00:00:00 2001 From: Runchao Han Date: Wed, 14 Aug 2024 11:54:39 +1000 Subject: [PATCH 7/9] bump --- contrib/images/ibcsim-bcd/Dockerfile | 2 +- finality-provider-phase-3 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/images/ibcsim-bcd/Dockerfile b/contrib/images/ibcsim-bcd/Dockerfile index f2146c60..d7e2c2ad 100644 --- a/contrib/images/ibcsim-bcd/Dockerfile +++ b/contrib/images/ibcsim-bcd/Dockerfile @@ -20,7 +20,7 @@ WORKDIR /work ENV GO111MODULE on ENV RELAYER_TAG v2.5.2 -ENV BABYLON_SDK_TAG bump-contract +ENV BABYLON_SDK_TAG v0.3.0-rc.0 # Install the relayer RUN git clone https://github.com/cosmos/relayer.git diff --git a/finality-provider-phase-3 b/finality-provider-phase-3 index f6563583..06bc78ae 160000 --- a/finality-provider-phase-3 +++ b/finality-provider-phase-3 @@ -1 +1 @@ -Subproject commit f656358384b8d3411bff4b2e1105683dc417320d +Subproject commit 06bc78aeec0f029dad65e39e884a04a1e60fe570 From ff4620d85ab507537be97b1638dbfe318349f66a Mon Sep 17 00:00:00 2001 From: Runchao Han Date: Wed, 14 Aug 2024 14:36:12 +1000 Subject: [PATCH 8/9] fp bump --- finality-provider-phase-3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/finality-provider-phase-3 b/finality-provider-phase-3 index 06bc78ae..9956b7bf 160000 --- a/finality-provider-phase-3 +++ b/finality-provider-phase-3 @@ -1 +1 @@ -Subproject commit 06bc78aeec0f029dad65e39e884a04a1e60fe570 +Subproject commit 9956b7bf429b465e89f3e178ef91def1c6e8c12b From b191d09f3c3f2fd4dd83d420dd7e660afaf92141 Mon Sep 17 00:00:00 2001 From: Runchao Han Date: Wed, 14 Aug 2024 14:39:16 +1000 Subject: [PATCH 9/9] bump vigilante --- vigilante | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vigilante b/vigilante index 1bf10b01..e42be2f3 160000 --- a/vigilante +++ b/vigilante @@ -1 +1 @@ -Subproject commit 1bf10b01b9e5f9eaf89d4c41c96ea550b8e2b427 +Subproject commit e42be2f3c04c8de4abc6b8fbcae849e2f7e20850