Commit Graph

2666 Commits

Author SHA1 Message Date
Nikhil Suri eff4eb2ebd wormchain: add accounting contract bindings 2022-12-16 08:51:41 -05:00
Nikhil Suri ee2b6d0c17 cosmwasm: wormhole: remove unecessary cast to usize 2022-12-15 14:51:54 -05:00
Kevin Peters d094e3104a Updated CODEOWNERS file 2022-12-15 14:51:06 -05:00
Chirantan Ekbote fba2f48dee cosmwasm: accounting: Fix chain registration query return type
The tokenbridge chain registration query returns a
`ChainRegistrationResponse` struct and not a `Vec<u8>`.  Use the proper
return type when sending the query.
2022-12-15 10:01:08 -05:00
Chirantan Ekbote ac9c8cd743 cosmwasm: Add backfill method for accounting
Add a mechanism to backfill missing transfer messages by submitting
signed VAAs.  This will also be used to initialize the on-chain state
as there is too much data to initialize the contract via the normal
`instantiate` mechanism.

Fixes #1883, fixes #1884.
2022-12-15 12:22:37 +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 88549b6849 cosmwasm: accounting: Add ValidateTransfer query
Add a query to validate transfers.  This can be useful for guardians to
sanity check a transfer before submitting a signed observation for it.
2022-12-15 12:21:35 +09:00
Chirantan Ekbote 7cd3e14e99 cosmwasm: accounting: Rename CommitTransferError -> TransferError
This error will also be returned by the `validate_transfer` query so
rename it.
2022-12-15 12:21:35 +09:00
Kevin Peters 5ce3290ba3 sdk/js: 0.9.6 version bump 2022-12-14 13:16:23 -05:00
Chirantan Ekbote 25abafc753
cosmwasm: Add wormchain-accounting contract (#1920)
* sdk/rust: Move profile settings to workspace

* 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.

* 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>

* 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`.

* cosmwasm: Use cargo resolver version "2"

Enable the new feature resolver for the entire workspace.  This
prevents features that are enabled only for dev builds from also being
enabled in normal builds.

* Move cosmwasm Dockerfile to root directory

The cosmwasm contracts now also depend on the rust sdk so the docker
build context needs to be set to the root directory rather than the
cosmwasm/ directory.

* cosmwasm: Add wormchain-accounting contract

This contract implements tokenbridge accounting specifically for the
wormchain environment.

Fixes #1880.

* cosmwasm/accounting: 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 contracts that
contain it.

Fix this by removing references to `de::Unexpected`.

Co-authored-by: Reisen <reisen@morphism.org>
2022-12-14 12:06:45 -05:00
A5 Pickle 39f5877756 testing: fix tests 2022-12-14 11:00:20 -06:00
A5 Pickle b71181a404 sdk/js: fix account and instruction serialization 2022-12-14 11:00:20 -06:00
A5 Pickle 1616df817e sdk/js: fix token bridge cpi accounts 2022-12-14 11:00:20 -06:00
Bojan Angjelkoski 612ae1a7e5 sdk/js: injective package bump 2022-12-14 11:40:49 -05:00
Josh Siegel c8da62e383 aptos_update: Fix aptos errors 2022-12-14 01:57:17 -06:00
Josh Siegel 38b1d1c350 aptos_update: update aptos 2022-12-14 01:57:17 -06: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
Kevin Peters 6bc0ef893d Updated CODEOWNERS file 2022-12-13 11:29:57 -05:00
aki 2d84fdf20a clients: double aptos faucet default airdrop amount
this should fix the insufficient fee error we're seeing in PRs like #1990
2022-12-13 08:21:49 -08:00
aki a408a5b8ff clients: replace references to sdk consts
this will require another pass in the future, once we cut a new release of the sdk with the deployer address consts
2022-12-13 08:21:49 -08:00
aki fd37e46b7b add ability to pass amount to worm aptos faucet 2022-12-13 08:21:49 -08:00
kev1n-peters fd1ed1564e
evm: Added Core and NFT Bridge EVM chain ID migrations (#2067) 2022-12-12 20:37:30 -06:00
justinschuldt 70a6d82731 add links referencing sections 2022-12-12 18:29:17 -05:00
justinschuldt d98727584c add number-of-messages constraint info 2022-12-12 18:29:17 -05:00
A5 Pickle c8e8c4aaea testing: fix token bridge cpi tests 2022-12-12 17:09:05 -05:00
A5 Pickle 26069907b2 sdk/js: fix payload ID 2022-12-12 17:09:05 -05:00
Nikhil Suri 05f318050e tilt: ignore wormchain gentx folder to make deployment robust 2022-12-12 16:59:26 -05:00
Csongor Kiss 5abdb1c4dd aptos: build dependencies from 'mainnet' branch
Instead of 'main', as it introduced breaking changes recently
2022-12-12 14:26:22 -06:00
jumpsiegel 82651e4c55
Node fix register chain vaa format error (#2100)
* Node: Fix register chain VAA format error

Change-Id: If60ae2e072da025029b8a817272d8175585baa7d

* sdk_tests: adding sdk vaa tests

* sdk/vaa: share governance serialization

Co-authored-by: Bruce Riley <briley@jumptrading.com>
Co-authored-by: Evan Gray <battledingo@gmail.com>
2022-12-12 13:58:38 -06:00
kev1n-peters f39acdbe1c
node: Terra Classic Governor Limits Change (#2090)
See discussion: https://github.com/wormhole-foundation/wormhole/discussions/2087
2022-12-08 11:46:09 -06:00
kev1n-peters c94ad13c8c
node: Injective mainnet support (#2084) 2022-12-07 13:43:44 -06:00
Csongor Kiss 523a30140f ethereum: token verification instructions
commit-id:7c346ae8
2022-12-07 12:32:04 -05:00
Csongor Kiss 4fcd5ffcca CI: build flattened evm contracts when tag is pushed 2022-12-07 12:32:04 -05:00
Csongor Kiss 41868dec51 ethereum: Add make target to flatten contracts
Running `make flattened` will produce flattened contracts into the
`flattened` directory
2022-12-07 12:32:04 -05:00
Csongor Kiss af2385c9c6 ethereum: npm install truffle-flattener --save-dev
This flattener produces flattened solidity files that can be verified on
etherscan (and other evm block explorers)
2022-12-07 12:32:04 -05:00
Csongor Kiss 1b862eaff7 ethereum: npm uninstall @poanet/solidity-flattener
This flattener does not seem to work, and is not being used for anything
2022-12-07 12:32:04 -05:00
Nikhil Suri 235fb59d05
wormchain: move governance consts to sdk (#2086) 2022-12-07 09:20:11 -08:00
kev1n-peters d7198a74d7
sdk/js: Added injective mainnet addresses (#2085) 2022-12-06 22:53:19 -05:00
Nikhil Suri 0e7c085d71
node: inject wormchain cosmwasm governance messages (#2057)
* 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
2022-12-06 11:10:32 -08:00
Jeff Schroeder 8ed35ddac1
docker: update node build to not copy executables (#2075)
Refs: #2073

Since the stuff under /bin might not have the right libraries to run,
don't copy it. This is not a general purpose operating system image
and is meant to be minimal.
2022-12-06 11:35:16 -05:00
kev1n-peters 54194b1f64
cosmwasm: Added injective mainnet verify script (#2078) 2022-12-06 16:03:44 +01:00
bruce-riley b38dfc015f
sdk/go: Add unmarshal for vaa.Address (#2076)
* sdk/go: Add unmarshal for vaa.Address

Change-Id: I1beb99f82673d1fc3225a8c6628a0019648d7e01

* sdk/go: review rework

Change-Id: I7c9179e674c019f46eebff13a071f997f20572f3
2022-12-06 07:18:16 -06:00
jumpsiegel 759550715a
near/fix-stats: Fix network stats for near (#2077)
* near/fix-stats: Fix network stats for near
2022-12-05 07:24:44 -06:00
Evan Gray e31f701b61 codeowners: add another fallback node reviewer 2022-12-02 17:35:02 -05:00
kev1n-peters b7aae9d5dd
clients/js: evm info identifies unsupported features (#2065) 2022-12-02 11:36:10 -06:00
Bruce Riley 16e8bb347e Node: Polygon checkpoint logging
Change-Id: I31305812cc784845aa98497ada24b2a2041cad71
2022-12-02 10:18:06 -05:00
Josh Siegel 3e0cabc70f algo/fix: go mod tidy 2022-12-02 09:51:51 -05:00