diff --git a/.github/workflows/aws-ecr.yml b/.github/workflows/aws-ecr.yml index 2ebc1d50..eb5cdcf0 100644 --- a/.github/workflows/aws-ecr.yml +++ b/.github/workflows/aws-ecr.yml @@ -54,4 +54,4 @@ jobs: tags: ${{ steps.meta.outputs.tags }} cache-from: type=gha cache-to: type=gha,mode=max - target: xion-release + target: release diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 19581b15..20d64620 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -49,7 +49,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} cache-from: type=gha cache-to: type=gha,mode=max - target: xion-release + target: release build-dev: name: Build Dev Image @@ -90,4 +90,4 @@ jobs: tags: ${{ steps.meta.outputs.tags }} cache-from: type=gha cache-to: type=gha,mode=max - target: xion-dev + target: dev diff --git a/.github/workflows/docker-scout.yml b/.github/workflows/docker-scout.yml index b08ade62..86b6de94 100644 --- a/.github/workflows/docker-scout.yml +++ b/.github/workflows/docker-scout.yml @@ -45,7 +45,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} cache-from: type=gha cache-to: type=gha,mode=max - target: xion-release + target: release - name: Run Docker Scout uses: docker/scout-action@v1 diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index dbc91e0b..13e26c71 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -32,4 +32,4 @@ jobs: uses: golangci/golangci-lint-action@v4 with: version: latest - args: --timeout 10m + args: --timeout=10m --tests=false diff --git a/.github/workflows/heighliner.yml b/.github/workflows/heighliner.yml new file mode 100644 index 00000000..421f5877 --- /dev/null +++ b/.github/workflows/heighliner.yml @@ -0,0 +1,61 @@ +name: Heighliner Build + +on: + push: + branches: + - main + tags: + - '*' + pull_request: + workflow_dispatch: + +env: + REGISTRY: ghcr.io + +jobs: + heighliner: + permissions: + contents: read + packages: write + runs-on: ubuntu-latest + + steps: + + - name: checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: container-login + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata for docker using shell + id: shell_meta + run: | + SHA=$(git rev-parse --short HEAD) + echo "SHA=$SHA" >> $GITHUB_ENV + echo "::set-output name=sha::sha-$SHA" + + - name: Build Heighliner image + id: heighliner + uses: burnt-labs/heighliner-action@v1.0.0-alpha10 + with: + local: true + tag: ${{ steps.shell_meta.outputs.sha }} + chain: xion + github-organization: burnt-labs + github-repo: xion + dockerfile: cosmos + build-target: make install + binaries: '["/go/bin/xiond"]' + build-env: '["BUILD_TAGS=muslc"]' + + - name: Push Heighliner image + run: | + docker tag ${{ steps.heighliner.outputs.tag }} ghcr.io/burnt-labs/xion/${{ steps.heighliner.outputs.tag }} + docker push ghcr.io/burnt-labs/xion/${{ steps.heighliner.outputs.tag }} diff --git a/Dockerfile b/Dockerfile index 4103a2fd..17f85cb7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,53 +1,45 @@ -FROM golang:1.21-alpine3.18 AS go-builder -ARG arch=x86_64 +# syntax=docker/dockerfile:1 -ENV WASMVM_VERSION=v1.5.2 -ENV WASMVM_CHECKSUM_AARCH64=e78b224c15964817a3b75a40e59882b4d0e06fd055b39514d61646689cef8c6e -ENV WASMVM_CHECKSUM_x86_64=e660a38efb2930b34ee6f6b0bb12730adccb040b6ab701b8f82f34453a426ae7 +# -------------------------------------------------------- +# Builder +# -------------------------------------------------------- -RUN set -euxo pipefail \ - && apk add --no-cache \ - ca-certificates \ +FROM golang:1.21-alpine3.18 AS builder + +RUN apk add --no-cache \ + ca-certificates \ build-base \ + linux-headers \ git -# NOTE: add these to run with LEDGER_ENABLED=true -# RUN apk add libusb-dev linux-headers - -WORKDIR /code -COPY go.mod /code/ -COPY go.sum /code/ -RUN go mod download - -COPY ./.git /code/.git -COPY ./app /code/app -COPY ./cmd /code/cmd -COPY ./contrib /code/contrib -COPY ./proto /code/proto -COPY ./x /code/x -COPY ./wasmbindings /code/wasmbindings -COPY Makefile /code/ - -# See https://github.com/CosmWasm/wasmvm/releases -ADD https://github.com/CosmWasm/wasmvm/releases/download/${WASMVM_VERSION}/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a -ADD https://github.com/CosmWasm/wasmvm/releases/download/${WASMVM_VERSION}/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a -RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep ${WASMVM_CHECKSUM_AARCH64} -RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep ${WASMVM_CHECKSUM_x86_64} - -# Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc` -RUN cp -vf /lib/libwasmvm_muslc.${arch}.a /lib/libwasmvm_muslc.a - -# force it to use static lib (from above) not standard libgo_cosmwasm.so file -RUN set -eux \ - && make test-version \ - && LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build - -RUN echo "Ensuring binary is statically linked ..." \ - && (file /code/build/xiond | grep "statically linked") +# Download go dependencies +WORKDIR /xion +COPY go.mod go.sum ./ +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/root/go/pkg/mod \ + go mod download + +# Cosmwasm - Download correct libwasmvm version +RUN WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | cut -d ' ' -f 2) && \ + wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$(uname -m).a \ + -O /lib/libwasmvm_muslc.a && \ + # verify checksum + wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \ + sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$(uname -m) | cut -d ' ' -f 1) + +# Build xiond binary +COPY . . +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/root/go/pkg/mod \ + make test-version \ + && LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build # -------------------------------------------------------- +# Runner +# -------------------------------------------------------- + FROM alpine:3.19.1 AS xion-base -COPY --from=go-builder /code/build/xiond /usr/bin/xiond +COPY --from=builder /xion/build/xiond /usr/bin/xiond # api EXPOSE 1317 @@ -72,7 +64,7 @@ RUN set -euxo pipefail \ tini # -------------------------------------------------------- -FROM xion-base AS xion-dev +FROM xion-base AS dev COPY ./docker/entrypoint.sh /home/xiond/entrypoint.sh WORKDIR /home/xiond/ @@ -80,7 +72,7 @@ WORKDIR /home/xiond/ CMD ["/home/xiond/entrypoint.sh"] # -------------------------------------------------------- -FROM xion-base as xion-release +FROM xion-base AS release RUN set -euxo pipefail \ && addgroup -S xiond \ diff --git a/Makefile b/Makefile index 12774886..ce29ab9a 100644 --- a/Makefile +++ b/Makefile @@ -167,15 +167,15 @@ test-integration-xion-token-factory: compile_integration_tests test-integration-min: @XION_IMAGE=$(XION_IMAGE) cd integration_tests && go test -v -run TestXionMinimumFeeDefault -mod=readonly -tags='ledger test_ledger_mock' ./... -test-integration-mig: - @XION_IMAGE=$(XION_IMAGE) cd integration_tests && go test -v -run TestAbstractAccountMigration -mod=readonly -tags='ledger test_ledger_mock' ./... - test-integration-web-auth-n-abstract-account: compile_integration_tests @XION_IMAGE=$(XION_IMAGE) ./integration_tests/integration_tests.test -test.failfast -test.v -test.run WebAuthNAbstractAccount test-integration-upgrade: @XION_IMAGE=$(XION_IMAGE) cd integration_tests && go test -v -run TestXionUpgradeIBC -mod=readonly -tags='ledger test_ledger_mock' ./... +test-integration-xion-mig: compile_integration_tests + @XION_IMAGE=$(XION_IMAGE) ./integration_tests/integration_tests.test -test.failfast -test.v -test.run TestAbstractAccountMigration + test-race: @VERSION=$(VERSION) go test -mod=readonly -race -tags='ledger test_ledger_mock' ./... diff --git a/app/app.go b/app/app.go index 80a2ec10..bd1cea1f 100644 --- a/app/app.go +++ b/app/app.go @@ -617,14 +617,6 @@ func NewWasmApp( authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - app.XionKeeper = xionkeeper.NewKeeper( - appCodec, - keys[xiontypes.StoreKey], - app.GetSubspace(xiontypes.ModuleName), - app.BankKeeper, - app.AccountKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String()) - // Configure the hooks keeper hooksKeeper := ibchookskeeper.NewKeeper( keys[ibchookstypes.StoreKey], @@ -742,6 +734,20 @@ func NewWasmApp( authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) + app.ContractKeeper = wasmkeeper.NewDefaultPermissionKeeper(app.WasmKeeper) + app.Ics20WasmHooks.ContractKeeper = &app.WasmKeeper + + app.XionKeeper = xionkeeper.NewKeeper( + appCodec, + keys[xiontypes.StoreKey], + app.GetSubspace(xiontypes.ModuleName), + app.BankKeeper, + app.AccountKeeper, + app.ContractKeeper, + app.WasmKeeper, + app.AbstractAccountKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String()) + // Set legacy router for backwards compatibility with gov v1beta1 app.GovKeeper.SetLegacyRouter(govRouter) @@ -821,11 +827,11 @@ func NewWasmApp( nftmodule.NewAppModule(appCodec, app.NFTKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(tokenfactorytypes.ModuleName)), - xion.NewAppModule(app.XionKeeper), jwk.NewAppModule(appCodec, app.JwkKeeper, app.GetSubspace(jwktypes.ModuleName)), globalfee.NewAppModule(app.GetSubspace(globalfee.ModuleName)), wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), aa.NewAppModule(app.AbstractAccountKeeper), + xion.NewAppModule(app.XionKeeper), ibc.NewAppModule(app.IBCKeeper), transfer.NewAppModule(app.TransferKeeper), ibcfee.NewAppModule(app.IBCFeeKeeper), @@ -851,7 +857,6 @@ func NewWasmApp( vestingtypes.ModuleName, consensusparamtypes.ModuleName, tokenfactorytypes.ModuleName, globalfee.ModuleName, - xiontypes.ModuleName, jwktypes.ModuleName, // additional non simd modules ibctransfertypes.ModuleName, @@ -861,6 +866,7 @@ func NewWasmApp( ibcfeetypes.ModuleName, wasmtypes.ModuleName, aatypes.ModuleName, + xiontypes.ModuleName, ibchookstypes.ModuleName, packetforwardtypes.ModuleName, ) diff --git a/app/upgrades/v6/upgrades.go b/app/upgrades/v6/upgrades.go index 48b975a9..27d4d90b 100644 --- a/app/upgrades/v6/upgrades.go +++ b/app/upgrades/v6/upgrades.go @@ -6,12 +6,6 @@ import ( upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) -/* -const NewDenomCreationGasConsume uint64 = 2_000_000 - -var DenomCreationFee = sdk.NewCoins(sdk.NewInt64Coin(`uxion`, 50_000_000)) -*/ - func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, @@ -24,7 +18,7 @@ func CreateUpgradeHandler( return vm, err } - ctx.Logger().Info("Upgrade complete") + ctx.Logger().Info("Upgrade v6 complete") return vm, err } } diff --git a/docker-compose.yml b/docker-compose.yml index 427043df..d0efb0e9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,30 +2,25 @@ version: "3.9" services: testnet: + image: burnt/xion:develop build: context: . dockerfile: Dockerfile - target: xion-dev + target: dev platform: linux/amd64 - volumes: - - testnet-data:/xion/ ports: - "1317:1317" - "26656:26656" - "26657:26657" release: + image: burnt/xion:release build: context: . dockerfile: Dockerfile - target: xion-release + target: release platform: linux/amd64 - volumes: - - testnet-data:/xion/data ports: - "1317:1317" - "26656:26656" - "26657:26657" - -volumes: - testnet-data: diff --git a/go.mod b/go.mod index 5e224f24..03f0f1a4 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/iavl v0.20.1 // indirect - github.com/cosmos/ibc-go/v7 v7.3.1 + github.com/cosmos/ibc-go/v7 v7.4.0 github.com/cosmos/ics23/go v0.10.0 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect github.com/dvsekhvalnov/jose2go v1.6.0 @@ -20,7 +20,6 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.16.0 github.com/rakyll/statik v0.1.7 // indirect - github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa github.com/spf13/cast v1.5.1 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 // indirect @@ -57,13 +56,11 @@ require ( ) require ( - github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.0.0 // indirect - github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20231213092633-b306e7a706e1 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/goccy/go-json v0.10.2 // indirect github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect - github.com/skip-mev/pob v1.0.4 // indirect + github.com/opencontainers/runc v1.1.5 // indirect go.opentelemetry.io/otel v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect @@ -218,6 +215,9 @@ require ( replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 + + github.com/CosmWasm/wasmd => github.com/burnt-labs/wasmd v0.45.1-0.20240312170141-3dfd94af17a8 + github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 => github.com/burnt-labs/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3-0.20240308232808-736bd51c54ad // dgrijalva/jwt-go is deprecated and doesn't receive security updates. // See: https://github.com/cosmos/cosmos-sdk/issues/13134 diff --git a/go.sum b/go.sum index ff58b7a2..4b3ac6ab 100644 --- a/go.sum +++ b/go.sum @@ -212,8 +212,6 @@ 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/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= -github.com/CosmWasm/wasmd v0.45.0 h1:9zBqrturKJwC2kVsfHvbrA++EN0PS7UTXCffCGbg6JI= -github.com/CosmWasm/wasmd v0.45.0/go.mod h1:RnSAiqbNIZu4QhO+0pd7qGZgnYAMBPGmXpzTADag944= github.com/CosmWasm/wasmvm v1.5.2 h1:+pKB1Mz9GZVt1vadxB+EDdD1FOz3dMNjIKq/58/lrag= github.com/CosmWasm/wasmvm v1.5.2/go.mod h1:Q0bSEtlktzh7W2hhEaifrFp1Erx11ckQZmjq8FLCyys= github.com/CosmosContracts/juno/v21 v21.0.0 h1:/hGHItwTnNn1sJFhjp+0X0e0lgTQlmYJ6wWHgS8xNpo= @@ -275,6 +273,8 @@ github.com/burnt-labs/abstract-account v0.0.0-20240202022305-255071ed91ee h1:04D github.com/burnt-labs/abstract-account v0.0.0-20240202022305-255071ed91ee/go.mod h1:R+/UYwxE92VUFOWLyyuBa2RRI2lUwb9uHwRWDBrNzx0= github.com/burnt-labs/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3-0.20240308232808-736bd51c54ad h1:nDgtQvVt9MR4h6O/4nD6BUZUrIU+JF3y3Ec4TuAeLLc= github.com/burnt-labs/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3-0.20240308232808-736bd51c54ad/go.mod h1:UvDmcGIWJPIytq+Q78/ff5NTOsuX/7IrNgEugTW5i0s= +github.com/burnt-labs/wasmd v0.45.1-0.20240312170141-3dfd94af17a8 h1:wDyW7USxarGYN8fgTOT2cwWjqTM2AYk5qL/necMPzCU= +github.com/burnt-labs/wasmd v0.45.1-0.20240312170141-3dfd94af17a8/go.mod h1:RnSAiqbNIZu4QhO+0pd7qGZgnYAMBPGmXpzTADag944= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -287,6 +287,7 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= @@ -297,6 +298,7 @@ github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObk github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= +github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= @@ -328,12 +330,14 @@ github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWa github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= +github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= @@ -358,8 +362,8 @@ github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230803181732-7c8f814d3b github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230803181732-7c8f814d3b79/go.mod h1:JwHFbo1oX/ht4fPpnPvmhZr+dCkYK1Vihw+vZE9umR4= github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20231213092633-b306e7a706e1 h1:fCtG9qasnNzhgxGR1jM9eBufZ5WQVpy0KdaOpKRfg8Y= github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20231213092633-b306e7a706e1/go.mod h1:h114vYKBtI5zKBeSyr8y5JZ8ZtpQJInO4TYww2IQr6o= -github.com/cosmos/ibc-go/v7 v7.3.1 h1:bil1IjnHdyWDASFYKfwdRiNtFP6WK3osW7QFEAgU4I8= -github.com/cosmos/ibc-go/v7 v7.3.1/go.mod h1:wvx4pPBofe5ZdMNV3OFRxSI4auEP5Qfqf8JXLLNV04g= +github.com/cosmos/ibc-go/v7 v7.4.0 h1:8FqYMptvksgMvlbN4UW9jFxTXzsPyfAzEZurujXac8M= +github.com/cosmos/ibc-go/v7 v7.4.0/go.mod h1:L/KaEhzV5TGUCTfGysVgMBQtl5Dm7hHitfpk+GIeoAo= 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= @@ -375,6 +379,7 @@ github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJF github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -398,6 +403,7 @@ github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m3 github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -429,6 +435,7 @@ github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8 github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -492,6 +499,7 @@ github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MG github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= @@ -815,6 +823,7 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -822,6 +831,7 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -860,6 +870,8 @@ github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7X github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v1.1.5 h1:L44KXEpKmfWDcS02aeGm8QNTFXTo2D+8MYGDIJ/GDEs= github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= +github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -960,6 +972,7 @@ github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0 github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -967,14 +980,13 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skip-mev/pob v1.0.4 h1:Degz+Pdm9pCom16bbLawZhXi6PbYPiiJe6cGjBE5g30= github.com/skip-mev/pob v1.0.4/go.mod h1:tpZivmkiDgCO6O79qBnK4eJQjuJeR9yUzc1jPlGaE1s= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa h1:YJfZp12Z3AFhSBeXOlv4BO55RMwPn2NoQeDsrdWnBtY= -github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -1024,6 +1036,7 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= @@ -1042,6 +1055,8 @@ github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= +github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= @@ -1276,6 +1291,7 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1284,6 +1300,7 @@ golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1313,6 +1330,7 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1331,7 +1349,10 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/integration_tests/account_migration_test.go b/integration_tests/account_migration_test.go new file mode 100644 index 00000000..999f7bd2 --- /dev/null +++ b/integration_tests/account_migration_test.go @@ -0,0 +1,231 @@ +package integration_tests + +import ( + "context" + "crypto/sha256" + "encoding/base64" + "encoding/hex" + "encoding/json" + "fmt" + "os" + "path" + "testing" + "time" + + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + xionapp "github.com/burnt-labs/xion/app" + xiontypes "github.com/burnt-labs/xion/x/xion/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/types" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/golang-jwt/jwt/v4" + aatypes "github.com/larry0x/abstract-account/x/abstractaccount/types" + "github.com/lestrrat-go/jwx/jwk" + ibctest "github.com/strangelove-ventures/interchaintest/v7" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + "github.com/strangelove-ventures/interchaintest/v7/testutil" + "github.com/stretchr/testify/require" +) + +func TestAbstractAccountMigration(t *testing.T) { + if testing.Short() { + t.Skip("skipping in short mode") + } + t.Parallel() + + td := BuildXionChain(t, "0.0uxion", ModifyInterChainGenesis(ModifyInterChainGenesisFn{ModifyGenesisShortProposals, ModifyGenesisAAAllowedCodeIDs}, [][]string{{votingPeriod, maxDepositPeriod}, {votingPeriod, maxDepositPeriod}})) + xion, ctx := td.xionChain, td.ctx + + config := types.GetConfig() + config.SetBech32PrefixForAccount("xion", "xionpub") + + // Create and Fund User Wallets + t.Log("creating and funding user accounts") + fundAmount := int64(10_000_000) + users := ibctest.GetAndFundTestUsers(t, ctx, "default", fundAmount, xion) + xionUser := users[0] + err := testutil.WaitForBlocks(ctx, 8, xion) + require.NoError(t, err) + t.Logf("created xion user %s", xionUser.FormattedAddress()) + + xionUserBalInitial, err := xion.GetBalance(ctx, xionUser.FormattedAddress(), xion.Config().Denom) + require.NoError(t, err) + require.Equal(t, fundAmount, xionUserBalInitial) + + // register any needed msg types + xion.Config().EncodingConfig.InterfaceRegistry.RegisterImplementations( + (*types.Msg)(nil), + &xiontypes.MsgSetPlatformPercentage{}, + &xiontypes.MsgSend{}, + &wasmtypes.MsgInstantiateContract{}, + &wasmtypes.MsgStoreCode{}, + &aatypes.MsgUpdateParams{}, + &aatypes.MsgRegisterAccount{}, + ) + xion.Config().EncodingConfig.InterfaceRegistry.RegisterImplementations((*authtypes.AccountI)(nil), &aatypes.AbstractAccount{}) + xion.Config().EncodingConfig.InterfaceRegistry.RegisterImplementations((*cryptotypes.PubKey)(nil), &aatypes.NilPubKey{}) + + // prepare the JWT key and data + fp, err := os.Getwd() + require.NoError(t, err) + + // deploy the contract + codeIDStr, err := xion.StoreContract(ctx, xionUser.FormattedAddress(), + path.Join(fp, "integration_tests", "testdata", "contracts", "account_updatable-aarch64-previous.wasm")) + require.NoError(t, err) + + predictedAddrs := addAccounts(t, ctx, xion, 50, codeIDStr, xionUser) + + // deploy the new contract + newCodeIDStr, err := xion.StoreContract(ctx, xionUser.FormattedAddress(), + path.Join(fp, "integration_tests", "testdata", "contracts", "account_updatable-aarch64.wasm")) + require.NoError(t, err) + + // retrieve the new hash + newCodeResp, err := ExecQuery(t, ctx, xion.FullNodes[0], + "wasm", "code-info", newCodeIDStr) + require.NoError(t, err) + t.Logf("code response: %s", newCodeResp) + + CosmosChainUpgradeTest(t, &td, "xion", "upgrade", "v6") + // todo: validate that verification or tx submission still works + + newCodeResp, err = ExecQuery(t, ctx, td.xionChain.FullNodes[0], + "wasm", "code-info", newCodeIDStr) + require.NoError(t, err) + t.Logf("code response: %+v", newCodeResp) + + err = testutil.WaitForBlocks(ctx, int(blocksAfterUpgrade), td.xionChain) + require.NoError(t, err, "chain did not produce blocks after upgrade") + + for _, predictedAddr := range predictedAddrs { + rawUpdatedContractInfo, err := ExecQuery(t, ctx, td.xionChain.FullNodes[0], + "wasm", "contract", predictedAddr.String()) + require.NoError(t, err) + t.Logf("updated contract info: %s", rawUpdatedContractInfo) + + updatedContractInfo := rawUpdatedContractInfo["contract_info"].(map[string]interface{}) + updatedCodeID := updatedContractInfo["code_id"].(string) + require.Equal(t, updatedCodeID, newCodeIDStr) + } +} + +func addAccounts(t *testing.T, ctx context.Context, xion *cosmos.CosmosChain, noOfAccounts int, codeIDStr string, xionUser ibc.Wallet) []sdk.AccAddress { + predictedAddrs := make([]sdk.AccAddress, 0) + sub := "integration-test-user" + aud := "integration-test-project" + + authenticatorDetails := map[string]string{} + authenticatorDetails["sub"] = sub + authenticatorDetails["aud"] = aud + + authenticator := map[string]interface{}{} + authenticator["Jwt"] = authenticatorDetails + + instantiateMsg := map[string]interface{}{} + instantiateMsg["id"] = 0 + instantiateMsg["authenticator"] = authenticator + + codeResp, err := ExecQuery(t, ctx, xion.FullNodes[0], + "wasm", "code-info", codeIDStr) + require.NoError(t, err) + t.Logf("code response: %s", codeResp) + + for i := 0; i < noOfAccounts; i++ { + salt := fmt.Sprintf("%d", i) + creatorAddr := types.AccAddress(xionUser.Address()) + codeHash, err := hex.DecodeString(codeResp["data_hash"].(string)) + require.NoError(t, err) + predictedAddr := wasmkeeper.BuildContractAddressPredictable(codeHash, creatorAddr, []byte(salt), []byte{}) + t.Logf("predicted address: %s", predictedAddr.String()) + + privateKeyBz, err := os.ReadFile("./integration_tests/testdata/keys/jwtRS256.key") + require.NoError(t, err) + privateKey, err := jwt.ParseRSAPrivateKeyFromPEM(privateKeyBz) + require.NoError(t, err) + t.Logf("private key: %v", privateKey) + + publicKey, err := jwk.New(privateKey) + require.NoError(t, err) + publicKeyJSON, err := json.Marshal(publicKey) + require.NoError(t, err) + t.Logf("public key: %s", publicKeyJSON) + + // sha256 the contract addr, as it expects + signatureBz := sha256.Sum256([]byte(predictedAddr.String())) + signature := base64.StdEncoding.EncodeToString(signatureBz[:]) + + now := time.Now() + fiveAgo := now.Add(-time.Second * 5) + inFive := now.Add(time.Minute * 5) + + auds := jwt.ClaimStrings{aud} + token := jwt.NewWithClaims(jwt.SigningMethodRS256, jwt.MapClaims{ + "iss": aud, + "sub": sub, + "aud": auds, + "exp": inFive.Unix(), + "nbf": fiveAgo.Unix(), + "iat": fiveAgo.Unix(), + "transaction_hash": signature, + }) + t.Logf("jwt claims: %v", token) + + // sign the JWT with the predefined key + output, err := token.SignedString(privateKey) + require.NoError(t, err) + t.Logf("signed token: %s", output) + + instantiateMsg["signature"] = []byte(output) + instantiateMsgStr, err := json.Marshal(instantiateMsg) + require.NoError(t, err) + t.Logf("inst msg: %s", string(instantiateMsgStr)) + + // register the account + t.Logf("registering account: %s", instantiateMsgStr) + registerCmd := []string{ + "abstract-account", "register", + codeIDStr, string(instantiateMsgStr), + "--salt", salt, + "--funds", "10000uxion", + "--chain-id", xion.Config().ChainID, + } + t.Logf("sender: %s", xionUser.FormattedAddress()) + t.Logf("register cmd: %s", registerCmd) + + txHash, err := ExecTx(t, ctx, xion.FullNodes[0], xionUser.KeyName(), registerCmd...) + require.NoError(t, err) + t.Logf("tx hash: %s", txHash) + + contractsResponse, err := ExecQuery(t, ctx, xion.FullNodes[0], "wasm", "contracts", codeIDStr) + require.NoError(t, err) + + contract := contractsResponse["contracts"].([]interface{})[0].(string) + + err = testutil.WaitForBlocks(ctx, 1, xion) + require.NoError(t, err) + newBalance, err := xion.GetBalance(ctx, contract, xion.Config().Denom) + require.NoError(t, err) + require.Equal(t, int64(10_000), newBalance) + + // get the account from the chain. there might be a better way to do this + accountResponse, err := ExecQuery(t, ctx, xion.FullNodes[0], + "account", contract) + require.NoError(t, err) + t.Logf("account response: %s", accountResponse) + + delete(accountResponse, "@type") + var account aatypes.AbstractAccount + accountJSON, err := json.Marshal(accountResponse) + require.NoError(t, err) + + encodingConfig := xionapp.MakeEncodingConfig() + err = encodingConfig.Marshaler.UnmarshalJSON(accountJSON, &account) + require.NoError(t, err) + predictedAddrs = append(predictedAddrs, predictedAddr) + } + return predictedAddrs +} diff --git a/integration_tests/configuredChains.yaml b/integration_tests/configuredChains.yaml new file mode 100644 index 00000000..56a7fe70 --- /dev/null +++ b/integration_tests/configuredChains.yaml @@ -0,0 +1,45 @@ +## NOTICE: This file gets embedded into interchaintest binary. +## Set the environment variable: IBCTEST_CONFIGURED_CHAINS to a path +## to use custom versions of this file + +axelar: + name: axelar + type: cosmos + bin: axelard + bech32-prefix: axelar + denom: uaxl + gas-prices: 0.01uaxl + gas-adjustment: 1.3 + trusting-period: 168h + images: + - repository: ghcr.io/strangelove-ventures/heighliner/axelar + uid-gid: 1025:1025 + no-host-mount: false + +osmosis: + name: osmosis + type: cosmos + bin: osmosisd + bech32-prefix: osmo + denom: uosmo + gas-prices: 0.0025uosmo + gas-adjustment: 1.3 + trusting-period: 336h + images: + - repository: ghcr.io/strangelove-ventures/heighliner/osmosis + uid-gid: 1025:1025 + no-host-mount: false + +xion: + name: xion + type: cosmos + bin: xiond + bech32-prefix: xion + denom: uxion + gas-prices: 0.0uxion + gas-adjustment: 1.3 + trusting-period: 336h + images: + - repository: ghcr.io/burnt-labs/xion/xion + uid-gid: 1025:1025 + no-host-mount: false diff --git a/integration_tests/go.mod b/integration_tests/go.mod index 87c26857..0526002e 100644 --- a/integration_tests/go.mod +++ b/integration_tests/go.mod @@ -8,7 +8,7 @@ require ( github.com/CosmosContracts/juno/v21 v21.0.0 github.com/burnt-labs/xion v0.1.0 github.com/cosmos/cosmos-sdk v0.47.10 - github.com/cosmos/ibc-go/v7 v7.3.1 + github.com/cosmos/ibc-go/v7 v7.4.0 github.com/docker/docker v24.0.4+incompatible github.com/golang-jwt/jwt/v4 v4.3.0 github.com/icza/dyno v0.0.0-20220812133438-f0b6f8a18845 @@ -71,9 +71,7 @@ require ( github.com/cosmos/gogoproto v1.4.10 // indirect github.com/cosmos/iavl v0.20.1 // indirect github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3-0.20240228213828-cce7f56d000b // indirect - github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.0.0 // indirect github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230803181732-7c8f814d3b79 // indirect - github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20231213092633-b306e7a706e1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect @@ -209,7 +207,6 @@ require ( github.com/rs/zerolog v1.32.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/segmentio/asm v1.2.0 // indirect - github.com/skip-mev/pob v1.0.4 // indirect github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.9.5 // indirect @@ -278,7 +275,7 @@ replace ( github.com/cometbft/cometbft => github.com/cometbft/cometbft v0.37.2 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/larry0x/abstract-account => github.com/burnt-labs/abstract-account v0.0.0-20240202022305-255071ed91ee - github.com/strangelove-ventures/interchaintest/v7 => github.com/burnt-labs/interchaintest/v7 v7.0.0-20230725204927-990da9d6e272 + github.com/strangelove-ventures/interchaintest/v7 => github.com/burnt-labs/interchaintest/v7 v7.0.0-20240415152002-a4ca94b373df github.com/vedhavyas/go-subkey => github.com/strangelove-ventures/go-subkey v1.0.7 github.com/vektra/mockery/v2 => github.com/vektra/mockery/v2 v2.14.0 ) diff --git a/integration_tests/go.sum b/integration_tests/go.sum index 3eb60b10..e3e63624 100644 --- a/integration_tests/go.sum +++ b/integration_tests/go.sum @@ -295,8 +295,8 @@ github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZ github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/burnt-labs/abstract-account v0.0.0-20240202022305-255071ed91ee h1:04DdmDV4PnDOIyEeasOcu+fGDPzXpappY8Um8c+PSRI= github.com/burnt-labs/abstract-account v0.0.0-20240202022305-255071ed91ee/go.mod h1:R+/UYwxE92VUFOWLyyuBa2RRI2lUwb9uHwRWDBrNzx0= -github.com/burnt-labs/interchaintest/v7 v7.0.0-20230725204927-990da9d6e272 h1:R3QMfw3FomFGiuE+bg8snhyZP7ygMbPxwh/7awtJvgM= -github.com/burnt-labs/interchaintest/v7 v7.0.0-20230725204927-990da9d6e272/go.mod h1:WUglvTs5dOXiI7z+VRiVibkFcd2pvTfoDEcXnjYONrw= +github.com/burnt-labs/interchaintest/v7 v7.0.0-20240415152002-a4ca94b373df h1:Mi0X6W92Anp72BH9wFZQAsTBTbiLnU621HZ7pR2Sp4c= +github.com/burnt-labs/interchaintest/v7 v7.0.0-20240415152002-a4ca94b373df/go.mod h1:WUglvTs5dOXiI7z+VRiVibkFcd2pvTfoDEcXnjYONrw= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -384,8 +384,8 @@ github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230803181732-7c8f814d3b github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230803181732-7c8f814d3b79/go.mod h1:JwHFbo1oX/ht4fPpnPvmhZr+dCkYK1Vihw+vZE9umR4= github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20231213092633-b306e7a706e1 h1:fCtG9qasnNzhgxGR1jM9eBufZ5WQVpy0KdaOpKRfg8Y= github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20231213092633-b306e7a706e1/go.mod h1:h114vYKBtI5zKBeSyr8y5JZ8ZtpQJInO4TYww2IQr6o= -github.com/cosmos/ibc-go/v7 v7.3.1 h1:bil1IjnHdyWDASFYKfwdRiNtFP6WK3osW7QFEAgU4I8= -github.com/cosmos/ibc-go/v7 v7.3.1/go.mod h1:wvx4pPBofe5ZdMNV3OFRxSI4auEP5Qfqf8JXLLNV04g= +github.com/cosmos/ibc-go/v7 v7.4.0 h1:8FqYMptvksgMvlbN4UW9jFxTXzsPyfAzEZurujXac8M= +github.com/cosmos/ibc-go/v7 v7.4.0/go.mod h1:L/KaEhzV5TGUCTfGysVgMBQtl5Dm7hHitfpk+GIeoAo= 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/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= diff --git a/integration_tests/testdata/contracts/account_updatable-aarch64-previous.wasm b/integration_tests/testdata/contracts/account_updatable-aarch64-previous.wasm new file mode 100644 index 00000000..13ddb4fa Binary files /dev/null and b/integration_tests/testdata/contracts/account_updatable-aarch64-previous.wasm differ diff --git a/integration_tests/upgrade_ibc_test.go b/integration_tests/upgrade_ibc_test.go new file mode 100644 index 00000000..f30b277c --- /dev/null +++ b/integration_tests/upgrade_ibc_test.go @@ -0,0 +1,276 @@ +package integration_tests + +import ( + "context" + "fmt" + "os" + "testing" + "time" + + "github.com/strangelove-ventures/interchaintest/v7/testutil" + + "github.com/docker/docker/client" + "github.com/strangelove-ventures/interchaintest/v7/conformance" + "github.com/strangelove-ventures/interchaintest/v7/relayer" + "github.com/strangelove-ventures/interchaintest/v7/relayer/rly" + + "github.com/strangelove-ventures/interchaintest/v7" + "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" + "github.com/strangelove-ventures/interchaintest/v7/ibc" + "github.com/strangelove-ventures/interchaintest/v7/testreporter" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zaptest" +) + +// TestXionUpgradeIBC tests a Xion software upgrade, ensuring IBC conformance prior-to and after the upgrade. +func TestXionUpgradeIBC(t *testing.T) { + t.Parallel() + ctx := context.Background() + + // Setup loggers and reporters + f, err := interchaintest.CreateLogFile(fmt.Sprintf("%d.json", time.Now().Unix())) + require.NoError(t, err) + rep := testreporter.NewReporter(f) + eRep := rep.RelayerExecReporter(t) + + // Build RelayerFactory + rlyImage := relayer.CustomDockerImage("ghcr.io/cosmos/relayer", "main", rly.RlyDefaultUidGid) + rf := interchaintest.NewBuiltinRelayerFactory(ibc.CosmosRly, zaptest.NewLogger(t), rlyImage) + + // Configure Chains + chains := ConfigureChains(t, 1, 2) + + // Define Test cases + testCases := []struct { + name string + setup func(t *testing.T, path string, dockerClient *client.Client, dockerNetwork string) (ibc.Chain, ibc.Chain, *interchaintest.Interchain, ibc.Relayer) + conformance func(t *testing.T, ctx context.Context, client *client.Client, network string, srcChain, dstChain ibc.Chain, rf interchaintest.RelayerFactory, rep *testreporter.Reporter, relayerImpl ibc.Relayer, pathNames ...string) + upgrade func(t *testing.T, chain *cosmos.CosmosChain, upgradeName string, dockerClient *client.Client, dockerImageRepo, dockerImageVersion string) + upgradeName string + upgradeImageVersion string + }{ + { + name: "xion-osmosis", + setup: func(t *testing.T, path string, dockerClient *client.Client, dockerNetwork string) (ibc.Chain, ibc.Chain, *interchaintest.Interchain, ibc.Relayer) { + xion, osmosis := chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain) + r := rf.Build(t, dockerClient, dockerNetwork) + ic := SetupInterchain(t, xion, osmosis, path, r, eRep, dockerClient, dockerNetwork) + return xion, osmosis, ic, r + }, + conformance: conformance.TestChainPair, + upgrade: SoftwareUpgrade, + upgradeName: "v6", + upgradeImageVersion: "sha-f7f7132", + }, + //{ + // name: "xion-axelar", + // setup: func(t *testing.T, path string, dockerClient *client.Client, dockerNetwork string) (ibc.Chain, ibc.Chain, *interchaintest.Interchain, ibc.Relayer) { + // xion, axelar := chains[0].(*cosmos.CosmosChain), chains[2].(*cosmos.CosmosChain) + // r := rf.Build(t, dockerClient, dockerNetwork) + // ic := SetupInterchain(t, xion, axelar, path, r, eRep, dockerClient, dockerNetwork) + // return xion, axelar, ic, r + // }, + // conformance: conformance.TestChainPair, + // upgrade: SoftwareUpgrade, + //}, + } + + // Run tests + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + dockerClient, dockerNetwork := interchaintest.DockerSetup(t) + xion, counterparty, ichain, rlyr := tc.setup(t, tc.name, dockerClient, dockerNetwork) + defer ichain.Close() + tc.conformance(t, ctx, dockerClient, dockerNetwork, xion, counterparty, rf, rep, rlyr, tc.name) + x := xion.(*cosmos.CosmosChain) + tc.upgrade(t, x, tc.upgradeName, dockerClient, "ghcr.io/burnt-labs/xion/xion", tc.upgradeImageVersion) + tc.conformance(t, ctx, dockerClient, dockerNetwork, xion, counterparty, rf, rep, rlyr, tc.name) + }) + } +} + +// ConfigureChains creates a slice of ibc.Chain with the given number of full nodes and validators. +func ConfigureChains(t *testing.T, numFullNodes, numValidators int) []ibc.Chain { + // must override Axelar's default override NoHostMount in yaml + // otherwise fails on `cp` on heighliner img as it's not available in the container + f := OverrideConfiguredChainsYaml(t) + defer os.Remove(f.Name()) + + cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{ + { + Name: "xion", + Version: "v0.3.8", + ChainConfig: ibc.ChainConfig{ + Images: []ibc.DockerImage{ + { + Repository: "ghcr.io/burnt-labs/xion/xion", + Version: "v0.3.8", + UidGid: "1025:1025", + }, + }, + GasPrices: "0.0uxion", + GasAdjustment: 1.3, + Type: "cosmos", + ChainID: "xion-1", + Bin: "xiond", + Bech32Prefix: "xion", + Denom: "uxion", + TrustingPeriod: "336h", + NoHostMount: false, + ModifyGenesis: ModifyInterChainGenesis(ModifyInterChainGenesisFn{ModifyGenesisShortProposals}, [][]string{{votingPeriod, maxDepositPeriod}}), + UsingNewGenesisCommand: true, + }, + NumValidators: &numValidators, + NumFullNodes: &numFullNodes, + }, + { + Name: "osmosis", + Version: "v24.0.0-rc0", + ChainConfig: ibc.ChainConfig{ + Images: []ibc.DockerImage{ + { + Repository: "ghcr.io/strangelove-ventures/heighliner/osmosis", + Version: "v24.0.0-rc0", + UidGid: "1025:1025", + }, + }, + Type: "cosmos", + Bin: "osmosisd", + Bech32Prefix: "osmo", + Denom: "uosmo", + GasPrices: "0.025uosmo", + GasAdjustment: 1.3, + TrustingPeriod: "336h", + NoHostMount: false, + }, + NumValidators: &numValidators, + NumFullNodes: &numFullNodes, + }, + { + Name: "axelar", + Version: "v0.35.3", + ChainConfig: ibc.ChainConfig{ + Images: []ibc.DockerImage{ + { + Repository: "ghcr.io/strangelove-ventures/heighliner/axelar", + Version: "v0.35.3", + UidGid: "1025:1025", + }, + }, + Type: "cosmos", + Bin: "axelard", + Bech32Prefix: "axelar", + Denom: "uaxl", + GasPrices: "0.007uaxl", + GasAdjustment: 1.3, + TrustingPeriod: "336h", + NoHostMount: false, + }, + NumValidators: &numValidators, + NumFullNodes: &numFullNodes, + }, + }) + + chains, err := cf.Chains(t.Name()) + require.NoError(t, err, "error creating chains") + + return chains +} + +// SetupInterchain builds an interchaintest.Interchain with the given chain pair and relayer. +func SetupInterchain( + t *testing.T, + xion ibc.Chain, + counterparty ibc.Chain, + path string, + r ibc.Relayer, + eRep *testreporter.RelayerExecReporter, + dockerClient *client.Client, + dockerNetwork string, +) *interchaintest.Interchain { + // Configure Interchain + ic := interchaintest.NewInterchain(). + AddChain(xion). + AddChain(counterparty). + AddRelayer(r, "rly"). + AddLink(interchaintest.InterchainLink{ + Chain1: xion, + Chain2: counterparty, + Relayer: r, + Path: path, + }) + + // Build Interchain + err := ic.Build(context.Background(), eRep, interchaintest.InterchainBuildOptions{ + TestName: t.Name(), + Client: dockerClient, + NetworkID: dockerNetwork, + BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(), + SkipPathCreation: false, + }) + + require.NoError(t, err) + return ic +} + +// SoftwareUpgrade submits, votes and performs a software upgrade govprop on the given chain. +func SoftwareUpgrade( + t *testing.T, + chain *cosmos.CosmosChain, + upgradeName string, + dockerClient *client.Client, + dockerImageRepo, dockerImageVersion string, +) { + ctx := context.Background() + + // fund user + fundAmount := int64(10_000_000_000) + users := interchaintest.GetAndFundTestUsers(t, ctx, "default", fundAmount, chain) + chainUser := users[0] + + // build software upgrade govprop + height, err := chain.Height(ctx) + require.NoErrorf(t, err, "couldn't get chain height for softwareUpgradeProposal: %v", err) + haltHeight := height + haltHeightDelta - 3 + softwareUpgradeProposal := cosmos.SoftwareUpgradeProposal{ + Deposit: fmt.Sprintf("%d%s", 10_000_000, chain.Config().Denom), + Title: fmt.Sprintf("Software Upgrade %s", upgradeName), + Name: upgradeName, + Description: fmt.Sprintf("Software Upgrade %s", upgradeName), + Height: haltHeight, + } + + // submit and vote on software upgrade + upgradeTx, err := chain.LegacyUpgradeProposal(ctx, chainUser.KeyName(), softwareUpgradeProposal) + require.NoErrorf(t, err, "couldn't submit software upgrade softwareUpgradeProposal tx: %v", err) + err = chain.VoteOnProposalAllValidators(ctx, upgradeTx.ProposalID, cosmos.ProposalVoteYes) + require.NoErrorf(t, err, "couldn't submit votes: %v", err) + _, err = cosmos.PollForProposalStatus(ctx, chain, height, height+haltHeightDelta, upgradeTx.ProposalID, cosmos.ProposalStatusPassed) + require.NoErrorf(t, err, "couldn't poll for softwareUpgradeProposal status: %v", err) + height, err = chain.Height(ctx) + require.NoErrorf(t, err, "couldn't get chain height: %v", err) + + timeoutCtx, timeoutCtxCancel := context.WithTimeout(ctx, time.Second*45) + defer timeoutCtxCancel() + + // confirm chain halt + _ = testutil.WaitForBlocks(timeoutCtx, int(haltHeight-height), chain) + height, err = chain.Height(ctx) + require.NoErrorf(t, err, "couldn't get chain height after chain should have halted: %v", err) + require.Equalf(t, haltHeight, height, "height: %d is not equal to halt height: %d", height, haltHeight) + + // upgrade all nodes + err = chain.StopAllNodes(ctx) + require.NoErrorf(t, err, "couldn't stop nodes: %v", err) + chain.UpgradeVersion(ctx, dockerClient, dockerImageRepo, dockerImageVersion) + + // reboot nodes + err = chain.StartAllNodes(ctx) + require.NoErrorf(t, err, "couldn't reboot nodes: %v", err) + + timeoutCtx, timeoutCtxCancel = context.WithTimeout(ctx, time.Second*45) + defer timeoutCtxCancel() + + err = testutil.WaitForBlocks(timeoutCtx, int(blocksAfterUpgrade), chain) + require.NoError(t, err, "chain did not produce blocks after upgrade") +} diff --git a/integration_tests/upgrade_test.go b/integration_tests/upgrade_test.go index d897c04b..02b7e3bb 100644 --- a/integration_tests/upgrade_test.go +++ b/integration_tests/upgrade_test.go @@ -6,9 +6,8 @@ import ( "testing" "time" - interchaintest "github.com/strangelove-ventures/interchaintest/v7" + "github.com/strangelove-ventures/interchaintest/v7" "github.com/strangelove-ventures/interchaintest/v7/chain/cosmos" - "github.com/strangelove-ventures/interchaintest/v7/ibc" "github.com/strangelove-ventures/interchaintest/v7/testutil" "github.com/stretchr/testify/require" ) @@ -26,28 +25,28 @@ const ( * 4- Build using heighliner pass in the flag `-t upgrade`. (for instructions on how to build check README.md on the root of the project) * 5- Mark upgrade name as the last parameter of the function * 6- cd integration_test -* 7- XION_IMAGE=[current version of the network] go test -run TestXionUpgradeIBC ./... +* 7- XION_IMAGE=[current version of the network] go test -run TestXionUpgrade ./... As of Aug 17 2023 this is the necessary process to run this test, this is due to the fact that AWS & docker-hub auto deleting old images, therefore you might lose what the version currently running is image wise current-testnet: v0.3.4 step between: v0.3.5 upgrade-version: v0.3.6 */ -func TestXionUpgradeIBC(t *testing.T) { +func TestXionUpgrade(t *testing.T) { t.Parallel() - td := BuildXionChain(t, "0.0uxion", ModifyInterChainGenesis(ModifyInterChainGenesisFn{ModifyGenesisShortProposals, ModifyGenesispacketForwardMiddleware}, [][]string{{votingPeriod, maxDepositPeriod}, {packetforward}})) - fundAmount := int64(10_000_000_000) - users := interchaintest.GetAndFundTestUsers(t, td.ctx, "default", fundAmount, td.xionChain) - chainUser := users[0] - - CosmosChainUpgradeIBCTest(t, &td, chainUser, "xion", "upgrade", "v6") + td := BuildXionChain(t, "0.0uxion", ModifyInterChainGenesis(ModifyInterChainGenesisFn{ModifyGenesisShortProposals, ModifyGenesisAAAllowedCodeIDs}, [][]string{{votingPeriod, maxDepositPeriod}, {votingPeriod, maxDepositPeriod}})) + CosmosChainUpgradeTest(t, &td, "xion", "upgrade", "v4") } -func CosmosChainUpgradeIBCTest(t *testing.T, td *TestData, chainUser ibc.Wallet, upgradeContainerRepo, upgradeVersion string, upgradeName string) { +func CosmosChainUpgradeTest(t *testing.T, td *TestData, upgradeContainerRepo, upgradeVersion string, upgradeName string) { // t.Skip("ComosChainUpgradeTest should be run manually, please comment skip and follow instructions when running") chain, ctx, client := td.xionChain, td.ctx, td.client + fundAmount := int64(10_000_000_000) + users := interchaintest.GetAndFundTestUsers(t, ctx, "default", fundAmount, chain) + chainUser := users[0] + height, err := chain.Height(ctx) require.NoError(t, err, "error fetching height before submit upgrade proposal") diff --git a/integration_tests/utils.go b/integration_tests/utils.go index 87ea039a..9d7e960f 100644 --- a/integration_tests/utils.go +++ b/integration_tests/utils.go @@ -2,6 +2,7 @@ package integration_tests import ( "context" + "embed" "encoding/json" "fmt" "math/rand" @@ -30,6 +31,9 @@ import ( "go.uber.org/zap/zaptest" ) +//go:embed configuredChains.yaml +var configuredChainsFile embed.FS + const ( votingPeriod = "10s" maxDepositPeriod = "10s" @@ -714,3 +718,33 @@ func GetTokenFactoryAdmin(t *testing.T, ctx context.Context, chain *cosmos.Cosmo return results.AuthorityMetadata.Admin } + +// OverrideConfiguredChainsYaml overrides the interchaintests configuredChains.yaml file with an embedded tmpfile +func OverrideConfiguredChainsYaml(t *testing.T) *os.File { + // Extract the embedded file to a temporary file + tempFile, err := os.CreateTemp("", "configuredChains-*.yaml") + if err != nil { + t.Errorf("error creating temporary file: %v", err) + } + + content, err := configuredChainsFile.ReadFile("configuredChains.yaml") + if err != nil { + t.Errorf("error reading embedded file: %v", err) + } + + if _, err := tempFile.Write(content); err != nil { + t.Errorf("error writing to temporary file: %v", err) + } + if err := tempFile.Close(); err != nil { + t.Errorf("error closing temporary file: %v", err) + } + + // Set the environment variable to the path of the temporary file + err = os.Setenv("IBCTEST_CONFIGURED_CHAINS", tempFile.Name()) + t.Logf("set env var IBCTEST_CONFIGURED_CHAINS to %s", tempFile.Name()) + if err != nil { + t.Errorf("error setting env var: %v", err) + } + + return tempFile +} diff --git a/x/mint/common_test.go b/x/mint/common_test.go index e7d4e676..67c31f7d 100644 --- a/x/mint/common_test.go +++ b/x/mint/common_test.go @@ -8,6 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + // banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" diff --git a/x/xion/keeper/keeper.go b/x/xion/keeper/keeper.go index fbee2c08..608cd7dd 100644 --- a/x/xion/keeper/keeper.go +++ b/x/xion/keeper/keeper.go @@ -1,6 +1,8 @@ package keeper import ( + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/cometbft/cometbft/libs/log" "cosmossdk.io/math" @@ -14,11 +16,14 @@ import ( ) type Keeper struct { - cdc codec.BinaryCodec - storeKey storetypes.StoreKey - paramSpace paramtypes.Subspace - bankKeeper types.BankKeeper - accountKeeper types.AccountKeeper + cdc codec.BinaryCodec + storeKey storetypes.StoreKey + paramSpace paramtypes.Subspace + bankKeeper types.BankKeeper + accountKeeper types.AccountKeeper + ContractOpsKeeper wasmtypes.ContractOpsKeeper + ContractViewKeeper wasmtypes.ViewKeeper + AAKeeper types.AbstractAccountKeeper // the address capable of executing a MsgSetPlatformPercentage message. // Typically, this should be the x/gov module account @@ -30,15 +35,21 @@ func NewKeeper(cdc codec.BinaryCodec, paramSpace paramtypes.Subspace, bankKeeper types.BankKeeper, accountKeeper types.AccountKeeper, + wasmOpsKeeper wasmtypes.ContractOpsKeeper, + wasmViewKeeper wasmtypes.ViewKeeper, + aaKeeper types.AbstractAccountKeeper, authority string, ) Keeper { return Keeper{ - storeKey: key, - cdc: cdc, - paramSpace: paramSpace, - bankKeeper: bankKeeper, - accountKeeper: accountKeeper, - authority: authority, + storeKey: key, + cdc: cdc, + paramSpace: paramSpace, + bankKeeper: bankKeeper, + accountKeeper: accountKeeper, + ContractOpsKeeper: wasmOpsKeeper, + ContractViewKeeper: wasmViewKeeper, + AAKeeper: aaKeeper, + authority: authority, } } diff --git a/x/xion/keeper/migrations.go b/x/xion/keeper/migrations.go new file mode 100644 index 00000000..3c5f5108 --- /dev/null +++ b/x/xion/keeper/migrations.go @@ -0,0 +1,37 @@ +package keeper + +import ( + "fmt" + + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + + v1 "github.com/burnt-labs/xion/x/xion/migrations/v1" + "github.com/burnt-labs/xion/x/xion/types" +) + +type Migrator struct { + wasmOpsKeeper wasmtypes.ContractOpsKeeper + wasmViewKeeper wasmtypes.ViewKeeper + aaKeeper types.AbstractAccountKeeper +} + +func NewMigrator(wasmOpsKeeper wasmtypes.ContractOpsKeeper, wasmViewKeeper wasmtypes.ViewKeeper, aaKeeper types.AbstractAccountKeeper) Migrator { + return Migrator{wasmOpsKeeper: wasmOpsKeeper, wasmViewKeeper: wasmViewKeeper, aaKeeper: aaKeeper} +} + +func (m Migrator) Migrate1to2(ctx sdk.Context) error { + switch ctx.ChainID() { + case "xion-mainnet-1": + return nil // no migration needed + case "xion-testnet-1": + newCodeID := uint64(327) + return v1.MigrateStore(ctx, m.wasmOpsKeeper, m.wasmViewKeeper, m.aaKeeper, newCodeID) + case "xion-1": // integration tests chainID + newCodeID := uint64(2) + return v1.MigrateStore(ctx, m.wasmOpsKeeper, m.wasmViewKeeper, m.aaKeeper, newCodeID) + default: + return fmt.Errorf("unsupported chain id: %s", ctx.ChainID()) + } +} diff --git a/x/xion/migrations/v1/migration.go b/x/xion/migrations/v1/migration.go new file mode 100644 index 00000000..59f8a57b --- /dev/null +++ b/x/xion/migrations/v1/migration.go @@ -0,0 +1,98 @@ +package v1 + +import ( + "fmt" + "sync" + "sync/atomic" + + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/burnt-labs/xion/x/xion/types" +) + +func MigrateStore( + ctx sdk.Context, + wasmOpsKeeper wasmtypes.ContractOpsKeeper, + wasmViewKeeper wasmtypes.ViewKeeper, + aaKeeper types.AbstractAccountKeeper, + newCodeID uint64, +) error { + // get the previous account code ID + aaParams, err := aaKeeper.GetParams(ctx) + if err != nil { + return err + } + if len(aaParams.AllowedCodeIDs) != 1 { + return fmt.Errorf("expected one allowed code id for abstract account, got: %v", aaParams.AllowedCodeIDs) + } + + originalCodeID := aaParams.AllowedCodeIDs[0] + + // the account contract should always be pinned + err = wasmOpsKeeper.PinCode(ctx, newCodeID) + if err != nil { + return err + } + + // setup concurrency control + var wg sync.WaitGroup + errors := make(chan error, 1) + defer close(errors) + semaphore := make(chan struct{}, 10) // Limits the number of concurrent migrations + defer close(semaphore) + + // counter for migrated contracts + var migratedCount uint64 + + // iterate through all existing accounts at this code ID, and migrate them + wasmViewKeeper.IterateContractsByCode(ctx, originalCodeID, func(instance sdk.AccAddress) bool { + semaphore <- struct{}{} // acquire semaphore + wg.Add(1) + + go func(instance sdk.AccAddress) { + defer wg.Done() + defer func() { <-semaphore }() // release semaphore + + ctx.Logger().Info("Migrating contract", "instance", instance.String(), "newCodeID", newCodeID) + _, err = wasmOpsKeeper.Migrate(ctx, instance, instance, newCodeID, []byte("{}")) + if err != nil { + ctx.Logger().Error("Error migrating contract", "contract", instance.String(), "error", err.Error()) + errors <- err + } else { + // safely increment the counter + atomic.AddUint64(&migratedCount, 1) + } + }(instance) + + return false + }) + + wg.Wait() + + select { + case err = <-errors: + return err + default: + // No errors, proceed + } + + ctx.Logger().Info(fmt.Sprintf("Total contracts migrated: %d", migratedCount)) + + // as the previous contract is no longer the main account target, it doesn't + // need to be pinned + err = wasmOpsKeeper.UnpinCode(ctx, originalCodeID) + if err != nil { + return err + } + + // adjust the aa registration endpoint to point at the new code ID + aaParams.AllowedCodeIDs = []uint64{newCodeID} + err = aaKeeper.SetParams(ctx, aaParams) + if err != nil { + return err + } + + return nil +} diff --git a/x/xion/module.go b/x/xion/module.go index e1e6d23a..ea8511cc 100644 --- a/x/xion/module.go +++ b/x/xion/module.go @@ -94,6 +94,12 @@ func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) { func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + + // TODO(froch, 20240415): Migration to be applied later + // m := keeper.NewMigrator(am.keeper.ContractOpsKeeper, am.keeper.ContractViewKeeper, am.keeper.AAKeeper) + // if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { + // panic(fmt.Sprintf("failed to migrate x/xion from version 1 to 2: %v", err)) + // } } // InitGenesis performs genesis initialization for the ibc-29-fee module. It returns diff --git a/x/xion/types/expected_keepers.go b/x/xion/types/expected_keepers.go index 51ee91fb..ddf27b2b 100644 --- a/x/xion/types/expected_keepers.go +++ b/x/xion/types/expected_keepers.go @@ -1,6 +1,8 @@ package types // noalias import ( + aatypes "github.com/larry0x/abstract-account/x/abstractaccount/types" + sdktypes "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -36,3 +38,15 @@ type BankKeeper interface { type AccountKeeper interface { GetModuleAccount(ctx sdktypes.Context, moduleName string) authtypes.ModuleAccountI } + +type WasmKeeper interface { + Migrate(ctx sdktypes.Context, contractAddress, caller sdktypes.AccAddress, newCodeID uint64, msg []byte) ([]byte, error) + IterateContractsByCode(ctx sdktypes.Context, codeID uint64, cb func(address sdktypes.AccAddress) bool) + PinCode(ctx sdktypes.Context, codeID uint64) error + UnpinCode(ctx sdktypes.Context, codeID uint64) error +} + +type AbstractAccountKeeper interface { + GetParams(ctx sdktypes.Context) (*aatypes.Params, error) + SetParams(ctx sdktypes.Context, params *aatypes.Params) error +}