Commit Graph

2599 Commits

Author SHA1 Message Date
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
Chirantan Ekbote e2c2ec9749 wormchain: tokenbridge: "Wormhole" -> "Portal" 2022-10-03 17:34:42 +09:00
Chirantan Ekbote 124307140d wormchain: tokenbridge: Don't change registered decimals
Don't allow an AssetMeta payload to change the decimals of a registered
asset as this would cause issues with any unredeemed token transfers.
2022-10-03 17:34:42 +09:00
Chirantan Ekbote d1b6512954 wormchain: tokenbridge: Normalize coins before processing
This lets users use non-base denominations when transferring coins.
2022-10-03 17:34:42 +09:00
Chirantan Ekbote 5e7752c74b wormchain: tokenbridge: Send/Burn coins after truncation
Sending or burning coins before truncating the amount would lead to the
user losing the truncated coins.  Only send or burn the coins after
truncation.
2022-10-03 17:34:42 +09:00
Chirantan Ekbote c53813ce37 wormchain: tokenbridge: Clean up coin handling
Use `sdk.Coin` methods as much as possible rather than mixing with
big.Int and uint256.Int.
2022-10-03 17:34:42 +09:00
Chirantan Ekbote ce40d17c74 wormchain: tokenbridge: Use sdk.Coin for transfer fees
Since the transfer amount already uses `sdk.Coin`, use it for fees as
well.  This ensures the fees cannot be negative.

Also add some extra validation for `MsgTransfer` fields and add tests
for the validation checks.
2022-10-03 17:34:42 +09:00
Chirantan Ekbote 524520c914 wormchain: wormhole: Fix broken test 2022-10-03 17:34:42 +09:00
Chirantan Ekbote b655e5b19b wormchain: Delete unused errors 2022-10-03 17:34:42 +09:00
Chirantan Ekbote 7fc2f06402 wormchain: client: Delete unused variable 2022-10-03 17:34:42 +09:00
Chirantan Ekbote b5ab6a8833 wormchain: wormhole: Remove nullify call in test
This was overwriting the generated keys and addresses.
2022-10-03 17:34:42 +09:00
Chirantan Ekbote 8f70fd1719 wormchain: tokenbridge: Don't register asset meta for unknown chains 2022-10-03 17:34:42 +09:00
Chirantan Ekbote 832a72057d wormchain: tokenbridge: Don't allow self-registration
Don't allow registering an emitter for wormhole chain on wormhole chain.
2022-10-03 17:34:42 +09:00
Chirantan Ekbote 5666ee51b5 wormchain: wormhole: Don't allow changes to the consensus guardian set
This would allow a jailed guardian to simply register a new validator
address and bypass the jail.
2022-10-03 17:34:42 +09:00
Chirantan Ekbote 727a3e869d wormchain: wormhole: Check for multiple validator registration.
Don't allow a tx signer to register more than one guardian validator.
2022-10-03 17:34:42 +09:00
Chirantan Ekbote 2fcfb7f769 wormchain: wormhole: Check for duplicate guardian addresses
When updating the guardian set via a governance action, make sure that
there are no duplicate addresses in the set.
2022-10-03 17:34:42 +09:00
Chirantan Ekbote b38180bf5d wormchain: tokenbridge: Check that the target chain is registered
Ensure that the destination chain has been registered in the tokenbridge
before allowing transfers to it.  This prevents users from accidentally
locking up their tokens in the token bridge by passing in an invalid
chain id.
2022-10-03 17:34:42 +09:00
Chirantan Ekbote d272eee7bc wormchain: tokenbridge: Burn wrapped coins
Previously we would just collect all the coins in the module account,
which isn't necessary for wrapped coins that we minted.  Burn them
instead.
2022-10-03 17:34:42 +09:00
Chirantan Ekbote 3e6b92a1f6 wormchain: tokenbridge: Reject transfers with negative fee 2022-10-03 17:34:42 +09:00
Chirantan Ekbote 317c0cf7c9 wormchain: wormhole: Simplify return in UpdateGuardianSet 2022-10-03 17:34:42 +09:00
Chirantan Ekbote 96c0db86ce wormchain: wormhole: Fix inconsistent comment 2022-10-03 17:34:42 +09:00
Chirantan Ekbote 991c41b46e wormchain: wormhole: Use existing helper functions
Replace a couple of blocks with existing helper functions that do the
same thing.
2022-10-03 17:34:42 +09:00
Chirantan Ekbote a0c25dead2 wormchain: tokenbridge: Check for base denom in GetWrappedCoinMeta
The base denom for wrapped tokens is prefixed with "b".  Check for this
in GetWrappedCoinMeta so that we don't end up treating base denom tokens
as native tokens.
2022-10-03 17:34:42 +09:00
Chirantan Ekbote a66b3ac28c wormchain: tokenbridge: Parse chain id as an unsigned integer
A chain id cannot be negative so parse it using `strconv.ParseUint` to
avoid issues with negative values.
2022-10-03 17:34:42 +09:00
Csongor Kiss 62edb5b5b1 wormchain: Audit items (#11)
* changed minimum governance vaa length check

* remove double write of chain ID in token attest

* removed panics from vaa processing in token bridge

* added non-negative check to fee in transfer tokens

* simplify non-negative check

* make fee sign check nicer in msg_server_execute_vaa

Operationally identical

* 14->13 in proofOfAuthority.md

Co-authored-by: chase-45 <chasemoran45@gmail.com>
Co-authored-by: Csongor Kiss <ckiss@jumptrading.com>
2022-10-03 17:34:42 +09:00
Developer Experience team at Tendermint 879be5bbc6 Add wormhole chain
This is a squashed commit of all the changes in the wormhole_chain
directory from the development branch with the following changes:

 * Replace the vendored cosmos-sdk directory with a replace directive in
   the go.mod file pointing to the wormhole-foundation/cosmos-sdk repo.
 * Update the cosmos-sdk version to v0.45.7.
 * Rename starport -> ignite
 * Update to ignite version 0.23.0
 * Update go version in dockerfile to 1.19.0
 * Upgrade github.com/cosmos/ibc-go v1.2.0 => v1.2.2
 * Upgrade github.com/tendermint/spm v0.1.5 => v0.1.9
 * Add missing module names to the
   SetOrder{BeginBlockers,EndBlockers,InitGenesis} functions.
 * Fix the gentx memo in the genesis.json file.
2022-10-03 17:34:42 +09:00
Paul Noel 0f7ddda602
Optimism testnet deploy (#1661)
* 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
2022-09-30 17:38:08 -04: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
bruce-riley 0dbd0b6628
node: governor listen to quorum gossip (#1487)
* governor listen to quorum gossip

* governor listen to quorum gossip

* Fix build error in tests

* See p2p from other guardians in devnet

* Fix test broke during merge

* Change delete function being used

* Don't reload duplicates on startup
2022-09-30 12:28:26 -05:00
bruce-riley 7fcbabe720
node: eth publish immediately (#1664)
* 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>
2022-09-30 11:03:01 -05:00
Csongor Kiss b5a8ba2361 ethereum: Add scripts to verify/upgrade all contracts 2022-09-30 09:11:52 -04:00
Evan Gray 860f91b2b8 clients/js: fix terra fee 2022-09-30 09:08:33 -04:00
Evan Gray 6a8ac2304f node: don't require algorandIndexerToken 2022-09-30 09:07:53 -04:00
Chirantan Ekbote 2914e48780 Dockerfile.node: Don't install wasmvm
Now that we don't depend on the cosmos-sdk packages we don't need this
anymore.
2022-09-30 16:12:30 +09:00
Chirantan Ekbote afda43a2a0 node: Run `go mod tidy`
Commit "02cf08531 node: move watchers to dedicated package (#1647)"
removed a lot of packages from the node dependency list.  Run `go mod
tidy` to clean up the go.mod and go.sum files.
2022-09-30 16:12:30 +09:00
Bruce Riley aebbbdcb9a Code review rework 2022-09-29 22:38:27 -04:00
Bruce Riley d45a1e95cb Implement finalizer 2022-09-29 22:38:27 -04:00
Bruce Riley 0b6cc9ab44 Basic guardian support 2022-09-29 22:38:27 -04:00
Bruce Riley 87d146a261 Deploy contracts to testnet 2022-09-29 22:38:27 -04:00
Evan Gray 3177cf7eb5 node: fix dockerfile 2022-09-29 17:36:09 -04:00
kev1n-peters 9352784c89
sdk/js: 0.7.0 version bump (#1451) 2022-09-28 23:27:18 +02:00
Josh Siegel 77763d94dd algo/cleanup: cleanup 2022-09-28 13:42:09 -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
Hendrik Hofstadt 02cf08531e
node: move watchers to dedicated package (#1647)
* node: reorganize watchers into own package

Change-Id: Idda82def1c8e1e07376bdc46a50fc02bd6f2386d

* node: rename terra to cosmwasm

Change-Id: Iebe5ccc7c66b772962425a42997bd2cfb66c6908
2022-09-28 15:27:13 +02:00
Hendrik Hofstadt ddd4f26f20
Refactor ethwatcher (#1618)
* reduce code duplication in ethereum watcher

Change-Id: I1d78e9cb86cb126e42959ef5805c0ee1b83e23a6

* reorganize finalizers

Change-Id: I64c61ebd8a03d4ba9f27ce82fbc4cae8b35f19d2

* rename ethereum to evm

Change-Id: I6d1e56df65c74edb3643b3506adcff8588e0a87b

* reorganize connectors

Change-Id: I21b31fb00f34dd6501e957b8f528723d5f548a52

* restructure into modular connectors

Change-Id: I111403a29464acfccad18b261658f59176a8795d
2022-09-28 13:15:57 +02:00
ckeun 69962f96f5
cloud_functions: near support (#1614)
* cloud_functions: near support

* cloud_functions: moonbeam support

* cloud_functions: fix lint issue

* Added algorand & near wormhole addresses for their tokens

* Added near tokens to tokenAddressExceptions

* Use wormhole go sdk

Co-authored-by: Kevin Peters <kpeters@jumptrading.com>
2022-09-27 16:38:43 -05:00
Csongor Kiss 37ee5cf4a4 terra: Add fromAddress to payload 3 2022-09-27 12:19:25 -04:00
Csongor Kiss d0900c791a terra/token-bridge: fix lunc tax deduction 2022-09-27 11:54:47 -04:00
bruce-riley ddd8b78160
node: don't store pythnet VAAs in the database (#1643)
* Don't store pythnet VAAs in the database

Change-Id: Ief4357ab4c909d25dc9182490c322ef253ac23d3

* Clean up logging

Change-Id: I46efea96d6c2ba65459254ffeb21f5d65abebb01

* Rework this to require less custom code

Change-Id: Ib7f521ecff62b1bd13efcb627f88413f4141de59

* Fix copy paste error

Change-Id: I067f8364042f494ad56ed88919cd917f18423073

* Fix typo

Change-Id: I22ccb56ac330bd557b6e8438cfe9c02d7593361d
2022-09-27 08:14:52 -05:00
Paul Noel e2575550e8 cosmwasm/tools: fix tilt 2022-09-27 07:58:28 -05:00