Skip to content

Commit

Permalink
squashed v13.0.0
Browse files Browse the repository at this point in the history
git diff v13.0.0 - ''

## 📦 Uncategorized

- remove ibc wasm
   - PR: #265
- add heighliner push
   - PR: #266
- udpate release workflow to push heighliner images
   - PR: #268
- IBCWasm upgrade test and fix
   - PR: #269

## What's Changed
* remove ibc wasm by @ash-burnt in #265
* add heighliner push by @2xburnt in #266
* udpate release workflow to push heighliner images by @2xburnt in #268
* IBCWasm upgrade test and fix by @ash-burnt in #269

**Full Changelog**: v12.0.0...v13.0.0
  • Loading branch information
2xburnt committed Dec 21, 2024
1 parent 4a777d8 commit 7d8a8aa
Show file tree
Hide file tree
Showing 12 changed files with 288 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ jobs:
uses: burnt-labs/xion/.github/workflows/docker-push.yaml@main
secrets: inherit

push-heighliner:
name: Push Heighliner Images
needs: build-docker
uses: burnt-labs/xion/.github/workflows/heighliner-push.yaml@main
secrets: inherit

docker-scout:
name: Docker Scout
needs: build-docker
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
distribution: goreleaser
version: "~> v2"
args: build --clean --id xiond_${{ matrix.os }}_${{ matrix.arch }}
args: build --clean --skip validate --id xiond_${{ matrix.os }}_${{ matrix.arch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
94 changes: 94 additions & 0 deletions .github/workflows/heighliner-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Push Heighliner images

# reusable workflow, do not add triggers
on:
workflow_call:
workflow_dispatch:

env:
REPO: ghcr.io/${{ github.repository }}/heighliner

jobs:
merge:
name: Create registry manifests
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
packages: write
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_OIDC_ROLE }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Prepare environment
run: |
echo "TAG_VERSION=${GITHUB_SHA:0:7}" | tee -a $GITHUB_ENV
- name: Metadata for xion container
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REPO }}
tags: |
type=raw,value=${{ env.TAG_VERSION }}
type=semver,pattern={{version}},enable=${{ github.event_name == 'push' }}
type=raw,value=latest,enable={{is_default_branch}}
- name: Download images
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}
pattern: heighliner*
merge-multiple: true

- name: Load images
working-directory: ${{ runner.temp }}
run: |
for image in heighliner*.tar; do
PLATFORM=$(basename $image .tar | cut -d- -f2-)
docker load < $image;
docker tag heighliner:$PLATFORM ${REPO}:$PLATFORM
docker push ${REPO}:$PLATFORM;
done;
- name: Prepare mainfest vars
run: |
IMAGE_TARGETS=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< $DOCKER_METADATA_OUTPUT_JSON)
IMAGE_TAGS=$(docker image ls $REPO --digests --format json | jq -r '"\(.Repository):\(.Tag)"' | tr '\n' ' ')
echo "IMAGE_TAGS=$IMAGE_TAGS" | tee -a $GITHUB_ENV
echo "IMAGE_TARGETS=${IMAGE_TARGETS}" | tee -a $GITHUB_ENV
- name: Create manifest list and push
run: |
eval "docker buildx imagetools create ${IMAGE_TARGETS} ${IMAGE_TAGS}"
- name: Inspect image
run: |
jq -cr '.tags | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON" | \
xargs -n1 docker buildx imagetools inspect%
37 changes: 36 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
wasmvm "github.com/CosmWasm/wasmvm/v2"
"github.com/gorilla/mux"
aa "github.com/larry0x/abstract-account/x/abstractaccount"
aakeeper "github.com/larry0x/abstract-account/x/abstractaccount/keeper"
Expand Down Expand Up @@ -40,6 +41,9 @@ import (
"github.com/cosmos/ibc-go/modules/capability"
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
ibcwasm "github.com/cosmos/ibc-go/modules/light-clients/08-wasm"
ibcwasmkeeper "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/keeper"
ibcwasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"
ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts"
icacontroller "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller"
icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper"
Expand Down Expand Up @@ -274,6 +278,7 @@ type WasmApp struct {
ICAHostKeeper icahostkeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
WasmKeeper wasmkeeper.Keeper
WasmClientKeeper ibcwasmkeeper.Keeper
AbstractAccountKeeper aakeeper.Keeper
IBCHooksKeeper *ibchookskeeper.Keeper
ContractKeeper *wasmkeeper.PermissionedKeeper
Expand Down Expand Up @@ -353,7 +358,7 @@ func NewWasmApp(
nftkeeper.StoreKey, group.StoreKey,
// non sdk store keys
ibcexported.StoreKey, ibctransfertypes.StoreKey, ibcfeetypes.StoreKey,
wasmtypes.StoreKey, icahosttypes.StoreKey,
ibcwasmtypes.StoreKey, wasmtypes.StoreKey, icahosttypes.StoreKey,
aatypes.StoreKey, icacontrollertypes.StoreKey, globalfee.StoreKey,
xiontypes.StoreKey, ibchookstypes.StoreKey, packetforwardtypes.StoreKey,
feeabstypes.StoreKey, jwktypes.StoreKey, tokenfactorytypes.StoreKey,
Expand Down Expand Up @@ -708,6 +713,22 @@ func NewWasmApp(
wasmOpts = append(owasm.RegisterStargateQueries(*app.GRPCQueryRouter(), appCodec), wasmOpts...)
wasmOpts = append(wasmOpts, tokenFactoryOpts...)

// instantiate the Wasm VM with the chosen parameters
// we need to create this double wasm dir because the wasmd Keeper appends an extra `wasm/` to the value you give it
doubleWasmDir := filepath.Join(wasmDir, "wasm")
wasmVM, err := wasmvm.NewVM(
doubleWasmDir,
availableCapabilities,
WasmContractMemoryLimit, // default of 32
wasmConfig.ContractDebugMode,
wasmConfig.MemoryCacheSize,
)
if err != nil {
panic(err)
}

wasmOpts = append(wasmOpts, wasmkeeper.WithWasmEngine(wasmVM))

app.WasmKeeper = wasmkeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[wasmtypes.StoreKey]),
Expand All @@ -729,6 +750,15 @@ func NewWasmApp(
wasmOpts...,
)

app.WasmClientKeeper = ibcwasmkeeper.NewKeeperWithVM(
appCodec,
runtime.NewKVStoreService(keys[ibcwasmtypes.StoreKey]),
app.IBCKeeper.ClientKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
wasmVM,
app.GRPCQueryRouter(),
)

app.AbstractAccountKeeper = aakeeper.NewKeeper(
appCodec,
keys[aatypes.StoreKey],
Expand Down Expand Up @@ -837,6 +867,7 @@ func NewWasmApp(
xion.NewAppModule(app.XionKeeper),
ibc.NewAppModule(app.IBCKeeper),
ibctm.NewAppModule(),
ibcwasm.NewAppModule(app.WasmClientKeeper),
transfer.NewAppModule(app.TransferKeeper),
ibcfee.NewAppModule(app.IBCFeeKeeper),
ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper),
Expand Down Expand Up @@ -889,6 +920,7 @@ func NewWasmApp(
feeabstypes.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
ibcwasmtypes.ModuleName,
wasmtypes.ModuleName,
aatypes.ModuleName,
xiontypes.ModuleName,
Expand All @@ -914,6 +946,7 @@ func NewWasmApp(
feeabstypes.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
ibcwasmtypes.ModuleName,
wasmtypes.ModuleName,
aatypes.ModuleName,
ibchookstypes.ModuleName,
Expand Down Expand Up @@ -945,6 +978,7 @@ func NewWasmApp(
feeabstypes.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
ibcwasmtypes.ModuleName,
// wasm after ibc transfer
wasmtypes.ModuleName,
aatypes.ModuleName,
Expand Down Expand Up @@ -1313,6 +1347,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(aatypes.ModuleName)
paramsKeeper.Subspace(packetforwardtypes.ModuleName)
paramsKeeper.Subspace(feeabstypes.ModuleName)
paramsKeeper.Subspace(ibcwasmtypes.ModuleName)

// IBC params migration - legacySubspace to selfManaged
// https://github.com/cosmos/ibc-go/blob/main/docs/docs/05-migrations/11-v7-to-v8.md#params-migration
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
)

const UpgradeName = "v12"
const UpgradeName = "v13"

func (app *WasmApp) RegisterUpgradeHandlers() {
app.WrapSetUpgradeHandler(UpgradeName)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func InitializeWasmApp(b testing.TB, db dbm.DB, numAccounts int) AppInfo {
Label: "Demo contract",
Msg: initBz,
}
gasWanted := 500000 + 10000*uint64(numAccounts)
gasWanted := 500000 + 10000*uint64(numAccounts) // nolint:gosec
initTx, err := simtestutil.GenSignedMockTx(r, txGen, []sdk.Msg{&initMsg}, nil, gasWanted, "", []uint64{0}, []uint64{1}, minter)
require.NoError(b, err)
_, res, err := wasmApp.SimDeliver(txGen.TxEncoder(), initTx)
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ require (
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2
github.com/cosmos/ibc-apps/modules/ibc-hooks/v8 v8.0.0-20240530162148-4827cf263165
github.com/cosmos/ibc-go/modules/capability v1.0.1
github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.4.2-0.20240730185033-ccd4dc278e72
github.com/cosmos/ibc-go/v8 v8.5.1
github.com/cosmos/rosetta v0.50.6
github.com/dvsekhvalnov/jose2go v1.6.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ github.com/cosmos/ibc-go/modules/apps/callbacks v0.2.1-0.20231113120333-342c00b0
github.com/cosmos/ibc-go/modules/apps/callbacks v0.2.1-0.20231113120333-342c00b0f8bd/go.mod h1:JWfpWVKJKiKtd53/KbRoKfxWl8FsT2GPcNezTOk0o5Q=
github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI=
github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E=
github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.4.2-0.20240730185033-ccd4dc278e72 h1:QjCi4bJoy9AXLL1e4jqi+4rHYN0gGZAQxf937cdWhw4=
github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.4.2-0.20240730185033-ccd4dc278e72/go.mod h1:yiulzyQAZ+Ci802z/kVQqTA3lGiSJOmDpTq7kZxOUNE=
github.com/cosmos/ibc-go/v8 v8.5.1 h1:3JleEMKBjRKa3FeTKt4fjg22za/qygLBo7mDkoYTNBs=
github.com/cosmos/ibc-go/v8 v8.5.1/go.mod h1:P5hkAvq0Qbg0h18uLxDVA9q1kOJ0l36htMsskiNwXbo=
github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU=
Expand Down
1 change: 1 addition & 0 deletions integration_tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require (
github.com/cosmos/cosmos-sdk v0.50.10
github.com/cosmos/gogoproto v1.7.0
github.com/cosmos/ibc-go/modules/capability v1.0.1
github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.4.2-0.20240730185033-ccd4dc278e72
github.com/cosmos/ibc-go/v8 v8.5.1
github.com/cosmos/interchain-security/v5 v5.0.0-alpha1.0.20240424193412-7cd900ad2a74
github.com/docker/docker v24.0.9+incompatible
Expand Down
2 changes: 2 additions & 0 deletions integration_tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ github.com/cosmos/ibc-go/modules/apps/callbacks v0.2.1-0.20231113120333-342c00b0
github.com/cosmos/ibc-go/modules/apps/callbacks v0.2.1-0.20231113120333-342c00b0f8bd/go.mod h1:JWfpWVKJKiKtd53/KbRoKfxWl8FsT2GPcNezTOk0o5Q=
github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI=
github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E=
github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.4.2-0.20240730185033-ccd4dc278e72 h1:QjCi4bJoy9AXLL1e4jqi+4rHYN0gGZAQxf937cdWhw4=
github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.4.2-0.20240730185033-ccd4dc278e72/go.mod h1:yiulzyQAZ+Ci802z/kVQqTA3lGiSJOmDpTq7kZxOUNE=
github.com/cosmos/ibc-go/v8 v8.5.1 h1:3JleEMKBjRKa3FeTKt4fjg22za/qygLBo7mDkoYTNBs=
github.com/cosmos/ibc-go/v8 v8.5.1/go.mod h1:P5hkAvq0Qbg0h18uLxDVA9q1kOJ0l36htMsskiNwXbo=
github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU=
Expand Down
Loading

0 comments on commit 7d8a8aa

Please sign in to comment.