Commit Graph

429 Commits

Author SHA1 Message Date
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
justinschuldt 33298ca722 solana-devnet init multiple guardians 2022-04-12 20:37:52 -05:00
Csongor Kiss 4227dde53b Improve and document deployment&verification workflow 2022-04-11 21:29:39 -04:00
Csongor Kiss ff15ca3a67 Document AccountState
* Don't use option_env
* Fix 'cargo test' (it was failing on ambiguous module names)
2022-04-11 21:29:39 -04:00
Hendrik Hofstadt c04d25e704 Fix solana integration tests & add test for account creation
Change-Id: I222744f194f952d03bfbd3ba4469bce59c310fc0
2022-04-11 21:29:39 -04:00
Hendrik Hofstadt 2b56fcc7da solitaire: Fix prefunded accounts blocking creation
Change-Id: I8841e6595b7f8bb217991515bb9ae1ae3d4f4607
2022-04-11 21:29:39 -04:00
Reisen 4e13d9d49c solana/token_bridge: Add blacklisted keys 2022-04-11 21:29:39 -04:00
Csongor Kiss f60acc59ab
solitaire: Infer entry point argument type in solitaire! macro (#927)
The type of the `ix_data` binding withing the solitaire! macro expansion
is explicitly annotated with its type, which comes from the macro's
pattern binding `$kind`. However, this type annotation is entirely
optional, since `ix_data` is passed in as an argument to `$fn`, whose
type forecs `ix_data` anyway, and rust will happily infer that from the
application. So we remove the explicit annotation which makes the entry
point macro easier to use.

commit-id:d428306c
2022-03-16 18:25:41 +00:00
Evan Gray a3272dce4a remove pyth2wormhole 2022-03-07 10:23:34 -05:00
Stan Drozd 972939ee31 pyth2wormhole: Fix attestation validation bug
commit-id:567942d7
2022-03-02 15:55:46 +01:00
Evan Gray 695dcac26c support custom root ca 2022-03-01 12:35:27 -05:00
Stan Drozd 0642288697 pyth2wormhole: rustfmt --config-path solana/rustfmt.toml
commit-id:a4fae495
2022-02-28 12:29:58 +00:00
Stan Drozd 1e953e637f pyth2wormhole-client: make sure we raise batch errors on exit
commit-id:65022128
2022-02-24 19:40:04 +01:00
Stanisław Drozd 2ea41b8176
[WIP] Pr/drozdziak1/p2w batching/5e704f8b (#877)
* ethereum: p2w contract -> p2w emitter, fill in essential envs

Change-Id: I6fa9364a96738d2cc02ec829a31fedba0586d8e8

commit-id:0a56f1f8

* Add p2w-relay, a p2w-sdk integration test

commit-id:6bfab639

* p2w-sdk: Expand README

Change-Id: I17cb547d6aaddc240588923561c26d11a787df2e

commit-id:6ebd6a22

* p2w-sdk: don't build ETH contracts, only the types

Change-Id: I7cbd18328227700635d7688aa24a9671e8919fcd

commit-id:adf079f7

* p2w: configurability and sane envs

commit-id:f10fd90e

* Solitaire: Implement Option<T> support in structs

commit-id:31aa12d6

* bridge/governance.rs: Stop pestering about EMITTER_ADDRESS

commit-id:d5bd7234

* p2w-attest: price batching

This commit introduces support for multiple Pyth product/price pairs
per call. The initial maximum batch size is 5 and is enforced using a
`P2W_MAX_BATCH_SIZE` constant.

solana/pyth2wormhole/program:
* On-chain batching logic
* Batch message parsing logic

solana/pyth2wormhole/client:
* Off-chain batching logic - divides any number of symbols into
largest possible batches
* Use a multi-symbol config file instead of CLI arguments

third_party/pyth/p2w-sdk:
* Expose batch parsing logic

third_party/pyth/p2w-relay:
* Comment out target chain calls until ETH contract supports batching
* Test the batch parsing function

third_party/pyth/p2w_autoattest.py:
* Generate and use the symbol config file  with pyth2wormhole-client

third_party/pyth/pyth_publisher.py:
* Add a configurable number of mock Pyth symbols
* Adjust HTTP endpoint for multiple symbols

commit-id:73787a61

* p2w-attest: mention attestation size in batch

This commit ensures that no matter the attestation format, a batch
will never contain attestations of different sizes. This guarantee
enables forward compatibility by adding new constant-size fields at
the end of a batch at all times. An older implementation will simply
not consume the remaining newer values while respecting the stated
batch member alignment.

commit-id:210da230

* pyth2wormhole-client: use fresh blockhashes, harden batch errors

This commit makes sure we don't have to deal with expired transactions
due to stale blockhashes. The problem existed with larger symbol
configs as well as on Solana mainnet. Additionally, the attestation logic
now treats transaction errors as non-critical - a failure for a batch
does not prevent attestation attempts for batches farther in the queue

commit-id:5e704f8b
2022-02-23 19:12:16 +01:00
Leopold Schabel 44c1f9e6a9
solana: compile wasm and contracts with --locked (#874) 2022-02-18 12:48:10 +01:00
Leopold Schabel 870d15d483
*: bump pyth-client to 0.2.2 (#873)
The v2 branch on the Git origin disappeared. Use the crate instead.
Updated lockfiles using `cargo update -w`.

commit-id:d2655ef8
2022-02-18 00:01:13 -06:00
Evan Gray fce0708e11 feat: use sdk in js client 2022-02-14 07:56:38 -05:00
Kevin Peters e30f92b3e0 solana-program 1.9.4 wasm-bindgen workaround
wasm-bindgen 0.2.74 generates JavaScript bindings for SystemInstruction
exported from solana-program 1.9.4. The generated JavaScript references
a non-existent function (wasm.__wbg_systeminstruction_free) that
leads to an attempted import error when importing the wasm packed for
bundler. SystemInstruction isn't used in the sdk, so we remove the non-existent
function reference as a workaround.
2022-02-10 15:51:11 -05:00
Csongor Kiss dc2e6d8990
solana: add correct spl_token_metadata.so (#815)
Co-authored-by: Csongor Kiss <ckiss@jumptrading.com>
2022-02-03 19:10:16 +00:00
Hendrik Hofstadt 7edbbd3677 Update Solana to 1.9.4
Change-Id: I9c1ce5f25b21ca81599957a7faa730558d8fc03e
2022-02-02 11:31:33 -05:00
Reisen 3cd7ea173a solana: compile token metadata with 1.8.1 toolchain
Change-Id: Ifcfa984840a33326b3dbd59f23b6cf662651c2f8
2022-01-14 14:55:40 -05:00
Reisen e561d6de02 sdk: fixes to types and builds
Change-Id: I10b753450445cc021dbeb9f28ddb0384070e9635
2022-01-14 13:09:12 +00:00
Reisen 7f1c7ec62f solitaire: expose entrypoint and relax lifetimes
The current lifetimes 'a/'b restrict the &data and &program_id lifetimes which makes the
entrypoint unusable in solana_test_program's processor!() harness, which expects the more
relaxed (but equivelent for us) type of:

    fn processor<'a, 'b: 'a, 'c, 'd>(
      program_id: &'c Pubkey,
      accounts:   &'a [AccountInfo<'b>],
      data:       &'d [u8]
    )

It has no effect on our current programs.

Change-Id: Ia657462141165064c629fdff02b5ec451aab50f0
2022-01-14 13:09:12 +00:00
Reisen ee0fea0436 sdk: add underlying sdk for wormhole programs
Change-Id: I858f3e43e6458af51131de9165a63078e4bb024c
2022-01-14 13:09:12 +00:00
Reisen d21f08d2cb rust: rename wormhole libraries
Change-Id: I9bf5255c13b13d3724d7f8809489b04612b90747
2022-01-14 13:09:12 +00:00
Hendrik Hofstadt 32e9063910 Check whether vaa recipient matches the token account
Change-Id: Iab326cd735c764649dc031d813dbb8818d5e74f3
2022-01-13 14:07:40 +01:00
Stanisław Drozd 02a1dcecbc
solana: hide wasm-bindgen dependency behind the feature flag (#730)
commit-id:480d3b7a
2022-01-10 15:31:36 +01:00
Csongor Kiss 7e212fa739
terra/nft_bridge: Implement nft-bridge for terra (#698)
commit-id:0b547fa5
2022-01-07 16:47:33 +01:00
Chase Moran 2b00826847 update solana to 1.8.1 2021-12-29 21:07:55 -05:00
Leo b0ed42681d Use stable Buildkit syntax
We no longer need to be on an experimental branch - all the
Dockerfile features we need were released on 1.3.

commit-id:b083856a
2021-12-13 15:38:17 +01:00
Reisen 124efece2a solana/token_bridge: allow updating metadata
Change-Id: I34872eaa9e931d9698808cc658840a5885c3dc5f
2021-11-19 19:42:44 +00:00
Reisen d678cb4662 solana/token_bridge: prevent transfers to self chain
Change-Id: I0c97bf87e042c64a4b77cc359a1971912a247af8
2021-11-17 17:37:21 +00:00
Reisen 0d97a2e5a3 solana/token_bridge: prevent self attestations
Change-Id: Iac42e8dcc9f04c1035334ec021c7d4ab11857227
2021-11-17 16:20:20 +00:00
Hendrik Hofstadt 78547e23e6 Allow self registration on Solana
Change-Id: Ifc791036223e35af72a847f86ae1ddfd6b4d2173
2021-11-15 19:19:31 +01:00
Stan Drozd 05edb3d14f pyth2wormhole: rename p2w-client service to p2w-attest
Change-Id: I34a53146919c12ab41b958cc8cd57108ee509faa
2021-11-15 15:22:29 +00:00
Stan Drozd a8465ef791 pyth2wormhole: implement deserialization, print sequence
Change-Id: I39308ad6431df52f35a0496e71836497561640c5
2021-11-15 15:22:29 +00:00
Evan Gray c824a99636 sdk/js: attempt jest tests
Change-Id: I139153994604f0048f690b011048daec4d760a55
2021-11-05 19:53:00 +00:00