Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: some issues when upgrade to sdk50 #531

Merged
merged 8 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
112 changes: 104 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 All @@ -98,6 +98,102 @@ jobs:
env:
BRANCH_CI: "latest"

test-chain-core:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.22'

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-chain-core
env:
BRANCH_CI: "latest"

test-ibc-cosmos:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.22'

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-ibc-cosmos
env:
BRANCH_CI: "latest"

test-ictest-ibc-hooks:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.22'

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-ibc-hooks
env:
BRANCH_CI: "latest"

test-ictest-miscellaneous:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.22'

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-miscellaneous
env:
BRANCH_CI: "latest"

test-ictest-pfm-timeout:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.22'

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-pfm-timeout
env:
BRANCH_CI: "latest"

test-ictest-pfm:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v4
with:
go-version: '1.22'

- name: checkout code
uses: actions/checkout@v4

- run: make ictest-pfm
env:
BRANCH_CI: "latest"

# test-ibc-transfer:
# runs-on: ubuntu-latest
# needs: build-and-push-image
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
93 changes: 86 additions & 7 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 @@ -151,12 +150,34 @@ ictest-upgrade:
cd tests/interchaintest && go test -timeout=25m -race -v -run TestCentauriUpgrade .

# Executes all tests via interchaintest after compling a local image as juno:local
ictest-all: ictest-start-cosmos ictest-start-polkadot ictest-ibc
ictest-all: ictest-start-cosmos ictest-start-polkadot ictest-ibc ictest-ibc-cosmos ictest-chain-core ictest-pfm ictest-pfm-router ictest-pfm-timeout ictest-miscellaneous ictest-ibc-hooks

# Executes push wasm client tests via interchaintest
ictest-push-wasm:
cd tests/interchaintest && go test -race -v -run TestPushWasmClientCode .

ictest-ibc-cosmos:
cd tests/interchaintest && go test -race -v -run TestComposableGaiaIBCTransfer .

ictest-chain-core:
cd tests/interchaintest && go test -race -v -run TestCoreSDKCommands .

ictest-pfm-timeout:
cd tests/interchaintest && go test -race -v -run TestTimeoutOnForward .

ictest-pfm:
cd tests/interchaintest && go test -race -v -run TestPacketForwardMiddleware .

ictest-pfm-router:
cd tests/interchaintest && go test -race -v -run TestPacketForwardMiddlewareRouter .

ictest-ibc-hooks:
cd tests/interchaintest && go test -race -v -run TestComposableIBCHooks .

ictest-miscellaneous:
cd tests/interchaintest && go test -race -v -run TestICTestMiscellaneous .


# Init 2 cosmos chains and setup ibc between them
init-test-interchain: clean-testing-data install
./scripts/test-upgrade-cosmos-chains.sh
Expand All @@ -168,11 +189,69 @@ 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"
@rm -rf mytestnet > /dev/null 2>&1
@killall parachain-node > /dev/null 2>&1
@killall polkadot > /dev/null 2>&1
@./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
Loading
Loading