Skip to content

Commit d9c3e5e

Browse files
authored
svm: build ntt the proper way on other svms (#730)
* solana: use updated crates We no longer need to depend on backported forks of `wormhole-anchor-sdk`, `wormhole-verify-vaa-shim-interface`, and `wormhole-post-message-shim-interface` as these have been updated to support all anchor versions. Furthermore, the new versions of these crates encode the program IDs (such as Wormhole) as a static value again, meaning they will be in the rodata section of the binary just like before, so the binary patching method works on them for replacing the address. * cli: properly build svm binaries by passing core address Newer versions of NTT support a `bridge-address-from-env` flag, which allows specifying the address of the Wormhole program from an environment variable rather than relying on a pre-defined set of addresses. We use that flag when available, and fall back to patching the binary when it's not. This way of detecting the cargo flag allows us to: - build the binary properly for new versions going forward - support building older NTT releases without modification for other SVMs (e.g. fogo) by patching the binary - if the `bridge-address-from-env` feature is backported to older NTTs (should be straightforward), then the CLI will just pick up that compilation path automatically
1 parent bf14e28 commit d9c3e5e

File tree

12 files changed

+360
-151
lines changed

12 files changed

+360
-151
lines changed

.github/workflows/solana.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ jobs:
4747
run: cargo fmt --check --all --manifest-path Cargo.toml
4848

4949
- name: Run `cargo check`
50-
run: cargo check --workspace --tests --manifest-path Cargo.toml
50+
run: cargo check --workspace --tests --manifest-path Cargo.toml --features mainnet
5151

5252
- name: Run `cargo clippy`
53-
run: cargo clippy --workspace --tests --manifest-path Cargo.toml -- -Dclippy::cast_possible_truncation
53+
run: cargo clippy --workspace --tests --manifest-path Cargo.toml --features mainnet -- -Dclippy::cast_possible_truncation
5454

5555
- name: Cache solana tools
5656
id: cache-solana
@@ -83,7 +83,7 @@ jobs:
8383
cargo build-sbf --features "mainnet"
8484
cargo test-sbf -p "example-native-token-transfers" --features "mainnet"
8585
cargo test-sbf -p "ntt-transceiver" --features "mainnet,testing"
86-
cargo test
86+
cargo test --features "mainnet"
8787
8888
check-version:
8989
name: Check version

0 commit comments

Comments
 (0)