Skip to content

Commit

Permalink
fead: update to sdk50 (ComposableFi#510)
Browse files Browse the repository at this point in the history
Co-authored-by: dzmitry-lahoda <[email protected]>
Co-authored-by: kienn6034 <[email protected]>
Co-authored-by: rustdev <[email protected]>
Co-authored-by: rust.dev <[email protected]>
Co-authored-by: kkast <[email protected]>
Co-authored-by: Kanstantsin Kastsevich <[email protected]>
Co-authored-by: rjonczy <[email protected]>
Co-authored-by: tungle <[email protected]>
  • Loading branch information
9 people authored May 24, 2024
1 parent 84b6893 commit 69a6072
Show file tree
Hide file tree
Showing 267 changed files with 11,789 additions and 9,307 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'
- run: go build ./...

tidy:
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'
- run: |
go mod tidy
CHANGES_IN_REPO=$(git status --porcelain)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.20
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'

- name: checkout code
uses: actions/checkout@v4
Expand All @@ -54,10 +54,10 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.20
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'

- name: checkout code
uses: actions/checkout@v4
Expand All @@ -70,10 +70,10 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.20
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'

- name: checkout code
uses: actions/checkout@v4
Expand All @@ -86,10 +86,10 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.20
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'

- name: checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'
- name: Checkout code
uses: actions/checkout@v4
- name: Test
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@ _build/
mytestnet/

screenlog.0
.idea
.idea


node_modules
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ issues:
- text: "ST1016:"
linters:
- stylecheck
- path: "migrations"
text: "SA1019:"
- text: "SA1019:"
linters:
- staticcheck
- text: "leading space"
Expand Down
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/composable-cosmos.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION="1.20"
ARG GO_VERSION="1.22"
ARG RUNNER_IMAGE="gcr.io/distroless/static-debian11"

# --------------------------------------------------------
Expand Down
66 changes: 60 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ lint:
### Proto ###
###############################################################################

protoVer=0.12.1
protoVer=0.14.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
containerProtoGen=proto-gen-$(protoVer)
containerProtoFmt=proto-fmt-$(protoVer)
Expand All @@ -113,8 +113,7 @@ proto-all: proto-format proto-gen

proto-gen:
@echo "Generating Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protocgen.sh; fi
@$(protoImage) sh ./scripts/protocgen.sh

proto-format:
@echo "Formatting Protobuf files"
Expand Down Expand Up @@ -168,11 +167,66 @@ test-upgrade: clean-testing-data

clean-testing-data:
@echo "Killing binary and removing previous data"
-@pkill centaurid 2>/dev/null
echo "stopping picachain..."
-@pkill picad 2>/dev/null
-@pkill rly 2>/dev/null
-@rm -rf ./mytestnet

echo "stopping parachain..."
-@killall parachain-node
-@killall polkadot

netstat -ltup | grep LISTEN

.PHONY: ictest-start-cosmos ictest-start-polkadot ictest-ibc ictest-push-wasm ictest-all

include contrib/make/release.mk
include contrib/make/release.mk


test-upgrade: clean-testing-data
@echo "Starting upgrade test"
./scripts/tweak-test-upgrade.sh



## Scripts for testing sdk 50
init-deps:
@echo "Installing dependencies"
bash ./scripts/upgrade/init-deps.sh

localnet-pica:
@echo "Starting test"
rm -rf screenlog.0
-@pkill picad 2>/dev/null
bash ./scripts/run-node.sh picad
bash ./scripts/50/store-wasm-code.sh

localnet-parachain:
@echo "Starting localnet"
bash ./scripts/upgrade/setup-polkadot-node.sh

relayer-create-clients:
@echo "Starting relayer"
bash ./scripts/relayer_hyperspace/create-clients.sh

pica-upgrade:
@echo "Starting upgrade"
bash ./scripts/upgrade/upgrade.

relayer-test-cleanup:
@echo "Cleaning up"
./scripts/relayer_hyperspace/cleanup.sh
###############################################################################
### Integration Tests ###
###############################################################################

integration-test-all: init-test-framework \
test-ibc-hooks

init-test-framework: clean-testing-data install
@echo "Initializing both blockchains..."
./scripts/tests/init-test-framework.sh
./scripts/relayer/relayer-init.sh

test-ibc-hooks:
@echo "Testing ibc-hooks..."
./scripts/tests/ibc-hooks/increment.sh
12 changes: 8 additions & 4 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package ante

import (
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
circuitante "cosmossdk.io/x/circuit/ante"
circuitkeeper "cosmossdk.io/x/circuit/keeper"
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"

"cosmossdk.io/x/tx/signing"
"github.com/cosmos/cosmos-sdk/codec"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
ante "github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/signing"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
tfmwKeeper "github.com/notional-labs/composable/v6/x/transfermiddleware/keeper"
txBoundaryAnte "github.com/notional-labs/composable/v6/x/tx-boundary/ante"
Expand All @@ -24,17 +26,19 @@ func NewAnteHandler(
feegrantKeeper ante.FeegrantKeeper,
txFeeChecker ante.TxFeeChecker,
sigGasConsumer ante.SignatureVerificationGasConsumer,
signModeHandler signing.SignModeHandler,
signModeHandler *signing.HandlerMap,
channelKeeper *ibckeeper.Keeper,
tfmwKeeper tfmwKeeper.Keeper,
txBoundaryKeeper txBoundaryKeeper.Keeper,
ck *circuitkeeper.Keeper,
codec codec.BinaryCodec,
) sdk.AnteHandler {
return sdk.ChainAnteDecorators(
ante.NewSetUpContextDecorator(), // // outermost AnteDecorator. SetUpContext must be called first
ante.NewValidateBasicDecorator(),
ante.NewConsumeGasForTxSizeDecorator(ak),
ante.NewDeductFeeDecorator(ak, bk, feegrantKeeper, txFeeChecker),
circuitante.NewCircuitBreakerDecorator(ck),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(ak),
ante.NewConsumeGasForTxSizeDecorator(ak),
Expand Down
2 changes: 1 addition & 1 deletion app/ante/ibc_ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/cosmos/cosmos-sdk/x/authz"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"

tfmwKeeper "github.com/notional-labs/composable/v6/x/transfermiddleware/keeper"
)
Expand Down
Loading

0 comments on commit 69a6072

Please sign in to comment.