Skip to content

Commit

Permalink
Merge branch 'main' into fix/corr
Browse files Browse the repository at this point in the history
  • Loading branch information
cypherpepe authored Dec 24, 2024
2 parents e14300a + 1dbe845 commit 4b8e028
Show file tree
Hide file tree
Showing 90 changed files with 4,904 additions and 2,409 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/solana/ @kcsongor @a5-pickle
/sui/ @kcsongor @a5-pickle @gator-boi
/terra/ @kcsongor @a5-pickle
/wormchain/ @nik-suri @johnsaigle @mdulin2 @jtieri
/wormchain/ @nik-suri @johnsaigle @mdulin2 @joelsmith-2019

# Utilities

Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/wormchain-icts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Wormchain's end-to-end Interchain Tests

on:
pull_request:
push:
tags:
- "**"
branches:
- "main"

permissions:
contents: read
packages: write

env:
GO_VERSION: 1.21

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
e2e-tests:
runs-on: ubuntu-latest
strategy:
matrix:
# names of `make` commands to run tests
test:
- "ictest-cancel-upgrade"
- "ictest-upgrade"
- "ictest-wormchain"
- "ictest-ibc-receiver"
fail-fast: false

steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: interchaintest/go.sum

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

- name: Run Test
id: run_test
continue-on-error: true
working-directory: wormchain
run: make ${{ matrix.test }}

- name: Retry Failed Test
if: steps.run_test.outcome == 'failure'
working-directory: wormchain
run: |
for i in 1 2; do
echo "Retry attempt $i"
if make ${{ matrix.test }}; then
echo "Test passed on retry"
exit 0
fi
done
echo "Test failed after retries"
exit 1
19 changes: 17 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ config.define_bool("ci", False, "We are running in CI")
config.define_bool("manual", False, "Set TRIGGER_MODE_MANUAL by default")

config.define_string("num", False, "Number of guardian nodes to run")
config.define_string("maxWorkers", False, "Maximum number of workers for sdk-ci-tests. See https://jestjs.io/docs/cli#--maxworkersnumstring")

# You do not usually need to set this argument - this argument is for debugging only. If you do use a different
# namespace, note that the "wormhole" namespace is hardcoded in tests and don't forget specifying the argument
Expand Down Expand Up @@ -77,6 +78,7 @@ config.define_bool("query_server", False, "Enable cross-chain query server")

cfg = config.parse()
num_guardians = int(cfg.get("num", "1"))
max_workers = cfg.get("maxWorkers", "50%")
namespace = cfg.get("namespace", "wormhole")
webHost = cfg.get("webHost", "localhost")
ci = cfg.get("ci", False)
Expand Down Expand Up @@ -485,6 +487,12 @@ if solana or pythnet:

# solana local devnet

docker_build(
ref = "solana-test-validator",
context = "solana",
dockerfile = "solana/Dockerfile.test-validator",
)

k8s_yaml_with_ns("devnet/solana-devnet.yaml")

k8s_resource(
Expand Down Expand Up @@ -631,8 +639,10 @@ if ci_tests:
k8s_yaml_with_ns(
encode_yaml_stream(
set_env_in_jobs(
set_env_in_jobs(read_yaml_stream("devnet/tests.yaml"), "NUM_GUARDIANS", str(num_guardians)),
"BOOTSTRAP_PEERS", str(ccqBootstrapPeers)))
set_env_in_jobs(
set_env_in_jobs(read_yaml_stream("devnet/tests.yaml"), "NUM_GUARDIANS", str(num_guardians)),
"BOOTSTRAP_PEERS", str(ccqBootstrapPeers)),
"MAX_WORKERS", max_workers))
)

# separate resources to parallelize docker builds
Expand Down Expand Up @@ -672,12 +682,14 @@ if terra_classic:
ref = "terra-image",
context = "./terra/devnet",
dockerfile = "terra/devnet/Dockerfile",
platform = "linux/amd64",
)

docker_build(
ref = "terra-contracts",
context = "./terra",
dockerfile = "./terra/Dockerfile",
platform = "linux/amd64",
)

k8s_yaml_with_ns("devnet/terra-devnet.yaml")
Expand All @@ -698,13 +710,15 @@ if terra2 or wormchain:
context = ".",
dockerfile = "./cosmwasm/Dockerfile",
target = "artifacts",
platform = "linux/amd64",
)

if terra2:
docker_build(
ref = "terra2-image",
context = "./cosmwasm/deployment/terra2/devnet",
dockerfile = "./cosmwasm/deployment/terra2/devnet/Dockerfile",
platform = "linux/amd64",
)

docker_build(
Expand Down Expand Up @@ -812,6 +826,7 @@ if wormchain:
ref = "wormchaind-image",
context = ".",
dockerfile = "./wormchain/Dockerfile",
platform = "linux/amd64",
build_args = {"num_guardians": str(num_guardians)},
only = [],
ignore = ["./wormchain/testing", "./wormchain/ts-sdk", "./wormchain/design", "./wormchain/vue", "./wormchain/build/wormchaind"],
Expand Down
13 changes: 8 additions & 5 deletions aptos/Docker.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# first build the image
# build the image and tag it appropriately

<!-- cspell:disable-next-line -->
(cd ..; DOCKER_BUILDKIT=1 docker buildx build --platform linux/amd64 -f aptos/Dockerfile.base -t aptos .)
<!-- cspell:disable -->

# tag the image with the appropriate version
```bash
cd .. && docker buildx build --platform linux/amd64,linux/arm64 -f aptos/Dockerfile.base -t ghcr.io/wormhole-foundation/aptos:3.1.0 .
```

docker tag aptos:latest ghcr.io/wormhole-foundation/aptos:3.1.0
<!-- cspell:enable -->

# push to ghcr

```bash
docker push ghcr.io/wormhole-foundation/aptos:3.1.0
```
2 changes: 1 addition & 1 deletion aptos/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM cli-gen AS cli-export
FROM const-gen AS const-export
FROM ghcr.io/wormhole-foundation/aptos:3.1.0@sha256:c359f25cd6b2cd9edb2634504756a3b179cd416fd73fda59f66c48168e3b69da as aptos
FROM ghcr.io/wormhole-foundation/aptos:3.1.0@sha256:f66c2b5fea4a75050d051a5260ef643f52f5048d473877f1760be39d9e460d6b AS aptos

# Install nodejs
# todo(aki): move this into base image?
Expand Down
4 changes: 2 additions & 2 deletions aptos/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.62@sha256:5777f201f507075309c4d2d1c1e8d8219e654ae1de154c844341050016a64a0c as aptos-node
FROM rust:1.62@sha256:2cd5c8517d0640bd287b2cfb4c0e62f1a8ed86174764d88280bc2a106d6835db AS aptos-node

RUN apt-get update && apt-get -y install libclang-dev libudev-dev libdw-dev jq cmake curl npm gcc g++ make lld

Expand All @@ -11,5 +11,5 @@ WORKDIR /tmp/aptos-core
RUN git reset --hard 6f83bc6d02207298b2dee91133d75538789bf582
RUN cargo build -p aptos --profile cli

FROM rust:1.62@sha256:5777f201f507075309c4d2d1c1e8d8219e654ae1de154c844341050016a64a0c as export-stage
FROM rust:1.62@sha256:2cd5c8517d0640bd287b2cfb4c0e62f1a8ed86174764d88280bc2a106d6835db AS export-stage
COPY --from=aptos-node /tmp/aptos-core/target/cli/aptos /usr/local/cargo/bin/aptos
2 changes: 1 addition & 1 deletion clients/js/src/chains/sui/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ export const setMaxGasBudgetDevnet = (
network: Network,
tx: TransactionBlock
) => {
if (network === "Devnet") {
if (network === "Devnet" || network === "Testnet") {
// Avoid Error checking transaction input objects: GasBudgetTooHigh { gas_budget: 50000000000, max_budget: 10000000000 }
tx.setGasBudget(10000000000);
}
Expand Down
9 changes: 7 additions & 2 deletions clients/js/src/cmds/verifyVaa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ export const handler = async (
const network = getNetwork(argv.network);

const buf = Buffer.from(String(argv.vaa), "hex");
const contract_address = contracts.coreBridge(network, "Ethereum");
const contract_address =
network === "Testnet"
? contracts.coreBridge(network, "Sepolia")
: contracts.coreBridge(network, "Ethereum");
if (!contract_address) {
throw Error(`Unknown core contract on ${network} for ethereum`);
}

const provider = new ethers.providers.JsonRpcProvider(
NETWORKS[network].Ethereum.rpc
network === "Testnet"
? NETWORKS[network].Sepolia.rpc
: NETWORKS[network].Ethereum.rpc
);
const contract = Implementation__factory.connect(contract_address, provider);
const result = await contract.parseAndVerifyVM(buf);
Expand Down
61 changes: 57 additions & 4 deletions cosmwasm/Cargo.lock

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

2 changes: 1 addition & 1 deletion cosmwasm/contracts/global-accountant/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ wormhole-sdk = { workspace = true, features = ["schemars"] }

[dev-dependencies]
anyhow = { version = "1", features = ["backtrace"] }
cw-multi-test = "0.13.2"
cw-multi-test = "0.14"
serde-json-wasm = "0.4"
wormhole-bindings = { version = "0.1", features = ["fake"] }
2 changes: 1 addition & 1 deletion cosmwasm/contracts/ntt-global-accountant/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ wormhole-sdk = { workspace = true, features = ["schemars"] }

[dev-dependencies]
anyhow = { version = "1", features = ["backtrace"] }
cw-multi-test = "0.13.2"
cw-multi-test = "0.14"
serde-json-wasm = "0.4"
wormhole-bindings = { version = "0.1", features = ["fake"] }
2 changes: 1 addition & 1 deletion cosmwasm/contracts/wormchain-ibc-receiver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ wormhole-sdk = { workspace = true, features = ["schemars"] }
serde_wormhole.workspace = true

[dev-dependencies]
cw-multi-test = "0.13.2"
cw-multi-test = "0.14"
serde-json-wasm = "0.4"
wormhole-bindings = { version = "0.1.0", features=["fake"] }
serde = { version = "1.0.137", default-features = false, features = ["derive"] }
9 changes: 9 additions & 0 deletions cosmwasm/contracts/wormhole/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ k256 = { version = "0.11", default-features = false, features = ["ecdsa"] }
sha3 = { version = "0.9.1", default-features = false }
generic-array = { version = "0.14.4" }
hex = "0.4.2"

[dev-dependencies]
cw-multi-test = "0.14"
serde_wormhole.workspace = true
wormhole-sdk.workspace = true
wormhole-bindings = { version = "0.1", features = ["fake"] }
tiny-keccak = { version = "2.0", features = ["keccak"] }
serde-json-wasm = "0.4"
wormchain-ibc-receiver = { path = "../wormchain-ibc-receiver" }
Loading

0 comments on commit 4b8e028

Please sign in to comment.