Commit Graph

465 Commits

Author SHA1 Message Date
heyitaki b7d870efcb docker: reorganize dockerfiles 2022-12-21 10:58:22 -08:00
Hendrik Hofstadt 6c7d44ca85
ci: Fix flaky solana tests and improve CI time (#2148)
* solana: remove sync from tests

Change-Id: I8c123ea87e78732541e5040e8653bc114ce95404

* ci: cache more rust build artifacts

Change-Id: I436f27de38651cdb2a9c73b58f20d44b4392c336
2022-12-21 14:24:50 +01:00
Csongor Kiss 3b8683f18e solana/tilt: run registrations in parallel (#1826)
Doing so reduces the time it takes to do the registrations from ~90s to
~9s, a 10x improvement.
2022-10-29 09:10:16 -04:00
kii fbefb3aced
tob-worm-4-panics: using options rather than unwrap & tob-worm-9: cosmwasm test build (#1672)
* tob-worm-4-panics: using options rather than unwrap

* removed mock dependencies argument

* added test to make file

* use ok or else

* fmt

* ok

* errors resolved
2022-10-26 12:39:31 -04:00
A5 Pickle e109024e99
sdk/js: Remove Solana WASM Dependencies (#1375)
* sdk/js: Remove Solana WASM Dependencies

* sdk/js: Uptick @solana/web3.js and @solana/spl-token versions

* solana: Add IDLs for Wormhole, Token Bridge and NFT Bridge

* sdk/js: Remove Solana WASM to Use IDL Coders

* sdk/js: Remove src/migration

* sdk/js: Add CPI Account Getters

* testing: Add solana-test-validator SDK tests

* sdk/js: add CHANGELOG.md

* sdk/js: remove await

* sdk/js: fix getIsTransferCompletedAptos

* sdk/js: aptos integration test waits for tx

* sdk/js: remove commented out code

* sdk/js: fix inferred type

Co-authored-by: A5 Pickle <a5-pickle@users.noreply.github.com>
Co-authored-by: Evan Gray <battledingo@gmail.com>
2022-10-26 10:28:46 -04:00
Csongor Kiss 3877f6f3c3 tilt: register aptos on other chains 2022-10-15 15:17:36 +01:00
Chirantan Ekbote 7f4b0d1a09 Wormhole chain integration
This is a squashed commit of all the changes needed to integrate
wormhole chain into the main repo.
2022-10-03 17:34:42 +09:00
Ali Behjati 97617cb5ce
Solitaire: Use sysvar for rent instead of default (#1505)
* Solitaire: Use sysvar for rent instead of default

Using default has some risks such as:
- Network having a different values (such as Pythnet)
- Network changes the value

It avoids using default as fallback to have Error more explicitly
avoid exposing above risks under rare conditions
that the sysvar might return Err.

* Update comments

* Format the code
2022-09-30 15:53:02 -05:00
kev1n-peters c5d2f9d54d
sdk/js: Near refactor, added integration tests (#1648)
* near-sdk-refactor: Fix attest
                 : Fix missing function calls
                 : make near on near
                 : renamed tryHexToNativeStringNear

* near-sdk-refactor: bumped near-sdk-js version

Co-authored-by: Josh Siegel <jsiegel@jumptrading.com>
2022-09-28 08:53:15 -05:00
Chirantan Ekbote d5b7bee86e solana: Add fmt, check, clippy, and test targets to Makefile
Add fmt, check, and clippy targets to the Makefile so that people don't
have to remember the exact set of parameters needed.  Also fix the test
target since we no longer run the tests through docker.
2022-09-20 23:00:47 +09:00
Chirantan Ekbote 9d7e56bbfc Don't run solana CI in Tilt
Now that we have a github action to run the solana checks we no longer
need to run it in Tilt.
2022-09-20 23:00:47 +09:00
Chirantan Ekbote 0f0ea48fdc solana: Fix clippy warnings 2022-09-20 23:00:47 +09:00
Chirantan Ekbote e377a75e2b solana: run `cargo fmt` 2022-09-20 23:00:47 +09:00
Chirantan Ekbote 25dde0b614 solana: bridge: Fix unused variable warning 2022-09-20 23:00:47 +09:00
Chirantan Ekbote 6c4aad8610 solana: nft_bridge: Replace deprecated function
The replacement function seems like it does the same thing but with an
instruction enum instead.
2022-09-20 23:00:47 +09:00
Evan Gray f28e39c490 certusone -> wormhole-foundation 2022-08-26 12:48:14 -04:00
Csongor Kiss d43d015c57 solana: Add solana sdk upgrade instructions 2022-08-17 15:30:01 +01:00
Stan Drozd 18eac4e3d3 solana: bump: Rust nightly-2022-07-12, SOL SDK v1.10.31, rust container 1.60
solana: use prebuild docker image for 1.10.31

solana: use the right rust version

from https://github.com/solana-labs/solana/blob/v1.10.31/ci/rust-version.sh

nft_bridge: TransportError -> BanksClientError

solana/Dockerfile.wasm: Use rust-toolchain instead of rustup
2022-08-17 15:30:01 +01:00
Stan Drozd 2092484e73 solitaire: shrink stack footprint by boxing FromAccounts::from() 2022-08-17 15:30:01 +01:00
bruce-riley f0b7225591
Pythnet mainnet deploy (#1388) 2022-08-04 09:51:38 -05:00
Reisen 5da7ad0ef5 solitaire: reduce Claim complexity 2022-07-15 13:12:27 -05:00
Reisen 82ea938317 solitaire: remove recursive FromAccounts and 'c lifetime.
Solitaire parses accounts using two traits, FromAccounts and Peel. The
FromAccounts derive macro generates a function, `FromAccounts::from()`,
which calls `Peel::peel` to construct each field in the struct:

```
let example = Example {
    foo: Peel::peel(next_account_iter(accs)?),
    bar: Peel::peel(next_account_iter(accs)?),
    baz: Peel::peel(next_account_iter(accs)?),
    ...,
}
```

The FromAccounts derivation also attempts to implement Peel for the
structure itself however, which means `Example` itself is embeddable as
a field in another accounts struct. This is only used in ClaimableVAA
which is a large source of confusion and the complexity is not worth
maintaining.

This commit removes the recursion by:

1) Removing the `impl Peel` derived by FromAccounts.
2) Removes the AccountInfo iterator from Context as it is no longer needed.
3) Adds the current parsed account to Context instead, safe thanks to (2)
4) Move message out of ClaimableVAA and pass in to verify everywhere instead.
5) Removes Peel/FromAccounts from ClaimableVAA.
2022-07-15 13:12:27 -05:00
Csongor Kiss f4b890f342
solana: Fix verify script (#1356) 2022-07-14 17:11:42 -05:00
swimricky bf690e9adc
solana: fix payload3 deserialization (#1354)
* fix solana payload3 deserialization and add rust integration & unit tests

* add integration test for complete_native_with_payload
2022-07-14 13:30:38 -05:00
Csongor Kiss 9d74a80aa0
Optimise solana dockerfiles (#1334)
* solana/devnet_setup.sh: Build CLI instead of JITing it

This makes the registration process a few seconds faster.

* solana/Dockerfile: Don't copy devnet_setup.sh at the beginning

This is unnecessary, and inefficient, because each time the file
changes, a lot of things get rebuilt/reinstalled.

* solana/Dockerfile: cache cargo registry

this allows skipping rebuilding cargo dependencies. Small contract
changes now rebuild in 20s, down from 60s before

* Remove unnecessary debian depencies

* Rename rust-toolchain.toml to rust-toolchain (rustup in the container
  didn't recognise it with .toml extension) and use in containers
  instead of manually specifying rust version

* solana/Dockerfile: Use prebuilt docker image

* solana: Add docs on docker base images
2022-07-14 12:29:33 -05:00
Evan Gray 061244dc17 sdk/js: publish separate wasm package 2022-07-13 10:04:23 -04:00
claudijd 8221708ef0 Move from ADD to COPY on Dockerfiles 2022-07-13 09:27:15 -04:00
Csongor Kiss 9b4ac93c0a
solana: fix network handling in verify script (#1340) 2022-07-07 07:21:33 +01:00
Csongor Kiss 47318c2a03
solana: Add "msg.sender" and remove fee from payload3 (#1279)
* solana: Add "msg.sender" and remove fee from payload3

* solana: update payload3 instruction to include the sender account

* solana: allow sending payload 3s to program ids directly

Co-authored-by: Csongor Kiss <ckiss@jumptrading.com>
2022-06-30 18:37:46 +01:00
Csongor Kiss be38cf5d7e solana: Update last_lamports after transfer_fees 2022-06-28 13:08:13 +01:00
Hendrik Hofstadt f1dba4adfe
Allow account reuse for message posting (#1077)
* Implement message posting with account reuse

Change-Id: I195f493f6816048f5f8f76e1f0f6e561fa0fe692

* Use different magic for unreliable messages

* guardiand: Ignore solana instructions with empty data

Co-authored-by: Csongor Kiss <ckiss@jumptrading.com>
2022-06-27 09:57:25 +01:00
Reisen 4131381fa4 solitaire: remove unused InstructionContext 2022-06-24 13:51:50 +02:00
Reisen a8d1ed129b solitaire: remove unused client code 2022-06-24 13:51:50 +02:00
Reisen 9aad49d631 solitaire: remove unused deps 2022-06-24 13:51:50 +02:00
Evan Gray db0fc219aa cosmwasm: terra2 support
Co-authored-by: Csongor Kiss <ckiss@jumptrading.com>
2022-06-21 10:03:57 -04:00
Csongor Kiss 2e220a6f76
Solana fix warnings (#1226)
* solana: fix all rustc warnings

* solana: fix clippy warnings

* Remove manual memcpy + other warning suppressions

Co-authored-by: Csongor Kiss <ckiss@jumptrading.com>
2022-06-10 17:59:15 +01:00
Hendrik Hofstadt ee4583099f solana: token bridge transfer with payload 2022-05-11 21:24:36 -04:00
Chirantan Ekbote 82bdad094a solana: Run nft-bridge tests in CI 2022-05-10 00:58:43 +09:00
Chirantan Ekbote defd16e084 solana: nft-bridge: Add tests
The integration tests were previously just copied over from the
token-bridge directory and not changed at all (they still referenced the
token-bridge crate).

Clean up the files and add tests for basic functionality like sending
and receiving native + wrapped NFTs.
2022-05-10 00:58:43 +09:00
Chirantan Ekbote 66f031c51b Run token-bridge tests in CI
Update the dockerfile, tiltfile, and makefile so that the token-bridge
tests are included when running in CI.
2022-05-10 00:58:43 +09:00
Chirantan Ekbote ff40fa34b8 solana: token-bridge: Fix tests
Refactor the tests so that we can run them with `cargo test-bpf`.
2022-05-10 00:58:43 +09:00
Chirantan Ekbote 06c79838bd solana: bridge: Delete makefile
The tests no longer need a running instance of the test validator so
this is no longer necessary.
2022-05-10 00:58:43 +09:00
Chirantan Ekbote 589c8023d0 Add test target to solana Makefile 2022-05-10 00:58:43 +09:00
Chirantan Ekbote efdc560976 Run solana tests in Tilt
Refactor the solana Dockerfile so that the solana release installation
is a separate stage and have the builder stage derive from it.  Add a
new "ci_tests" stage that also derives from the solana stage but runs
the integration tests instead.

Invoke the solana ci_tests stage from the Tiltfile when ci_tests are
enabled.
2022-05-10 00:58:43 +09:00
Chirantan Ekbote 24dd6ed48b solana: bridge: Fix tests
Fix all the tests for the solana bridge program so that we can start
running it in CI.

Use the `solana-program-test` crate as the test framework. Previously,
running the tests required spinning up a test validator and manually
deploying the program there. Now developers can just do `cargo test-bpf`
to run the tests without needing any additional setup (beyond installing
the solana tools). This also lets us split out the tests so that they
can be run separately rather than having to run everything sequentially
in a single integration test.
2022-05-10 00:58:43 +09:00
Csongor Kiss 1c006f9bed
cli: Refactor js cli to support all contracts + add improvements (#1100)
* cli: Refactor js cli to support all contracts + add improvements

* Fix path in Makefile

* Don't be strict

* Fix registration VAA deserialisation

* Add karura gas calculation logic

* cli: fix after sdk rebase

* cli: improve makefile

* cli: depend on @certusone/wormhole-sdk locally instead of importing relative paths

* cli: add polygon overrides

* client: update for devnet

* fix tx signing in solana cli

* client: alias network

Co-authored-by: Csongor Kiss <ckiss@jumptrading.com>
Co-authored-by: Evan Gray <battledingo@gmail.com>
2022-05-05 20:51:24 -04:00
Evan Gray cc72c2a644 algo: contracts 2022-04-29 20:56:17 -04:00
Csongor Kiss da479cf4c1 solitaire: fix initialisation check 2022-04-21 19:07:15 +01:00
Chirantan Ekbote 3fdd9ccc3e solana: Merge into single workspace
Merge all the separate solana crates into a single workspace.  This is
the same thing we do for terra and will make it easier to check / lint /
test all the crates together.
2022-04-20 09:37:30 +09:00
justinschuldt 0a7168c107 move guardian-set-init.sh to docker/tilt 2022-04-12 20:37:52 -05:00