Commit Graph

212 Commits

Author SHA1 Message Date
bruce-riley a543c4045a
Deploy Monad Devnet (#4145)
* Deploy Monad Devnet

* Code review rework
2024-10-24 10:20:16 -05:00
bruce-riley abd0b330ef
Deploy Worldchain testnet (#4140)
* Deploy Worldchain testnet

* Update WETH address

* Fix cli test and add token bridge VAAs
2024-10-21 16:19:58 -05:00
Jason Matthyser e82db71837
Replace Guardian Key with abstracted Guardian Signer (#4120)
* node: add guardiansigner node/pkg

* node: replace use of guardian key with guardian signer

* node: replace use of vaa.AddSigner with guardian signer

* node: add nolint for armor import and fix test

* node: handle error returned from signing

* apply draft review suggestions

* apply pr reviews

* apply pr reviews

* apply pr reviews

* apply pr reviews

---------

Co-authored-by: pleasew8t <jason@asymmetric.re>
2024-10-17 16:21:45 +02:00
bruce-riley 44d6bf84fc
Deploy Unichain testnet (#4134)
* Deploy Unichain testnet

* Add snaxchain to proto
2024-10-10 11:01:08 -05:00
Bruce Riley a15f17d52a Node: Linea supports finalized 2024-09-06 09:47:26 -06:00
bruce-riley 92b54bb749
Node: DB not logging to Grafana (#4093)
* Node: DB not logging to Grafana

* Code review rework

* Remove unnecessary variable
2024-08-26 09:41:29 -05:00
Bruce Riley 092cbfcc62 Deploy Snaxchain mainnet 2024-08-16 13:44:23 -04:00
bruce-riley 9bd569d9db
Node: Observation batching with override (#4066)
* Node: Observation batching with override

* Add cutover time

* Code review rework
2024-08-13 11:49:33 -05:00
bruce-riley 7e205e1e3a
Node/P2P: Allow disabling subscribing to VAAs (#4019) 2024-08-05 13:21:22 -05:00
John Saigle 5042ff14d3
node: Flow cancel enhancements and bug fixes (#4016)
* node: Fix issue where transfers that were loaded from the DB did not add
a flow-cancel transfer on the TargetChain

Flow-canceling is done in the `ProcessMsgForTime` loop when a new
message occurs. However, this was not done when a node restarted and
reloaded transfers from the past 24 hours. As a result it was possible
for the node to calculate a result that showed that the outgoing
transfers for an emitter chain exceeded the daily limit. In effect this
is true but only with the condition that there was incoming flow to
allow this to happen. This appeared to violate an invariant and so the
node did not start properly.

node: Add unit tests when reloading flow cancel transactions from the
database

node: fix lint errors in governor_test.go

* node: Add a command-line flag to enable or disable flow-canceling on restart

Added a command-line flag to enable or disable flow-canceling when
starting the node. This should allow Guardians to disable flow canceling
in the case of future bugs or during a security incident. This should
prevent the need to rollback to earlier Guardian versions. (@mdulin2 )

* node: Use deterministic iteration order over chains when changing Governor state

- Adds a field that stores a sorted slice of chain IDs to the governor.
- Use this field to iterate in a determinstic order when performing
  actions that change the state of the Governor
- This should help Guardians reach a more similar view of the Governor
  in scenarios where iteration order might impact whether a transfer is
  queued. (This is relevant especially in the case of Flow Canceling)
- Cases where only a single VAA is being modified were not changed.
  Iteration order should not matter here and determinstic order may
  may worse for performance when searching for a particular element.

* node: Fix tokenEntry when checking flow cancel for pending transfers

(Squash and merge bug fix from PR #4001)
Similar to a previous issue in the function `ProcessMsgForTime`, the
tokenEntry was not being generated properly.
This should result in queued "small transfers" being able to flow cancel
when they are released from the queue.
Also adds a comment on the CheckedInt64 function to indicate what its
error states mean and when they occur.

Add comments and change variable names for governor_monitoring
- Add function comments to explain what they do and what their error
  states mean
- Adds governor logging to error cases
- Change variable names in publishStatus function. `value` was used
  first to indicate the "governor usage" and then reused to indicate the
  remaining available notional value for a chain. This refactor tries to
  make it clear that these are different concepts

Add unit test for flow cancelling when a pending transfer is
released

- Add a unit test to ensure that, when a pending transfer is released,
  it also does flow-cancelling on the TargetChain (previously we had a
  bug here)
- Add documentation for CheckPendingForTime to clarify that it has
  side-effects

* node: Modify error handling for CheckPending method in the Governor

Previous rollouts of the Flow Cancel feature contained issues when
calculating the Governor usage when usage was near the daily limit. This
caused an invariant to be violated. However, this was propagated to the
processor code and resulted in the processor restarting the entire
process. Instead, the Governor should simply fail-closed and report that
there is no remaining capacity, causing further VAAs to be queued until
the usage diminishes over time.
The circumstances leading to the invariant violations are not addressed
in this commit. Instead this commit reworks the way errors are handled
by the CheckPending, making careful choices about when the process
should or should not be killed.

- Change "invariant" error handling: instead of causing the process to
  die, log an error and skip further for a single chain while allowing
  processing for other chains to continue
- Remove 'invariant error' in TrimAndSumValueForChain as it can occur
  somewhat regularly with the addition of the flow cancel feature
- Return dailyLimit in error condition rather than 0 so that future
  transfers will be queued
- Do not cap the sum returned from TrimAndSumValueForChain: instead
  allow it to exceed the daily limit.
- Modify unit tests to reflect this
- Add unit tests for overflow/underflow scenarios in the TrimAndSumValue
  functions
- Change other less severe error cases to log warnings instead of
  returning errors.
- Generally prevent flow-cancel related issues from affecting normal
  Governor operations. Instead the flow cancel transfers should simply
  not be populated and thus result in "GovernorV1" behavior.
- Add documentation to CheckPendingForTime to explain the dangers of
  returning an error
- Reword error messages to be more precise and include more relevant
  fields. Add documentation explaining when the process should and
  should not die

* node: Add additional metrics for Governor status

Modify the monitoring code and protobuf files to make the status of the
Governor more legible when flow-canceling is enabled. This can be
consumed by Wormhole Dashboard to better reflect the effects of flow
cancelling.

On the level of the Governor:
- whether the Guardian has enabled flow cancel or not

On the level of the Governor's emitters, reports 24h metrics for:
- net value that has moved across the chain
- total outgoing amount
- total incoming flow cancel amount

Currently big transfers are not accounted for as they do not affect the
Governor's capacity. (They are always queued.)

* node: Add new flow cancel parameter to Governor in tests

* node: goimports formatting

* node: Bug fix in changes to governor monitoring

- Fix issue where stats weren't being populated unless flow cancel was
  enabled
- Fix wrong return value used in unit test
- Fix typo in proto variable name
- Move sorting outside of a for loop for efficiency
- Restore unit test that was deleted in the process of rebasing

* node: address prealloc lint error in governor code

* node: Fix "generated proto differs from committed proto"

* node: Fix bug in chainIds allocation

- This resolves a mistake with allocating the chainIds in the governor
initialization that causes nil entries in the slice.
- Add unit tests to ensure that the chainIds slice matches the chains
  map
- Add unit test to ensure that TrimAndSumValueForChain checks for a nil
  pointer to avoid panics

* node: Fix returning nil on err in governor_test.go

* node: Cleanup comments in governor code

* node: fix governor comment

* node: enable flow cancel in governor_monitoring tests

* node: Add flow cancel information to p2p heartbeat features

* node: Remove outdated comment from governor

* node: Upgrade logs to Error from Warn when reloading transfers from
database

* node: Enable flow cancel in check_query test function

* node: Cleanup comments and redundant code in governor

* node: Refactor how the flow cancel token list gets populated

- Only populate the flow cancel tokens list once
- Change default behavior to use an empty flow cancel assets list, rather
than first populating the list and then clearing it
- Refactor the logic around enabling the flow cancel token field for
  governed assets. Now it only executes if flow cancel is enabled,
  rather than operating over an empty slice when flow cancel is disabled
- Modify devnet/testnet configs so that they are responsible for
  returning the correct list of flow cancelling assets

* node: Add unit test for flow cancel feature flag

* node: Move new Governor status proto fields from Emitter to Chain

* node: lint governor_monitoring

---------

Co-authored-by: Maxwell Dulin <strikeout@maxwells-mbp.lan>
2024-07-30 10:27:05 -04:00
bruce-riley f3e6a9398e
Deploy Snaxchain to testnet (#4035)
* Deploy Snaxchain to testnet

* Code review rework
2024-07-25 13:19:26 -05:00
Paul Noel 29de12360e node: remove sui websocket from watcher 2024-07-19 08:23:56 -05:00
Evan Gray a9393500a1 node,sdk: Mantle mainnet 2024-05-31 09:13:52 -04:00
bruce-riley 1fe680dfb8
Deploy X Layer to mainnet (#3942) 2024-05-17 09:00:13 -05:00
Bruce Riley 15877b5413 Node/Devnet: Extract first guardian name from bootstrap peers 2024-05-06 16:31:06 -04:00
bruce-riley e2693f281f
node: Use the env variable for run mode checks (#3923) 2024-05-01 17:17:31 -04:00
bruce-riley 4d8cd997e1
Node: Default devnet evm chains (#3913)
* Node: Default devnet evm chains

* Node: Allow non-evm chains to be optional
2024-05-01 11:02:44 -05:00
bruce-riley 73cbcabcec
Deploy Scroll and Blast mainnet (#3909)
* Deploy Scroll and Blast mainnet

* Rework
2024-04-26 10:04:29 -05:00
Evan Gray e6dfb9115e node: shorten hostname for load testing 2024-04-25 16:11:57 -04:00
bruce-riley 034c570b33
Node/Acct: Add parameter checks (#3907) 2024-04-25 15:10:01 -05:00
bruce-riley 9af1fac9e1
Node/EVM: Linea poller (#3872)
* Node/EVM: Linea poller

* Explicitly check finality type in watcher
2024-04-22 10:11:45 -05:00
bruce-riley 005c649018
eth,node,sdk: XLayer, Linea and Berachain to testnet (#3871)
* Deploy XLayer and Linea to testnet

* Add Berachain support
2024-04-15 22:45:43 -04:00
Jeff Schroeder 683c5dfb59 node: a few minor spelling cleanups 2024-03-31 15:42:04 -04:00
Jeff Schroeder a4882e12be node: override the p2p advertised address
When behind a private network such as in the case of a guardian running
in Kubernetes, or behind a NAT, the default p2p setup doesn't work. It
looks at all addresses that it is listening on and advertises them on p2p
as the addresses for contacting the guardian. This patch is the first
step towards allowing specifying a custom ip address to be advertised on
the gossip p2p network.

For example, a guardian running inside kubernetes can post a reserved ip
address of the incoming ingress/load balancer that sends the traffic in
to their guardian.
2024-03-31 15:42:04 -04:00
bruce-riley 428920acb8
Deploy Blast testnet (#3859)
* Deploy Blast testnet

* Update contract addresses
2024-03-29 09:20:31 -05:00
bruce-riley d036e70740
Node/P2P: Add default bootstrap peers (#3852)
* Node/P2P: Add default bootstrap peers

* Rework

* Update ccqlistener
2024-03-22 14:27:03 -05:00
bruce-riley fa187bcf73
CCQ/Node/EVM: Backfill cache (#3558)
* CCQ/Node/EVM: Backfill cache

* Code review rework

* Make backfilling configurable

* Code review rework
2024-03-15 14:26:11 -05:00
bruce-riley b385f64ff7
Deploy Mantle to Sepolia (#3830) 2024-03-13 11:22:09 -05:00
bruce-riley a883b7f351
Deploy Polygon Sepolia Testnet (#3723)
* Deploy Polygon Sepolia Testnet

* Code review rework
2024-03-12 09:46:28 -05:00
bruce-riley 3a9dfd968b
NTT / Acct / Node: Guardian support (#3815)
* NTT/Acct/Node: Guardian changes

* Add per-emitter enforcement

* complete ntt accountant integration tests and run in parallel

* Minor tweaks

* Increase delay in tests

* fix accountant ci check

* Add CI AR address

* update prefixes

* increase timeout

* update ntt transfer wire format

* Code review rework from PR #3800

* Up tilt timeout

* Allow NTT accountant without base accountant

* Define known automatic relayer emitters

* Code review rework

---------

Co-authored-by: Evan Gray <battledingo@gmail.com>
2024-03-08 07:52:12 -06:00
bruce-riley a10aab1c6d
Node: Remove Neon support (#3732)
* Node: Remove Neon support

* Code review rework
2024-01-25 12:55:02 -06:00
Bing Yu 7acbacd0ea
node: Add config file support (#3710)
* node: Add logic to read file config and bind flags

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: add guardian node config to node.yaml

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: fix path typo

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: modularize initFileConfig

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: update ethRPC to the correct url

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: update config file path

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: add initial config file testing data

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: add test for flag precedence over config file

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: add test cases for flag, env var and config file precedence

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: use backticks as expected output

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: update comments

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: handle binding errors

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: create separate test functions

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: absolute filepath -> relative filepath

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* docs: Add guardian config file usage

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: update config file name and env var prefix

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

---------

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
2024-01-20 02:05:23 +08:00
Bing Yu 3d16cca785
node: Fix url verification bug where <ip>:<port> is not supported (#3719)
* node: update url verification logic to support ip:port format

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: add test case for ip:port

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: change neon rpc scheme from websocket to HTTP

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: update comment to be more accurate

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: remove neon from devmode

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: ignore internal xlabs testing file

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: add ws:// prefix to Sui

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: add ws:// and wss:// prefixes to Sui schemes

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: update testnet yaml naming

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

---------

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
2024-01-19 03:14:59 +08:00
Bruce Riley da3828354a Upgrade to libp2p v0.32.2 2024-01-17 10:08:14 -06:00
Bing Yu 81af52a2c7
node: Add URL scheme verification along flag registration (#3627)
* node: Add valid schemes for each RPC/WS

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: add function to validate rpc/ws url

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Add function to generate formats based on schemes input

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Add function to register and validate flag

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Change cobra flag register to register and verify

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: registerFlagWithValidation -> registerRPCFlagWithValidationOrFail

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Fix minor formatting error

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Format node.go

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Remove default parameter

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Fix accoutantWS accepted schemes

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Remove expectedSchemes to use validSchemes[rpcName] instead

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Fix typos

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: map -> inline param

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Add unit test for validateURL

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

---------

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
2024-01-10 00:19:15 +08:00
bruce-riley b7631bfbba
Deploy Holesky Testnet (#3630) 2024-01-08 16:42:10 -06:00
Bing Yu 8513e7dd22
node: sync dump-rpcs (#3632)
* node: Add suiWS to rpcMap

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Add missing RPC/WS to rpcMap

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

---------

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
2024-01-09 03:57:02 +08:00
Bing Yu cd579d0100
node: Add accepted formats and examples for rpc and ws parameter desc (#3622)
* node: Add accepted formats and examples for rpc and ws parameter description

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Add wss and https to the accepted formats to reduce confusion

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

* node: Add wss and https to the accepted format to reduce confusion

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>

---------

Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
2024-01-06 00:35:06 +08:00
bruce-riley 818038ef80
Deploy Sepolia based L2s (#3606)
* Deploy Sepolia based L2s

* Code review rework
2023-12-20 08:56:14 -06:00
bruce-riley a2cb2a1226
Deploy Mantle to testnet (#3438) 2023-12-11 10:26:56 -06:00
Paul Noel dee0d1532b node/pkg/telemetry: prometheus remote write 2023-12-06 10:01:37 -06:00
bruce-riley 62e7801cfa
Node/EVM: Remove obsolete polygon parameters (#3571) 2023-12-04 10:05:29 -06:00
bruce-riley e308b87062
Node: Add cosmos chains over IBC (#3562)
* Node: Add cosmos chains over IBC

* Avoid data race in watcher

* Add Osmosis as an IBC chain
2023-12-01 10:21:07 -06:00
bruce-riley 37691c1bad
Node/EVM: Polygon finality change (#3569) 2023-12-01 10:19:02 -06:00
bruce-riley 0a89e23589
Deploy scroll to testnet (#3429)
* Deploy scroll to testnet

* Don't allow scroll in mainnet

* Add scroll to ccq, use batch poller
2023-11-08 14:14:47 -06:00
bruce-riley 9be9a564b6
Node/EVM: Track latest block (#3470)
* Make finality an enum rather than a bool

* Significant code review rework

* Fix merge errors

* Code review rework
2023-11-02 11:59:40 -04:00
bruce-riley 3b17062869
NODE/IBC: Allow for a separate block height URL (#3480) 2023-11-01 09:45:54 -05:00
Jeff Schroeder 1960750fd0 node: remove gcp logging flags from guardiand 2023-10-27 21:28:53 -04:00
bruce-riley bd7262d819
Node/EVM: More nodes support finalized and safe (#3467)
* Node/EVM: More nodes support finalized and safe

* Remove unused finalizers
2023-10-26 14:26:15 -05:00
bruce-riley 669e2bc40e
CCQ/Node: Guardian Changes (#3423)
* CCQ/Node: Guardian Changes

* Code review rework
2023-10-12 13:20:42 -05:00