* 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
* Sei testnet support
* Set contract addresses
* node/pkg/watchers: add RunWithScissors
* SDK tweaks
* node: revert "node/pkg/watchers: add RunWithScissors" (#2620)
This reverts commit 9b8bed4dbf.
* Make Sei use IBC watcher
---------
Co-authored-by: Paul Noel <panoel007@gmail.com>
Co-authored-by: Paul Noel <35237584+panoel@users.noreply.github.com>
* Node: Support VAAs with large payloads
Change-Id: Ie09bdc8ea0813ee90f9b686f3fe95365baa4014f
* Clean up tests
Change-Id: I983a40a2e7763271c8212ac18455b8b45e48fd3e
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.
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.
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.
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.
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.
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)".
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.
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.
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.
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`.
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>
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.
* node: inject wormchain cosmwasm governance messages
* Use nested hash for defense in depth
* Use keccak.Reset() instead of creating new hash objects
* fix msg_server_wasmd_test
* Updated based on jynnantonix comments
* Check return value of binary.Write
* Include actual error in binary.Write panic case
* sdk/js: Added repairVaa & test
* fixed unnecessary comments
* Separated rpc call from base repairVaa function. removed console logs and added throws
* removed unncessary else statement
* removed unnecessary async
* Skipping rpc call test for current guardian set
* Clean up minor formatting
* Optimism mainnet deploy
* node: added OP token to manual_tokens
* Add to readiness
* File should not have been committed
* Remove readiness since it goes with watcher
* Allow optimism watcher in mainnet
* Add to devnet config
Co-authored-by: Christine Eun <ceun@jumptrading.com>
* go sdk - BatchVAA structs
* make VAA body unmarshaling DRY
* implement binary encoding interfaces for VAAs
* validate observation length before unmarshaling
* move shared VerifySignatures logic to new function
* make SigningMsg a delegate call
* normalize ID of vaa types
* add BatchVAA version to signingBody
* add Attestation interface with shared VAA methods
* add data integrity checks to batchVAA unmarshal
* sdk/js: aptos
* sdk/aptos: change api interface to be more flexible
sdk/aptos: add attestToken
sdk/aptos: added createdWrapped
sdk/aptos: add getForeignAsset
sdk/aptos: stricter sanity check for fully qualified type
sdk/aptos: ensure addresses are left padded
sdk/aptos: check if asset exists in getForeignAsset
sdk/aptos: stricter sanity check - hex prefix can't be capital
sdk/aptos: add updatewrapped
sdk/aptos: update readme with token attestation example
sdk/aptos: added transfer
sdk/aptos: add getIsTransferCompleted
sdk/aptos: add isWrappedAsset and getOriginalAsset
sdk/aptos: add redeem
sdk/aptos: make init tokenbridge entry func
* sdk/aptos: separated signing/submitting txs from creating raw txs
* clients/js: hash aptos fully qualified type to get address
* sdk/aptos: return payload from api instead of rawtx
* sdk/aptos: derive token info from vaa
* sdk/aptos: fix getAssetFullyQualifiedType for native asset
* sdk/aptos: add min gas price
* sdk/aptos: bump aptos version
* sdk/aptos: dont require 0x in front of addresses
* sdk/aptos: progress on e2e tests
* sdk/aptos: upgrade resource address derivation
This was changed recently
25696fd266/aptos-move/framework/aptos-framework/sources/account.move (L90-L95)
* sdk/js: fix getForeignAssetAptos
* sdk/js: update testnet aptos address
* sdk/js: update aptos entry functions
* sdk/aptos: fix parsesequencefromlog
* sdk/aptos: throw errors instead of string literal
* sdk/aptos: update testnet/mainnet addresses
* sdk/aptos: fix completeTransfer and getOriginalAsset
* sdk/aptos: update transferTokens to take in type and remove wormholeFee param
* sdk/aptos: add typeToExternalAddress utility
* sdk/js: update parseSequenceFromLogAptos
* sdk/js: test version bump again
* sdk/aptos: make transfer param type consistent
* sdk/aptos: test transfer to another chain test done
* sdk/aptos: use completeTransferAndRegister
* sdk/aptos: allow tryNativeToHexString to take in account addresses
* sdk/aptos: finish e2e tests
* sdk/aptos: test all apis
* sdk/aptos: add registerCoin utility
* sdk/js: utility to submit script bytecode to chain
* sdk/aptos: update test to be idempotent
* sdk/aptos: stricter check on aptos type
* clients/js: remove unused imports from rebase
* sdk/aptos: change node and faucet urls in ci
Co-authored-by: aki <akshath@live.com>
Co-authored-by: Evan Gray <battledingo@gmail.com>
* Prepare to deploy Xpla to mainnet
* Update SDK version
* Fix messed up error message
* Allow tests to pass with no XPLA tokens
* Make deploy script support testnet
* Update token bridge addresses after redeploy
* ethereum: add optimism testnet
* sdk/js: add optimism testnet
* ethereum: put back network id
* Revert "ethereum: put back network id"
This reverts commit 71f68c50d2.
* ethereum: put back network id
* ethereum: file cleanup
* node: eth publish immediately
Change-Id: I242f02d0ed5bcced5ed366a512c07d5757b300e8
* testing: immediate publish test
* Move magic number to the sdk
Change-Id: I806f73d4442af4736aa6e5fc1c8e48e434c4a6d4
Co-authored-by: Evan Gray <battledingo@gmail.com>
* 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>
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).
This does not require a transaction simulation, and should serve as the
basis for future cosmwasm sdk functions in the `getIsTransferCompleted*`
family.
Before this check, users were able to lose funds by sending money to an
address that's shorter than 32 bytes.
This commit is essentially a backport of the fix from the new cosmwasm contract.
`canonicalAddress` and `humanAddress` are useful functions for all
cosmos chains so move it into a new cosmos package. This also means we
need to stop hardcoding "terra" in `humanAddress` and take the human
readable part as a parameter instead.
* 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>