* node: aptos watcher block height logging to debug
It would be nice to redo this log entry to log something more human
readable in addition to a json blob, but one thing at a time.
* node: near watcher info logging to debug
The near watcher logs when attempting to poll a block and when it
successfully polls a block in addition to some metrics. These are useful
logs, but more suited for debug loglevel.
* node: log cosmwasm watcher block height to debug
* node: log solana empty slots as debug
This cuts down on an enormous amount of additional logging.
* node: update logging in sui watcher
* Set some info logs to debug
* Fix tyop of missmatch --> mismatch
* node: guardiand support for accounting
Change-Id: I97fe1f6d6d71a5803881ff4c793e3c30f22b14d8
* Node: Tie accounting into the guardian
Change-Id: I31600d18176f516b75b3eb046fd7ac6e54e1b133
* Node: accounting tests and metrics
Change-Id: Ieb139772edf464ed1ab202861babeaf0f857ad6b
* Node: minor tweak to accounting metrics
Change-Id: Iad2b7e34870734f0c5e5d538c0ac86269a9a4728
* Node: load accounting key
Change-Id: I228ce23e63b556d751000b97097202eda48650aa
* More work in progress
Change-Id: I85088d26c05cf02d26043cf6ee8c67efd13f2ea4
* Node: send observations to accounting contract
Change-Id: Ib90909c2ee705d5e2a7e6cf3a6ec4ba7519e2eb1
* Node: Fix lint error in accounting tests
Change-Id: Id73397cf45107243a9f68ba82bed3ccf2b0299b5
* Node: Need to copy libwasmvm.so
Change-Id: I2856c8964ca082f1f4014d6db9fb1b2dc4e64409
* Node: Rename wormchain to wormconn
Change-Id: I6782be733ebdd92b908228d3984a906aa4c795f7
* Node: moving accounting check after governor
Change-Id: I064c77d30514715c6f8b6b5da50806a5e1adf657
* Node: Add accounting status to heartbeat
Change-Id: I0ae3e476386cfaccc5c877ee1351dbe41c0358c7
* Node: start of accounting integration work
Change-Id: I8ad206eb7fc07aa9e1a2ebc321f2c490ec36b51e
* Node: More broadcast tx stuff
Change-Id: Id2cc83df859310c013665eaa9c6ce3033bb1d9c5
* Node: Can actually send a request to accounting
Change-Id: I6af5d59c53939f58b2f13ae501914bef260592f2
* Node: More accounting tx broadcast stuff
Change-Id: If758e49f8928807e87053320e9330c7208aad490
* Node: config changes for accounting
Change-Id: I2803cceb188d04c557a52aa9aa8ba7296da8879f
* Node: More accounting changes
Change-Id: Id979af0ec6ab8484bc094072f3febf39355351ca
* Node/Acct: Use new observation request format
* Node/acct: use new contract interface
* Node/acct: fix minor copy/paste error
* Node: Clean up comments and lint errors
* Node: disable accounting in dev by default
* Node: Fix test failure
* Remove test code
* Switch messages to debug, rename Run()
* check for "out of gas"
* Use worker routine to submit observations
* Rename mutex to reflect what it protects
* Create handleEvents func
* Remove FinalizeObservation
* Node/Acct: Trying to use tm library for watcher
* Node/acct: switch watcher to use tm library
* Node/Acct: Need separate WS parm for accounting
* Node/Acct: Fix compile error in tests
* Node/Acct: Minor rework
* Node: add wormchain as a dep to remove stale code
* Node/Acct: GS index is not correct in requests
* Node/Acct: Peg connection error metric
* Node/Acct: Add wormchain to node docker file
* Node/Acct: Fix for double base64 decode
* Node/Acct: Change public key to sender address
* Node/Acct: Fix lint error
* Node/Acct: key pass phrase change
* Node/Acct: Pass guardian index in obs req
* Node/Acct: No go on submit observation
* Node/Acct: Don't double encode tx_hash
* Node/Acct: Remove unneeded base64 encoding
* Node/Acct: handle submit channel overflow
* Node/Acct: Added a TODO to document a review issue
* Node/Acct: Fix for checking if channel is full
Co-authored-by: Conor Patrick <conorpp94@gmail.com>
* 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
add unit tests
make the code more readable
make it more robust to various error conditions
report errors and performance metrics appropriately
Co-authored-by: tbjump jumpsiegel
* 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>
* Node: acala watcher use finalized blocks
* node: acala not in safe mode assume finalized mode
* Remove unused function
* Changes signature of checkForSafeMode()
* Beef up the safe mode check
* Remove unnecessary function
* node: remove the replace directive for solana-go
This commit that necessitated the fork:
25b9f3025b
Has been merged upstream:
9a01ac4f45
We need to pull in the latest solana-go to get support for MaxSupportedTransactionVersion.
* node: upgrade solana-go
This is the output from:
go get -u github.com/gagliardetto/solana-go
It is required for the MaxSupportedTransactionVersion from:
6ead48adf2
Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>
* 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
When the solana watcher is restarted (due to network errors, for
example) then the `lastSlot` state is lost. This means that any
transactions in between the last processed slot and the most recent slot
will be lost and require manual re-observation. Fix this by making the
`lastSlot` state persistent across watcher restarts.
* node: poller timeout
Change-Id: Ia324f1ac482fa9c5bea2b501970f0b22b16e67ce
* Add a comment explaining readiness change
* Add comment explaining why we are using a timeout
* Retry if polling fails
* 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
* 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>
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.
* node: reorganize watchers into own package
Change-Id: Idda82def1c8e1e07376bdc46a50fc02bd6f2386d
* node: rename terra to cosmwasm
Change-Id: Iebe5ccc7c66b772962425a42997bd2cfb66c6908
* Governor publish gossip
Change-Id: I2b8b1ea84a0c411101a7027acd3a27a6d6464d59
* Update the config publish time
Change-Id: Ic6abf84befb1c20756da2ff66b15a8325dc46067
* Not setting value on enqueued VAAs correctly
Change-Id: I9fd3a5d8fc574f8382125445fa688efdae45b88c
* Publish at most 20 VAAs, not 20 per chain
Change-Id: Ic9dff99c59ee89d57fd79158844a1fe1a0003112
* Switch to using signed messages
Change-Id: I66cddc7477cd477aa77bdadfc346b588f2ae645b
* Publish status only once per minute
Change-Id: I972fb0cf868e89c6f74ae4441471a55df389f4dd
* Minor comment change
Change-Id: I0d3e443cbec7edd282f89c1a5cce5d5ec8776d55
* Add command to purge pythnet VAAs
* Add test for purging a single emitter address
* Fix lint error
* Using the wrong delete primative
Change-Id: I80d5294c17279d4e49220d81807e5964a5591721
The per-watcher channels for reobservation requests don't have a
buffer, which means that if sending on any one channel blocks then _all_
reobservation requests get blocked. Make the send fallible and log if
it blocks instead.
We currently run the cleanup loop every 30 seconds, which means that
once 5 minutes have passed for an observation without quorum we will
send out re-observation requests to the p2p network every 30 seconds.
This is a bit excessive so limit sending these requests out to once
every 5 minutes.
When processing pending observations, the `handleCleanup` function
checks if we already have a stored quorum VAA and deletes the in-memory
observation if one is found. If a stored quorum VAA is not found, then
we're supposed to continue evaluating the other conditions and take
the appropriate action. This was implemented using a `fallthrough`
statement.
Unfortunately, this is not how `fallthrough` works. `fallthrough`
simply tells the compiler to execute the body of the next branch in
the switch block, *without evaluating the condition*. It also doesn't
evaluate the conditions for any of the other branches in the switch.
In practice what this meant is that for local observations that didn't
have quorum we would always take the first branch, fall through to the
second branch, and then exit the switch. Only once we had a quorum
(`s.submitted == true`) would we actually consider any of the other
branches in the switch. It also meant that there was no case where we
would take the branch for re-observing messages that hadn't reached
quorum.
Fix this by moving the stored quorum VAA check into an if statement and
then falling through to the switch statement if one is not found.
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).
Needed to build with newer go toolchains (up to 1.19). Many of the
libp2p subpackages have been merged as sub-directories of the main
libp2p package so update the imports to use the newer versions.
* Initial code
* Add test cases
* Get rid of excessive logging of price updates
* Add big tx size to available notional query
* Add tool to verify price query still works
* Fix lint error
* Rename check_query.go
* Set big transaction sizes
* More rework
* Add unit-test for big transfer config
* Fix unit tests after updates for Near
* Add a couple more test cases
Co-authored-by: claudijd <jclaudius@jumptrading.com>
* node/cmd/guardiand: pythnet for mainnet
Pythnet is a read only chain that will only use the core bridge to
transfer messages to other chains. No tokens will be transferred
to pythnet, so it has no token or nft bridge.
* node/cmd/guardiand: fix help for solana flags
Commit `1753bb3: Send re-observation request when re-broadcasting local
observations` changed the processor code to automatically send
re-observation requests. If multiple guardians do this around the same
time that would lead to multiple re-observation requests for the same
transaction.
Deduplicate re-observation requests by keeping a cache of the requests
that were received in the last 11 minutes. Any request that's already
in the cache will not be forwarded to the chain-specific observation
code. The 11 minute value was chosen because the guardians will send
these requests approximately every 5 minutes.
Also move the re-observation code into a standalone function so that it
can be more easily tested.
Configure the bootstrapping nodes that we will connect to to seed and refresh
the Routing Table if it becomes empty.
Fixes an issue where the spy stops receiving gossiped messages after the node
is restarted, because the Routing Table becomes empty and is never refreshed.
Currently if an observation hasn't reached quorum within 5 minutes, the
processor will re-broadcast the signed local observation to the other
guardians in the network. However if not enough guardians actually
observed the original tx, then no amount of re-broadcasting will help
the network reach quorum.
Fix this issue by sending a re-observation request whenever we
re-broadcast a signed local observation. This ensures that any
guardians that missed the tx the first time it happened have a chance to
re-observe it and help the network reach quorum.
Any goroutine can push into a channel so the current implementation has
a race condition where the channel can become full immediately after the
length check, causing the subsequent send on the channel to block.
Fix this by wrapping the send on the channel with a select block.
Control will fall through to the default case only if the actual send
operation blocks, avoiding the potential race with other goroutines.
* Non-critical tweaks for the next scheduled deploy
* Make tests fail if mainnet config is invalid
* Make the test pass
* Add test to verify testnet config
* Add support for included token list to script
* Initial include list and algorand token addresses
* Fix typo in algorand token
* Lowering min notional to zero
* 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.
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