The wrapped assets on terra have been migrated to code id 767, but the
config wasn't updated to store this new code id, so newly created
wrapped assets all use an older code id. This patch upgrades all wrapped
assets to 767 and changes the config so future wrapped assets also use
that code id.
Also added a new function `migrate_wrapped_assets` so this task can be
done in the future in a less error-prone way.
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.
* Add the default backend for the relayer
Start to slowly split things out.
* Configure the backends when configuring the env
* First stab at the pluggable listener backend
* Update relayer example (and test) config
* relayer: JIT backend
* relayer: walletMonitor remove useless function
* relayer: update worker init() funcs
It is silly to accept a boolean in thing.init() vs just not running init
if you don't want to run thing.
* relayer: remove env property from Listener
It is verified in init() in spy_listener.ts and rest_listen.ts, so it can
be deferred to not require the import.
* relayer: clean up the main bits
Only try to init() something when it is actually supposed to run
per the cli flags.
* spy_relayer: more descriptive var name in main
* spy_relayer: Update relay worker with more docs
* spy_relayer: add targetChainName to WorkerInfo
This makes it easier to pretty print the chain name in the logs without
having to look the name up.
* spy_relayer: update logs and use the backend
* Use the Relayer interface's process() method in place of processVaa()
* Update the logs to include the chain name in the worker and auditor threads
* spy_relayer: remove processRequest()
It has been moved to the process() method of the default Relayer backend.
* spy_relayer: start fleshing out the Relayer default
* spy_relayer: fix a logic bug in checkQueue()
Co-authored-by: @swimricky
* spy_relayer: update TokenBridgeRelayer.process()
* Remove some extra logic
* Actually use the ChainId type since the id of 0 is in the sdk now
* spy_signature: add Relayer.runAuditor()
The auditor code is payload specific and needs to be with the backend.
* spy_relayer: move Relayer.runAuditor()
Make it part of the backend since the backend has all of the payload
specific logic into it.
* spy_relayer: move relay() --> Relayer.relay()
The actual relaying is part of the backend, so make it so.
* spy_relayer: add Relayer.runAuditor()
* spy_relayer: no more deprecated hexToNativeString
* spy_relayer: implement Relayer.targetChainId()
This is used for finding workable items in the incoming queue to toss
into the working queue.
* spy_relayer: remove relay.ts
The relay() function was moved to Relayer.relay()
* spy_relayer: more uses of deprecated hexToNativeString()
* spy_relayer: remove unused import
* spy_relayer: review feedback from @bruce-riley
* Fix some spelling tyops
* Simplify some logging
* Simplify a conditional for the payload version check
* spy_relayer: misc fixes and code clean up
* Fixed integration tests
* Added launch.json file for debugging in VS Code
* Updated to latest wormhole SDK
* Backup queue uses same key as redis
* Added Terra Classic flag
* Throttle potential infinite loop in audit thread
* Fixed spy service connection leak
Co-authored-by: Evan Gray <battledingo@gmail.com>
Co-authored-by: Kevin Peters <kpeters@jumptrading.com>
`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.
Prior to this change, these values were hardcode in the contract, as
the only supported chain was terra 2. This change allows the contract to
be deployed to other cosmwasm chains without having to recompile the
contract for each one.
The migration code ensures that terra2 is upgraded appropriately.
Use daily token prices to compute TVL instead of the prices fetched
at token transfer time, if available.
Added inactive tokenlist to exclude tokens that have essentially been
deactivated by CoinGecko (market data no longer available).
* Rebase
* Reload from db on start up
Change-Id: I1deac9db28ad1157ea7e0c84af41c35b38497f4e
* Console commands
Change-Id: Ic242038312b7c837443a2df8823f100b3cdffd77
* Query prices from CoinGecko
Change-Id: I9a8c282ba374d32ef7045d11979a27ede3c52827
* Move chain config to separate file
Change-Id: I6a790eca765bce1f2caf48134e225df5c4daff15
* More code cleanup
Change-Id: Id12affa78cdc2d394d6dab0c53bb7ad06df8007e
* Few minor tweaks
Change-Id: I6cb511599d669e0b3d716d9f314ac0f26935ee92
* Create separate tests for different packages
Change-Id: Idb4da6817c9daad2a7420abc11bdaa702ae056dc
* Fix lint errors
Change-Id: I137c9e7e4574aee9c9fec22e91e19eee0e86a349
* Simplify chainlock message tests
* Add more governor db test coverage
* Next batch of review rework
Change-Id: Ife54852fca6c6990d1ffb3d60a8dd7f49d526f0a
* Still more rework
Change-Id: I43a8aa7fa4e1a7cea4d7fde68c963123c1ca8d53
* More rework
Change-Id: I9382412af4ffeda74967a834a6b0195a9d28b720
* Fix lint errors
Change-Id: Idaafce9b0314192557b7207911375d000bac5ae2
* Add rest and prometheus support
Change-Id: Ib870ed7eb305ef1ebbf6a7cedabc665c37c19171
* Add separate configs for testnet and devnet
Change-Id: I76b11d8940a8dc9935b3f276a008ed20ef60b850
* Update mainnet tokens to fix decimals
Change-Id: Iab018827766bc7748038b7be2f51342afb79b87c
* Let small enqueued VAAs go out when big ones can't
Change-Id: I7d3ef88d4579702d0c6ff4eaf5a8524799610ff6
* Tweak testnet config parameters
Change-Id: Id2c54151a7183ab3fb4af8060929198f6021ba4e
* Rework / enhancements from testnet testing
Change-Id: I1387b1d22667fa6ffe0bb1832dbc0b31196505d3
* Use known emitter maps
Change-Id: If330ee9d30ac3c2d1c6dca674f7777dc759de230
* Fix typo and out of date comments
Change-Id: I54a19792104ccc6ca023020303a710ef3ba18f74
Co-authored-by: claudijd <jclaudius@jumptrading.com>
We need to reuse almost all of the gossip infrastructure for accounting
transactions, with the only difference being that accounting will use a
`Transfer` message rather than a `VAA`.
Make the observation stored in the processor state generic so that it
can be either a VAA or a Transfer. The rest of the code is shared.
Solitaire parses accounts using two traits, FromAccounts and Peel. The
FromAccounts derive macro generates a function, `FromAccounts::from()`,
which calls `Peel::peel` to construct each field in the struct:
```
let example = Example {
foo: Peel::peel(next_account_iter(accs)?),
bar: Peel::peel(next_account_iter(accs)?),
baz: Peel::peel(next_account_iter(accs)?),
...,
}
```
The FromAccounts derivation also attempts to implement Peel for the
structure itself however, which means `Example` itself is embeddable as
a field in another accounts struct. This is only used in ClaimableVAA
which is a large source of confusion and the complexity is not worth
maintaining.
This commit removes the recursion by:
1) Removing the `impl Peel` derived by FromAccounts.
2) Removes the AccountInfo iterator from Context as it is no longer needed.
3) Adds the current parsed account to Context instead, safe thanks to (2)
4) Move message out of ClaimableVAA and pass in to verify everywhere instead.
5) Removes Peel/FromAccounts from ClaimableVAA.
Create separate variables for the known tokenbridge and nft bridge
emitters and dynamically build KnownEmitters from those lists. Having
separate variables for the tokenbridge and nft emitters will make it
easier to look them up without having to iterate over the whole emitter
list every time.
Also add a devnet_consts file to list the known emitters in the
development network.
* node/pkg/terra: remove setEvents
The guardian set should only be authoritative from ethereum, so having
this code in the terra watcher is unnecessary. Getting this information
on injective requires a few more hoops to jump through but it is never
used. It is easier to maintain less code, so remove it.
* node/cmd/guardiand: remove setEvents from cosmwasm
This removes the set events from:
* terra 2
* injective
* terra classic
* node/pkg/terra: don't query guardianset from cosmwasm
* node/pkg/terra: support injective
* node/pkg/terra: update queryLatency metric
To show the query latency of fetching the latest block height from rpc
* solana/devnet_setup.sh: Build CLI instead of JITing it
This makes the registration process a few seconds faster.
* solana/Dockerfile: Don't copy devnet_setup.sh at the beginning
This is unnecessary, and inefficient, because each time the file
changes, a lot of things get rebuilt/reinstalled.
* solana/Dockerfile: cache cargo registry
this allows skipping rebuilding cargo dependencies. Small contract
changes now rebuild in 20s, down from 60s before
* Remove unnecessary debian depencies
* Rename rust-toolchain.toml to rust-toolchain (rustup in the container
didn't recognise it with .toml extension) and use in containers
instead of manually specifying rust version
* solana/Dockerfile: Use prebuilt docker image
* solana: Add docs on docker base images