Commit Graph

49 Commits

Author SHA1 Message Date
Evan Gray dbc1bf6955 sdk/rust: shared accountant ModificationKind 2024-03-07 11:04:06 -05:00
Evan Gray cb3feb7987 sdk/rust: ntt accountant and relayer governance parsing 2024-03-07 11:04:06 -05:00
Ben Guidarelli 696cb909b7
Consts: Add Dymension to rust sdk consts (#3764) 2024-02-01 17:23:39 -05:00
Nikhil Suri 4ffd961be2
sdk/rust: add cosmos chain ids for ibc connections (#3727) 2024-01-31 10:34:49 -05:00
guibescos 55faa9ca1f
sdk/rust: use path dependency for `serde_wormhole` (#2992)
instead of an override. This makes it easier for downstream users to depend on this crate
2024-01-25 15:00:06 +00:00
bruce-riley a2cb2a1226
Deploy Mantle to testnet (#3438) 2023-12-11 10:26:56 -06:00
bruce-riley 0a89e23589
Deploy scroll to testnet (#3429)
* Deploy scroll to testnet

* Don't allow scroll in mainnet

* Add scroll to ccq, use batch poller
2023-11-08 14:14:47 -06:00
bruce-riley 1cabbe8a2d
sdk: Rootstock readonly (#3235) 2023-08-14 13:17:47 -04:00
Steve 821a6e8752
Add ibc-translator contract to the cosmwasm workspace and it's governance packet to the rust sdk. (#3174)
* Add ibc-translator contract and it's governance packet to the rust sdk.

* Remove unnecessary cargo script

* rustfmt and clippy fixes

* Address review comments

* Use WormholeQuery instead of contract to verify vaa, remove wormhole
core contract dependency, remove feature flag on anybuf.

* Add cw20 token metadata to tokenfactory metadata

* Change Simple/ContractControlled payloads to
GatewayTransfer/GatewayTransferWithPayload

* Change display and scaled denom to ensure x/bank conformance.
2023-08-10 07:08:22 -07:00
Nikhil Suri ee7d0765f9
sdk: add new governance VAA for IbcReceiverUpdateChainConnection (#2590)
* sdk: add new governance VAA for IbcReceiverUpdateChainConnection

* Enforce connectionId to be 64 bytes, add tests in rust sdk

* Update PrependBufferBytesFixed to LeftPadBytes, add template function + command for IBC governance VAA

* Add >64 length check for ibcReceiverUpdateChainConnectionConnectionId in runIbcReceiverUpdateChainConnectionTemplate command

* Update naming of governance VAA to reflect new mapping of channelId -> chainId

* Add TargetChainID to admin commands

* Node: Add IBC update channel to admin verify cmd

---------

Co-authored-by: Bruce Riley <briley@jumptrading.com>
2023-05-12 06:11:21 -04:00
Nikhil Suri 96682bdbeb
sdk: rust: add Sei, Btc, and Base chains and change Ropsten to Sepolia (#2851) 2023-05-10 08:28:54 -07:00
Nikhil Suri d7b6be7358
Cosmwasm package naming updates (#2641)
* sdk: update wormhole-core to wormhole-sdk and fix lib name to be wormhole_sdk

* cosmwasm: update wormhole and token bridge cosmwasm package/lib names

* Fix terra2 deployment script with new artifact names
2023-04-18 09:31:38 -07:00
Conor Patrick 26839604c8 accountant: export governance modules from sdk to double check in contract 2023-03-16 08:48:25 -05:00
Conor Patrick 6324a239f9 accountant: address comments from #2513 2023-03-16 08:48:25 -05:00
Conor Patrick 3a1bc456e3 accountant: separate modify_balance into separate module and check test errors 2023-03-16 08:48:25 -05:00
Conor Patrick bbec427145 accountant: minor cleanup 2023-02-16 18:03:47 -05:00
Conor Patrick b35480f966 accountant: address review comments for modify governance vaa 2023-02-15 06:23:25 -08:00
Conor Patrick a3a8e3ea87 accountant: use token bridge governance vaa to make modifications 2023-02-15 06:23:25 -08:00
A5 Pickle 58e6afd439 sdk/rust: fix clippy error 2023-01-26 18:36:03 -06:00
Chirantan Ekbote b2ca522e73 sdk/rust: Add test with hardcoded digest
Add a test for digest calculation that uses a hardcoded digest.  The
digest for this test was calculated using the `worm` CLI to ensure
interoperability.
2023-01-23 11:53:39 -05:00
Chirantan Ekbote d19fc98091 sdk/rust: Properly support tokenbridge payload3 messages
Add the payload as an explicit field to the `TransferWithPayload` enum
variant.  This is a generic parameter that defaults to `Box<RawMessage>`
for maximum flexibility (and to avoid leaking lifetimes higher up the
stack) but users are encouraged to replace this default type parameter
with an explicit `&RawMessage` in places where the serde_wormhole data
format is used.

The main benefit of this change is that the payload is now included as
part of the actual message and no longer requires callers to awkwardly
append it after serialization.  This is especially useful in human-
readable formats like JSON (see the `transfer_with_payload` test in
token.rs for an example of this simplification).

The main downside is that this now requires explicit type annotations
when using the non-payload3 variants so that the compiler will pick up
the default generic parameter.  This is a relatively minor inconvenience
and the benefit appears to be worth the cost.

There should be no functional change.
2023-01-20 18:12:41 +09:00
Chirantan Ekbote 421a030dca sdk/rust: Remove `*_with_payload` methods
The RawMessage type provides a more flexible way to handle trailing
payloads so replace all usage of the `*_with_payload` functions to use
`RawMessage` instead.

There should be no functional change.
2023-01-18 09:33:10 +09:00
Chirantan Ekbote 3c6702b6f7 sdk/rust: Add serde_wormhole::RawMessage
Add a RawMessage type that can be used to defer parsing parts of a
payload, similar to the `json.RawMessage` from Go.  The implementation
is inspired by `serde_json::RawValue`, which does a similar thing.

When serializing, RawMessage will serialize to a base64-encoded string
if it detects that the data format is human readable (like JSON).
Otherwise it will simply forward the raw bytes to the serializer.

RawMessage has both borrowed and boxed versions.  The borrowed version
is the most efficient as it enables zero-copy handling of the input data
but also requires that the input data already contains raw bytes and is
not suitable when dealing with human-readable formats like JSON.

The boxed version is more flexible as it supports byte slices, base64-
encoded strings, and byte sequences but is slightly less efficient as it
requires copying or decoding the input data.
2023-01-18 09:29:05 +09:00
Chirantan Ekbote e05176c9be sdk/rust: Remove `expiration_time` from `GuardianSetInfo`
This field doesn't actually appear in `GuardianSetUpgrade` governance
messages and was already being skipped by serde so just remove it
completely.  Contracts that need to keep track of this information can
encapsulate the `GuardianSetInfo` inside another struct that has an
`expiration_time` field.
2023-01-04 16:17:14 +09:00
Chirantan Ekbote 3a1dd9eccd sdk/rust: Simplify quorum calculation
Also add tests.
2023-01-04 16:17:14 +09:00
Chirantan Ekbote ab172b4da5 sdk/rust: Ensure chain conversions are isomorphic
Ensure that converting `Chain` to/from a u16 or to/from a string is
always isomorphic.  This requires changing the `FromStr` impl so that in
can handle strings like "Unknown(27)".
2023-01-04 16:17:14 +09:00
Chirantan Ekbote b400a2d51d sdk/rust: Add test for digest calculation
Add a test to ensure that calculating the digest from the structured
body, serialized data, or partial body + serialized payload all give the
same result.
2022-12-21 13:59:01 +09:00
Chirantan Ekbote 0dbeeec3d4 sdk/rust: Add `Body::with_payload`
Add the `Body::with_payload` method, which can be used to change the
type of the payload for a `Body`.  This is useful when parsing the
payload needs to be deferred until after the body is parsed.
2022-12-19 17:14:33 +09:00
Chirantan Ekbote 4ea369d7a9 sdk/rust: Implement Display for Address
This will be used later by the accounting contract.
2022-12-19 17:14:33 +09:00
Chirantan Ekbote 16b22a8cfc cosmwasm: wormhole-bindings: Use the Signature type from the SDK
Use the `Signature` type from the core SDK to avoid unnecessary
type conversions.  Cosmwasm requires its message types to implement
`JsonSchema` so also derive that impl for the `Signature` type behind a
feature flag.

This change uncovered a separate issue where the fake `WormholeKeeper`
was using regular ecdsa signatures rather than recoverable signatures
so fix the signing and verification methods to use the recoverable
signatures.
2022-12-15 12:22:37 +09:00
Chirantan Ekbote b3d68b0db6 sdk/rust: Drop references to `de::Unexpected`
The `de::Unexpected` enum from serde has a `Float(f64)` variant.
Referencing this enum anywhere in the code will cause the compiler to
emit its `fmt::Display` impl, which includes an `f64.load` instruction
on wasm targets.  Even if this instruction is never executed, its mere
existence will cause cosmos chains to reject any cosmwasm contract that
has it.

Fix this by removing all references to `de::Unexpected`.
2022-12-14 16:33:22 +09:00
Chirantan Ekbote d157c7bf67 sdk/rust: Add serde-based struct defintions
Refactor the core crate to add serde-based struct definitions for the
various messages used by the different wormhole smart contracts.  This
will also make it easier to use alternate data formats (like json) for
client-side tooling.

Co-authored-by: Reisen <reisen@morphism.org>
2022-12-14 16:33:22 +09:00
Chirantan Ekbote 92cb3d28a3 sdk/rust: Add serde_wormhole crate
The serde_wormhole crate implements the wormhole wire format as a serde
data format.  This will let us replace all the hand-rolled
serialization with auto-generated code, which is less error-prone and
easier to review.
2022-12-14 16:33:22 +09:00
Chirantan Ekbote 6e25b6c801 sdk/rust: Move profile settings to workspace 2022-12-14 16:33:22 +09:00
Chirantan Ekbote 676d729e3a sdk/rust: Fix clippy warnings 2022-10-28 14:35:44 -04:00
Chirantan Ekbote cb20d47835 sdk/rust: Fix formatting
Also disable unstable options in the rustfmt.toml
2022-10-28 14:35:44 -04:00
Chirantan Ekbote 12459c4a2a Add a wormhole go sdk
The wormhole sdk is a new go module in the sdk/ directory.  This
initially contains the *_consts.go files from the common package in the
top-level sdk package and the entire vaa package as a sub-package.

For go reasons this needs to be in the sdk directory itself (rather than
a sdk/go subdir).  To prevent the go tooling from looking into the other
non-go subdirs, add an empty go.mod file in each one.  See
golang issue 42965 for more details on why we can't have nice
things (I'm deliberately not linking to stop github from spamming that
issue).
2022-09-15 14:35:46 +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
Hendrik Hofstadt ee4583099f solana: token bridge transfer with payload 2022-05-11 21:24:36 -04:00
Chirantan Ekbote e907a05b1e sdk, terra: Fix tests and add them to CI
The terra tests had bit rotted quite terribly. It seems no one has run
them in almost a year because the API changed with the 0.14 release of
cosmwasm_vm in April, 2021.

Completely remove cosmwasm_vm from dev-dependencies.  The tests aren't
doing anything that requires interacting with the wasm code and can just
test the relevant functions directly.

Once this goes in the tests should be running in the CI so hopefully no
one will be able to push any more breaking changes.

commit-id:537d95e6
2022-04-20 09:46:51 +09:00
Hendrik Hofstadt c04d25e704 Fix solana integration tests & add test for account creation
Change-Id: I222744f194f952d03bfbd3ba4469bce59c310fc0
2022-04-11 21:29:39 -04:00
Serguei 8692080c2f
Terra SDK test chage to make it pass, devnet contract address corrected, build as library feature set. (#764) 2022-03-30 07:12:15 -05:00
Serguei 087506dec6
sdk/solana: post_message: added multiple seeds. (#838) 2022-03-03 12:23:56 -06:00
Hendrik Hofstadt 7edbbd3677 Update Solana to 1.9.4
Change-Id: I9c1ce5f25b21ca81599957a7faa730558d8fc03e
2022-02-02 11:31:33 -05:00
Reisen 03aae4a48a terra: fix messenger builds for sdk
Change-Id: Id30399c6a0521621c60f8382f13bd29714e6c116
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 982ce08c4a sdk: rustfmt rules for sdk
Change-Id: I43d4252facd6f0c817053e07a35bb74d874064bd
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 97566d878a sdk: add core types for wormhole projects
Change-Id: Iabaebb7b4319d5b759044896b2b396d39bda33d7
2022-01-14 13:09:12 +00:00