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

feat: 08-wasm light client proxy module for wasm clients #5079

Merged
merged 169 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
01e8548
feat: add wasm light client module to feat/wasm-clients branch (#3486)
misko9 Jul 6, 2023
40337dd
Merge branch 'main' into feat/wasm-clients
crodriguezvega Jul 6, 2023
90ed894
linting
crodriguezvega Jul 7, 2023
cf6fbfe
Migrated the errors to new package (#4058)
vishal-kanna Jul 12, 2023
28d46c1
Merge branch 'main' into feat/wasm-client
charleenfei Jul 12, 2023
255905a
imp: make separate go.mod for 08-wasm (#4026)
crodriguezvega Jul 13, 2023
8bc0c68
imp: remove code id key from genesis contract (#4032)
crodriguezvega Jul 14, 2023
b6e8a3a
fix imports
crodriguezvega Jul 14, 2023
2901cf8
bump wasmvm (#4086)
crodriguezvega Jul 14, 2023
581a27f
build and test wasm client on PR (#4095)
Reecepbcups Jul 16, 2023
5a1a249
add authority param to wasm NewKeeper (#4092)
Reecepbcups Jul 16, 2023
3607dd2
Merge `storeWasmCode` and `importWasmCode` functions (#4088)
crodriguezvega Jul 17, 2023
9298fe6
Pin code to the wasm VM cache (#4093)
Reecepbcups Jul 18, 2023
731dbbf
just some renaming
crodriguezvega Jul 20, 2023
59ccad5
renaming to align with x/wasm naming (#4091)
crodriguezvega Jul 20, 2023
62ed4fb
imp: disallow submessage execution (#4130)
crodriguezvega Jul 20, 2023
341350a
use sudo (#4131)
crodriguezvega Jul 20, 2023
f822b4f
fix wrapf warning (#4172)
DimitrisJim Jul 25, 2023
bffb649
Merge branch 'main' into feat/wasm-clients
crodriguezvega Jul 30, 2023
bf9d465
Add linting for 08-wasm module (#4206)
DimitrisJim Aug 1, 2023
ed41863
add 08-wasm global store key (#4185)
crodriguezvega Aug 1, 2023
de89920
imp: delegate store operation of `clientState` and `consensusState` i…
crodriguezvega Aug 1, 2023
644367f
imp: remove `timestamp` from `consensusState` and query contract to r…
crodriguezvega Aug 1, 2023
20d4d7e
imp: remove `height` from `header` and merge `header` with `misbehavi…
crodriguezvega Aug 1, 2023
54f29ee
imp: add query and sudo message types to encapsulate all variants of …
crodriguezvega Aug 1, 2023
c4f8da4
add 08-wasm Keeper constructor that accepts pointer to Wasm VM instan…
crodriguezvega Aug 1, 2023
2e17bb2
Allow same VM to be assigned to the global vm. (#4236)
DimitrisJim Aug 3, 2023
49c5e7d
Disallow events, attributes being returned from a contract. (#4222)
DimitrisJim Aug 3, 2023
4f0a711
Clean up vm entry points (#4279)
DimitrisJim Aug 14, 2023
479f470
Merge branch 'main' into feat/wasm-clients
crodriguezvega Aug 14, 2023
2a7c242
add halborn audit report
adiraviraj Aug 15, 2023
fb9eed5
Add files via upload
adiraviraj Aug 15, 2023
03d077b
add wasm client audit reports (#4351)
adiraviraj Aug 15, 2023
16e1026
Document contract api. (#4283)
DimitrisJim Aug 15, 2023
2913dbd
oh linter you. (#4369)
DimitrisJim Aug 17, 2023
83ca9bb
deps(08-wasm): bump SDK v0.47.5 (#4540)
crodriguezvega Sep 1, 2023
fb745e8
add 08-wasm to dependabot
crodriguezvega Sep 1, 2023
1425ca2
Merge branch 'main' into feat/wasm-clients
crodriguezvega Sep 1, 2023
17d255c
cherry pick commit fixing broken links
crodriguezvega Sep 5, 2023
8f5354b
Fix dependabot file.
DimitrisJim Sep 7, 2023
120d45b
Add new cmd to store code via a gov proposal. (#4565)
DimitrisJim Sep 7, 2023
81086e4
update wasm clients branch linter to match main (#4609)
faddat Sep 9, 2023
94f380d
chore: implement `appmodule.AppModule` interface (#4607)
crodriguezvega Sep 11, 2023
12d74a9
add proposal simulator interface and tests (#4608)
crodriguezvega Sep 14, 2023
bbec01f
ci: use go1.21 for wasm clients (#4610)
faddat Sep 14, 2023
090bc9f
remove toolchain / go mod tidy
crodriguezvega Sep 14, 2023
1bc5845
Update wasm light client unit tests and tendermint/grandpa cw contrac…
misko9 Sep 15, 2023
aa8598d
PR 4306 comments
crodriguezvega Sep 15, 2023
70efe3a
fix dead links
crodriguezvega Sep 18, 2023
95c9e29
fix broken links
crodriguezvega Sep 19, 2023
c87c590
test: check nil vm and empty authority (#4722)
crodriguezvega Sep 22, 2023
2d63b4a
add extra documentation for wasmCall and wasmQuery (#4752)
crodriguezvega Sep 22, 2023
60e565b
Duplicate simapp in 08 wasm (#4532)
DimitrisJim Sep 26, 2023
4f0198c
chore: add 08-wasm events (#4605)
crodriguezvega Sep 27, 2023
43106d5
Go mod tidy. (#4776)
DimitrisJim Sep 27, 2023
540db8c
Add workflow to build image for 08-wasm (#4777)
DimitrisJim Sep 28, 2023
159343d
add comment
crodriguezvega Sep 28, 2023
61db385
Use an error when panicking. (#4791)
DimitrisJim Sep 29, 2023
18a2185
imp: use interface instead of concrete type for wasmvm (#4802)
colin-axner Oct 2, 2023
5bff313
Merge branch 'main' into cian/merge-main-wasm
chatton Oct 3, 2023
f6be1b8
chore: fixing TestVerifyMisbehaviourTendermint test suite
chatton Oct 3, 2023
64fe692
chore: fixing linting issues and making linter runnable on mac
chatton Oct 3, 2023
c7324c2
chore: updating callbacks workflow
chatton Oct 3, 2023
48cadc5
chore: change callbacks workflow to build in docker
chatton Oct 3, 2023
595b8b9
chore: updating callbacks dockerfile
chatton Oct 3, 2023
e9c0862
chore: commented out part of test matrix
chatton Oct 3, 2023
176a497
fix: rm dependency on 08-wasm in ibc-go (#4801)
charleenfei Oct 4, 2023
9a7b9b7
imp: remove unused fields, functions of contract result (#4750)
crodriguezvega Oct 4, 2023
be3e2ff
Merge branch 'feat/wasm-clients' into cian/merge-main-wasm
chatton Oct 4, 2023
b863dd3
chore: addressing PR feedback
chatton Oct 4, 2023
b61ede0
chore: pr feedback
chatton Oct 4, 2023
86478ce
Merge pull request #4805 from cosmos/cian/merge-main-wasm
chatton Oct 4, 2023
7032548
feat: add mockVM for wasm clients testing (#4804)
colin-axner Oct 4, 2023
3f4061b
Dont pull wasmvm static lib in simd dockerfile. (#4817)
DimitrisJim Oct 4, 2023
1c7e148
Remove wasm additions to main test workflow. (#4819)
DimitrisJim Oct 4, 2023
0ea6d08
uncomment init function (#4833)
charleenfei Oct 5, 2023
551fb95
chore: add has validatebasic compiler assertion (#4742)
crodriguezvega Oct 5, 2023
42ad3cf
Ensure wasmvm static library version matches wasmv import in gomod (#…
chatton Oct 5, 2023
8c9c717
align error on signer not matching authority, use expected error in s…
crodriguezvega Oct 6, 2023
32e4bd7
fix: make Verify Von/Membership calls sudo calls instead of queryMsg …
charleenfei Oct 6, 2023
bd8e201
Bump wasmvm to 1.4.1 (#4857)
DimitrisJim Oct 13, 2023
cd7b5d6
Store code before creating a wasm client. (#4851)
DimitrisJim Oct 17, 2023
10ffafa
Run grandpa e2e test in ci (#4880)
chatton Oct 17, 2023
2ff2052
Add test for types registered in 08-wasm. (#4853)
DimitrisJim Oct 17, 2023
bc380a4
Improve mock wasmvm query implementation (#4879)
chatton Oct 17, 2023
c9f3ba5
Remove codeHash const from types_test, use wasmtesting. (#4891)
DimitrisJim Oct 17, 2023
403af69
Add checks in ValidateBasic for StoreCode, add tests for messages. (#…
DimitrisJim Oct 17, 2023
2a39e7f
Only store code hashes in store. (#4292)
DimitrisJim Oct 17, 2023
bde2a2f
Add mapping for sudo payloads callbacks in mockVM (#4897)
DimitrisJim Oct 18, 2023
b54ac97
Add test case for invalid Initialize call due to unstored contract. (…
DimitrisJim Oct 18, 2023
76bae0d
imp(08-wasm): exported contract responses to tests (#4902)
srdtrk Oct 18, 2023
ab35cf4
fix(08-wasm): removed panic in 'CheckForMisbehaviour' (#4907)
srdtrk Oct 18, 2023
bcdceab
test(08-wasm): added 'TestInitialize' using mockVM (#4894)
srdtrk Oct 19, 2023
e3790f5
Use the Response types in TestStatus. (#4910)
DimitrisJim Oct 19, 2023
19368c9
Remove GetSigners from StoreCode msg. (#4911)
DimitrisJim Oct 19, 2023
335286d
style(08-wasm): renamed 'grandpaClientID' -> 'defaultWasmClientID' (#…
srdtrk Oct 19, 2023
f02c619
fix(08-wasm)!: use concrete types for json serialization (#4909)
damiannolan Oct 20, 2023
fb594f6
fix exportedd type refs (#4920)
charleenfei Oct 20, 2023
5121172
chore: make wasm contract api exported (#4927)
damiannolan Oct 23, 2023
02fe742
fix: add build flag directives to ignore e2e test (#4924)
damiannolan Oct 23, 2023
6f4102e
test: `CheckForMisbehaviour` payload using mock vm (#4901)
charleenfei Oct 24, 2023
e655794
Take your time. (#4938)
DimitrisJim Oct 24, 2023
8a0eda1
test: `VerifyClientMessage` using mockVM (#4921)
charleenfei Oct 24, 2023
40ba894
test: adding `VerifyMembership` tests with mock wasm engine (#4923)
damiannolan Oct 25, 2023
dd6d028
test(08-wasm): added 'TestUpdateState' using mockVM (#4914)
srdtrk Oct 25, 2023
e2522b2
Add additional coverage for test initialize. (#4940)
DimitrisJim Oct 25, 2023
8c1ed9a
Add mock test for VerifyUpgradeAndUpdateState (#4930)
DimitrisJim Oct 25, 2023
cb38b85
test: adding verify non membership tests for 08-wasm clients using mo…
damiannolan Oct 25, 2023
1b4ae46
test: `UpdateStateOnMisbehaviour` using mock wasmVM (#4919)
charleenfei Oct 25, 2023
4fa827a
imp(08-wasm): removed panic in `GetCodeHash` and `AddCodeHash` (#4948)
srdtrk Oct 25, 2023
6eb154c
Add ErrMockContract. (#4955)
DimitrisJim Oct 26, 2023
a48b631
Add mock height and check for it in membership tests (#4956)
DimitrisJim Oct 26, 2023
90027e4
Add testing for GetTimestampAtHeight (#4960)
DimitrisJim Oct 26, 2023
90e345a
Remove panic handling testing code for non-panicking methods. (#4957)
DimitrisJim Oct 26, 2023
1d31c73
Update Grandpa Contract Test to work with SDK v0.50 (#4959)
chatton Oct 26, 2023
0abc469
Add mock test for ExportMetadata (#4961)
DimitrisJim Oct 26, 2023
95a1237
feat(08-wasm): use 'clientID' as contract address (#4939)
srdtrk Oct 27, 2023
890ef9d
Move mock engine into testing. (#4936)
DimitrisJim Oct 27, 2023
eea9a7d
Add testing for wasmQuery/wasmCall. (#4934)
DimitrisJim Oct 30, 2023
433f1fa
No formatting necessary. (#4985)
DimitrisJim Oct 30, 2023
ddb514d
Rename entry points to match vm names. (#4986)
DimitrisJim Oct 30, 2023
56fb2af
imp: `CheckSubstituteAndUpdateState` for 08-wasm client (#4974)
charleenfei Oct 30, 2023
1fa22f3
Delete commented out test for tendermint. (#4989)
DimitrisJim Oct 30, 2023
b0142e7
Remove store-code cmd. (#4990)
DimitrisJim Oct 30, 2023
995a3bd
Add mock test for CheckSubstituteAndUpdateState. (#4950)
DimitrisJim Oct 30, 2023
9655a7b
refactor(08-wasm)!: use `collections.KeySet` for code hashes (#4973)
srdtrk Oct 30, 2023
bdcc012
cleanup - creating mock var for client state bytes (#4978)
muku314115 Oct 31, 2023
7fd07ad
Fix TestScheduleIBCUpgrade_Succeeds on wasm branch (#4997)
chatton Oct 31, 2023
16f7d6c
Modify wrappedStore to allow reads from both substitute and subject, …
DimitrisJim Oct 31, 2023
20c73fd
Remove grandpa unit tests covered by e2e. (#4996)
DimitrisJim Oct 31, 2023
0e13d2e
Build and push wasm image in PRs (#4998)
chatton Nov 1, 2023
fe602e0
Add snapshotter extension (#4723)
trinitys7 Nov 1, 2023
9e15947
chore: adding type alias for code hash byte slices (#5004)
damiannolan Nov 1, 2023
30251d4
Moving mock values in a separate file (#5021)
muku314115 Nov 6, 2023
efedb95
Sync gas_register.go with wasmd main (#5007)
chatton Nov 6, 2023
147f0ca
feat(08-wasm): implement 'MigrateContract' RPC endpoint (#5000)
srdtrk Nov 6, 2023
243f36f
chore: rename code ID/checksum to code hash (#5030)
crodriguezvega Nov 7, 2023
729cb09
feat(08-wasm): implement 'RemoveCodeHash' RPC endpoint (#5006)
srdtrk Nov 8, 2023
0be3f39
Merge branch 'main' into feat/wasm-clients
crodriguezvega Nov 9, 2023
1ac7113
Rename wasmInit to wasmInstantiate and Features to Capabilities. (#5065)
DimitrisJim Nov 9, 2023
d7b99e8
chore: rm testsuite ctx and store fields (#5067)
damiannolan Nov 9, 2023
103510a
test(e2e): added migrate contract tests (#5043)
srdtrk Nov 9, 2023
c8e9a09
docs: documentation for 08-wasm (#4203)
crodriguezvega Nov 10, 2023
4d67e4c
linter
charleenfei Nov 10, 2023
3a3a998
Merge branch 'main' into feat/wasm-client
charleenfei Nov 10, 2023
d22682d
linter
charleenfei Nov 10, 2023
bc1f21a
Merge branch 'main' into feat/wasm-client
charleenfei Nov 10, 2023
8c485a1
Set wasmvm cache size to zero. (#5066)
DimitrisJim Nov 10, 2023
1c70944
Add check that wasm contract only modifies code hash in migrateContra…
chatton Nov 13, 2023
86d55a2
small string formatting change
crodriguezvega Nov 13, 2023
d982d5d
chore: remove uneeded checking for static linking.
DimitrisJim Nov 13, 2023
d3f8709
chore: remove SetCodeHash from Coordinator.
DimitrisJim Nov 13, 2023
33d1315
add 08-wasm to go.work.example
crodriguezvega Nov 14, 2023
d0c05d5
Merge branch 'main' into feat/wasm-clients
charleenfei Nov 14, 2023
0bee18b
Fix Upgrade Tests (#5109)
chatton Nov 14, 2023
bde614e
Merge branch 'main' into feat/wasm-clients
DimitrisJim Nov 14, 2023
826df9e
imp: unpin contract in remove code hash (#5103)
crodriguezvega Nov 14, 2023
c53bac7
imp: return `Unauthorised` if code hash is not stored (#5102)
crodriguezvega Nov 14, 2023
825bf2b
add 08-wasm code owners (#5100)
crodriguezvega Nov 14, 2023
716fcdc
imp: check response in instantiate and migrate from wasm vm calls (#5…
crodriguezvega Nov 14, 2023
f4ddaee
address review comments
crodriguezvega Nov 14, 2023
1cf7a2f
add validate genesis
crodriguezvega Nov 14, 2023
c24f8ed
gofumpt
crodriguezvega Nov 14, 2023
e71b80f
remove grandpa tests using test data
crodriguezvega Nov 15, 2023
edc525f
unused field
crodriguezvega Nov 15, 2023
7b377ea
Add an error-ing implementation for GoAPI. (#5105)
DimitrisJim Nov 15, 2023
3b1cb9a
Rename codeid/codehash to checksum (#5107)
DimitrisJim Nov 15, 2023
ff6f9a7
Merge branch 'main' into feat/wasm-clients
crodriguezvega Nov 15, 2023
c983119
Go mod tidy on 08-wasm.
DimitrisJim Nov 15, 2023
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
12 changes: 9 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
/modules/light-clients/ @colin-axner @AdityaSripal @damiannolan
/proto/ibc/lightclients/ @colin-axner @AdityaSripal @damiannolan

# CODEOWNERS for 08-wasm light client module

/modules/light-clients/08-wasm/ @colin-axner @AdityaSripal @damiannolan @charleenfei @chatton @DimitrisJim @srdtrk

# CODEOWNERS for ICS 20

/modules/apps/transfer/ @colin-axner @AdityaSripal @damiannolan
Expand All @@ -38,9 +42,11 @@
/modules/apps/29-fee/ @AdityaSripal @charleenfei @colin-axner @damiannolan
/proto/ibc/applications/fee/ @AdityaSripal @charleenfei @colin-axner @damiannolan

# CODEOWNERS for docs
/docs/ @colin-axner @AdityaSripal @crodriguezvega @charleenfei @damiannolan @chatton @DimitrisJim @srdtrk

# CODEOWNERS for callbacks middleware

/modules/apps/callbacks/ @colin-axner @AdityaSripal @damiannolan @srdtrk

# CODEOWNERS for docs

/docs/ @colin-axner @AdityaSripal @crodriguezvega @charleenfei @damiannolan @chatton @DimitrisJim @srdtrk

12 changes: 11 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,14 @@ updates:
interval: daily
open-pull-requests-limit: 10
labels:
- dependencies
- dependencies

- package-ecosystem: gomod
directory: "/modules/light-clients/08-wasm"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- dependencies


44 changes: 44 additions & 0 deletions .github/workflows/build-wasm-simd-image-from-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build Wasm Simd Image
on:
workflow_dispatch:
inputs:
tag:
description: 'The tag of the image to build'
required: true
type: string

env:
REGISTRY: ghcr.io
ORG: cosmos
IMAGE_NAME: ibc-go-wasm-simd
GIT_TAG: "${{ inputs.tag }}"

jobs:
build-image-at-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "${{ env.GIT_TAG }}"
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: make python-install-deps
- name: Log in to the Container registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: |
# remove any `/` characters from the docker tag and replace them with a -

version="$(scripts/get-libwasm-version.py --get-version)"
checksum="$(scripts/get-libwasm-version.py --get-checksum)"

docker_tag="$(echo $GIT_TAG | sed 's/\//-/')"
docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" -f modules/light-clients/08-wasm/Dockerfile --build-arg LIBWASM_VERSION=${version} --build-arg LIBWASM_CHECKSUM=${checksum}
docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}"
52 changes: 52 additions & 0 deletions .github/workflows/e2e-test-workflow-call.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ibc-go-simd
IMAGE_NAME_WASM: ibc-go-wasm-simd

jobs:
# test-details exists to provide an easy way to see the inputs for the e2e test.
Expand Down Expand Up @@ -129,6 +130,56 @@ jobs:
build-args: |
IBC_GO_VERSION=${{ github.ref_name }}

docker-build-wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: ${{ inputs.build-and-push-docker-image }}

- uses: actions/setup-python@v4
if: ${{ inputs.build-and-push-docker-image }}
with:
python-version: '3.10'

- name: Install dependencies
if: ${{ inputs.build-and-push-docker-image }}
run: make python-install-deps

- name: Determine Build arguments
if: ${{ inputs.build-and-push-docker-image }}
id: build-args
run: |
echo "version=$(scripts/get-libwasm-version.py --get-version)" >> $GITHUB_OUTPUT
echo "checksum=$(scripts/get-libwasm-version.py --get-checksum)" >> $GITHUB_OUTPUT

- name: Log in to the Container registry
if: ${{ inputs.build-and-push-docker-image }}
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
if: ${{ inputs.build-and-push-docker-image }}
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934
with:
images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME_WASM }}

- name: Build and push Docker image
if: ${{ inputs.build-and-push-docker-image }}
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
file: modules/light-clients/08-wasm/Dockerfile
build-args: |
LIBWASM_VERSION=${{ steps.build-args.outputs.version }}
LIBWASM_CHECKSUM=${{ steps.build-args.outputs.checksum }}


# dynamically build a matrix of test/test suite pairs to run.
# this job runs a go tool located at cmd/build_test_matrix/main.go.
# it walks the e2e/test directory in order to locate all test suite / test name
Expand Down Expand Up @@ -160,6 +211,7 @@ jobs:
needs:
- build-test-matrix
- docker-build
- docker-build-wasm
env:
CHAIN_IMAGE: '${{ inputs.chain-image }}'
CHAIN_A_TAG: '${{ inputs.chain-a-tag }}'
Expand Down
22 changes: 1 addition & 21 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,14 @@ jobs:
echo "Using tag $tag"
echo "simd-tag=$tag" >> $GITHUB_OUTPUT
fi
# build-e2e ensures that all test code compiles.
build-e2e:
if: ${{ !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build e2e
run: |
cd e2e
find ./tests -type d | while IFS= read -r dir
do
if ls "${dir}"/*.go >/dev/null 2>&1; then
go test -c "$dir"
fi
done

# e2e generates the e2e tests for the non-forked PRs. It does so by using the
# e2e-test-workflow-call.yml each test runs the jobs defined in that file.
e2e:
# we will be running this job if the PR has not yet been marked for review, and we push additional changes.
# we skip the job in this case.
if: ${{ !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
needs:
- determine-image-tag # we are required to have a docker tag before we can build any images.
- build-e2e # don't attempt any tests unless the e2e code compiles successfully.
needs: determine-image-tag # we are required to have a docker tag before we can build any images.
uses: ./.github/workflows/e2e-test-workflow-call.yml
# unless we explicitly tell the workflow to inherit secrets, required secrets such as GITHUB_TOKEN will not be
# provided to the workflow. This would cause privileged operations to fail.
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-arch: ['amd64', 'arm', 'arm64']
go-arch: ['amd64', 'arm64']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
Expand All @@ -51,13 +51,19 @@ jobs:
go.sum
- name: Build ibc-go
run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false make build
- name: Install compiler for arm64.
if: matrix.go-arch == 'arm64'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Build e2e
run: |
cd e2e
find ./tests -type d | while IFS= read -r dir
do
if ls "${dir}"/*.go >/dev/null 2>&1; then
GOARCH=${{ matrix.go-arch }} go test -c "$dir"
CGO_ENABLED=1 GOARCH=${{ matrix.go-arch }} go test -c "$dir"
fi
done

Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/wasm-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Wasm Light-Client
# This workflow runs when a PR is opened that targets code that is part of the wasm light-client.
on:
pull_request:
paths:
- '.github/workflows/wasm-client.yml'
- 'modules/light-clients/08-wasm/**'
- 'proto/ibc/lightclients/wasm/**'
permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- uses: actions/checkout@v3
- uses: golangci/golangci-lint-action@v3.6.0
with:
version: v1.54.2
args: --timeout 10m
working-directory: modules/light-clients/08-wasm

build:
runs-on: ubuntu-latest
strategy:
matrix:
go-arch: ['amd64', 'arm64']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
# Install cross compiler for ARM64. Export CC env variable.
- name: Install compiler for arm64.
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
if: matrix.go-arch == 'arm64'
- name: Build wasm-client
run: |
cd modules/light-clients/08-wasm
GOARCH=${{ matrix.go-arch }} CGO_ENABLED=1 go build ./...

tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Go Test
run: |
cd modules/light-clients/08-wasm
go test -v -mod=readonly ./...
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ artifacts
baseapp/data/*
client/lcd/keys/*
mytestnet
modules/light-clients/08-wasm/**/ibc_08-wasm_client_data/

# Testing
coverage.txt
Expand Down Expand Up @@ -58,9 +59,14 @@ dependency-graph.png

*.history

tmp/
*.wasm
# Go
go.work
go.work.sum

# E2E WASM contract
!ics10_grandpa_cw.wasm

# Python
venv
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ COPY go.sum .

RUN go mod download

RUN BUILD_TAGS=muslc make build
RUN make build

FROM alpine:3.18
ARG IBC_GO_VERSION
Expand All @@ -33,4 +33,3 @@ LABEL "org.cosmos.ibc-go" "${IBC_GO_VERSION}"
COPY --from=builder /go/build/simd /bin/simd

ENTRYPOINT ["simd"]

6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS)))
endif
ldflags += $(LDFLAGS)
ldflags := $(strip $(ldflags))

BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'
# check for nostrip option
ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS)))
Expand Down Expand Up @@ -137,6 +136,11 @@ go.sum: go.mod
go mod verify
go mod tidy

python-install-deps:
@echo "Installing python dependencies..."
@pip3 install --upgrade pip
@pip3 install -r requirements.txt

###############################################################################
### Documentation ###
###############################################################################
Expand Down
Loading
Loading