Commit Graph

892 Commits

Author SHA1 Message Date
Paul Noel 53997afc65 node: remove websockets from SUI watcher 2024-07-04 08:53:30 -05:00
John Saigle 7c6e4c597c
node: Fix issue where transfers that were loaded from the DB did not add a flow-cancel transfer on the TargetChain (#4002)
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.

Add unit tests when reloading flow cancel transactions from the
database
2024-07-03 15:15:35 -04:00
bruce-riley d146f82bca
Node: p2p.Run interface change (#3996)
* Node: p2p.Run interface change

* Guardian should be able to set disableHeartbeatVerify
2024-07-01 10:01:13 -05:00
djb15 fdbfc0b085 node: governor token list update 2024-07-01 09:13:06 -04:00
Nikhil Suri d100515609
node: Add emitters for Lido wstETH NTT deployment to NTT Accountant mainnet tracking (#3997) 2024-06-26 13:54:26 -04:00
John Saigle dc3a6cf804
node: Fix bug in flow cancel mechanism where the wrong values were being used for tokenEntry (#3990)
* node: add more unit tests for flow cancel

* node: Fix tokenEntry indexing issue in Governor flow cancel logic

- Indexes the tokenEntry for flow cancel tokens properly (using the
  token's origin chain and origin address
- Add many more tests to check flow cancel logic in more detail and at
  the resolution of the ProcessMsgForTime method.

Big thanks to Max for helping to debug the issue and the unit tests.

* node: add check to ensure the governor usage is not zero

* node: Change flow cancel test so that origin and emitter chain are different

* node: Add unit test for partial flow cancel

Add additional test for flow cancel mechanism where the numbers do not
cleanly cancel out.

* node: fix lint issues in governor test
2024-06-24 11:00:38 -04:00
Jason Matthyser 627faa7e69
node: governor custom reset release timer delay (#3983)
* Update ChainGovernorResetReleaseTimerRequest protobuf message

* Add numDays argument to governor-reset-release-timer command

* Update governor backend to support numDays argument

* Address review comments

* Add test for resetReleaseTimerForTime()'s numDays parameter

* Address review comments

* Add adminrpc test for ChainGovernorResetReleaseTimer

* Replace hardcoded upper boundaries with maxResetReleaseTimerDays

* Update governor whitepaper to reflect the new argument

* Added default value to governor whitepaper

---------

Co-authored-by: Jason Matthyser <jason@asymmetric.re>
2024-06-20 08:40:03 -04:00
John Saigle 305cb8f0fe
node: Update flow cancel tokens (#3986)
- Add canonical Solana and Ethereum stablecoins
- Remove Aave USDC
2024-06-18 10:40:14 -04:00
Dirk Brink 33b2fbe72a node: Token generator script flags tokens with changed symbols 2024-06-10 07:29:21 -07:00
bruce-riley 0e2ba6270c
Node: Minor tweaks and spy improvement (#3974)
* Node: Minor tweaks and spy improvement

* Add tests
2024-06-10 08:29:27 -05:00
Dirk Brink fdd2382ef8 node: Governor token list update 2024-06-07 13:11:10 -04:00
André Claro 40a630f388 node: update xlabs testnet guardian endpoints 2024-06-07 10:14:13 -04:00
bruce-riley 624df192ad
Node/CCQ: Allow anything in testnet (#3966) 2024-06-07 08:13:07 -05:00
Dirk Brink 215c60aee9 node: Allow tokens to change their symbol in generator script 2024-06-06 07:40:57 -07:00
bruce-riley ac7794b7aa
Node metric and performance tweaks (#3967)
* Node: Metric and performance tweaks

* Tweak observation metric

* pubsub StrictNoSign

* bigger observation metric buckets

* biggerer observation metric buckets

* Node: Add metric for libp2p drops

* Disable StrictNoSign for now

---------

Co-authored-by: Evan Gray <battledingo@gmail.com>
2024-06-06 09:04:28 -05:00
Paul Noel d5fd72bd4a node: terra stopped b64 encoding 2024-06-04 17:48:54 -04:00
John Saigle 34ee3de349
Implementation of 'Flow Cancel' modifications to Governor calculations (#3798)
Flow Cancel
A 'flow cancel' transfer occurs when all of the following are true:
    An emitter chain is governed by the Governor
    A transfer has a TargetChain equal to the emitter
    A transfer's Timestamp is within the usual 24 hour window used by the Governor
    The asset in the transfer has fields OriginChain and OriginAddress equal to an entry in the allow list
Example scenario
    A particular USDC implementation minted on Ethereum. It is allow-listed.
    A transfer of $1,000 of this asset is sent from Solana to Sui.
    Before the transfer, Sui's usage is $10,000.
    Before the transfer, Solana's usage is $0.
After the transfer is processed, Sui's new usage will be $9,000 (flow cancel) and Solana's new usage will be $1,000 (as usual).
2024-06-04 11:49:13 -04:00
Hteev Oli d1c8f53a66 node: clean up duplicate imports 2024-06-04 05:52:11 -04:00
Evan Gray a9393500a1 node,sdk: Mantle mainnet 2024-05-31 09:13:52 -04:00
John Saigle d420251f0b
node: add governor support for Mantle (#3958)
* node: add manual token list for Mantle

* node: add additional mantle tokens

* node: remove incorrect manual token for mantle

* node: Fix mantle token links

Source all token addresses from https://explorer.mantle.xyz/,
cross-referenced with CoinGecko's results for top Mantle tokens by daily
volume
2024-05-30 14:29:14 -04:00
Evan Gray cb34e194f5 proto: sync chains with sdk/vaa/structs.go 2024-05-28 16:43:24 -04:00
bruce-riley 1fe680dfb8
Deploy X Layer to mainnet (#3942) 2024-05-17 09:00:13 -05:00
John Saigle 6a9a706298
Node: add xlayer tokens to manual token list (#3926)
* node: add x layer tokens to manual_tokens.go

- Coin Gecko IDs left blank here because there is no entry for these
  tokens yet
- Prices are taken from the chain explorer directly

* node: Update X Layer manual token list

- Fix Chain ID
- Add more tokens with >50k daily volume
- Add CG IDs for tokens that have them
- Add commented out tokens that have high volume but no CH entries
- Update prices (use CG price where available)

* node: remove tokens without CoinGecko IDs
2024-05-08 08:38:55 -04:00
Yahya Hassanzadeh, Ph.D 00604948e8
moves sent counter to happypath (#3928) 2024-05-07 08:11:47 -05:00
Bruce Riley 15877b5413 Node/Devnet: Extract first guardian name from bootstrap peers 2024-05-06 16:31:06 -04:00
bruce-riley 87c754a101
Node/Devnet: Add missing deterministic guardian keys (#3929) 2024-05-06 11:31:19 -05:00
bruce-riley b93a54a547
Node/CCQ: Add gossipAdvertiseAddress option to proxy server (#3924) 2024-05-02 15:14:14 -05:00
bruce-riley e2693f281f
node: Use the env variable for run mode checks (#3923) 2024-05-01 17:17:31 -04:00
djb15 f86ebc6826 node: governor token list update 2024-05-01 16:42:41 -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 a4aad23507
Node: Add adminserver command to generate template for accountant modify balance (#3905)
* Node / Adminserver: Command to modify gacct balance

* Code review rework

* More rework
2024-04-30 10:42:11 -04:00
Bruce Riley bf5ceb5fba Add admin command tests 2024-04-29 12:30:41 -04:00
Bruce Riley e4931fe75e Code review rework 2024-04-29 12:30:41 -04:00
Bruce Riley c5b52f9426 Node: Adminserver commands should not panic 2024-04-29 12:30:41 -04:00
bruce-riley 73cbcabcec
Deploy Scroll and Blast mainnet (#3909)
* Deploy Scroll and Blast mainnet

* Rework
2024-04-26 10:04:29 -05:00
Dirk Brink d63f2ca532 node: Manual initial token list for Blast and Scroll 2024-04-26 09:48:21 -04: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
Csongor Kiss 9620fca895
node: generalised governance (#3895)
* node/admin: add generalised EVM call governance handler

Handles governance requests of the form:

```
current_set_index: 4
messages: {
  sequence: 4513077582118919631
  nonce: 2809988562
  evm_call: {
    chain_id: 3
    governance_contract: "0xD8E4C2DbDd2e2bd8F1336EA691dBFF6952B1a6eB"
    target_contract: "0xF890982f9310df57d00f659cf4fd87e65adEd8d7"
    abi_encoded_call: "6497f75a000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000f890982f9310df57d00f659cf4fd87e65aded8d70000000000000000000000000000000000000000000000000000000000000140bebebebebebebebebebebebebebebebebebebebebebebebebebebebebebebebe000000000000000000000000000000000000000000000000000000000000000268690000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004beefface00000000000000000000000000000000000000000000000000000000"
  }
}
```

* node/admin: add admin template for evm governance call

* node/admin: add generalised Solana call governance handler

handles governance requests of the form

```
current_set_index: 4
messages: {
  sequence: 4513077582118919631
  nonce: 2809988562
  solana_call: {
    chain_id: 3
    governance_contract: "3u8hJUVTA4jH1wYAyUur7FFZVQ8H635K3tSHHF4ssjQ5"
    encoded_instruction: "BEEFFACE"
  }
}
```

* node/admin: check address lengths and fix typo in governance handler

* node/admin: better error handling and fix comments

* sdk/vaa: add constants for general purpose governance actions
2024-04-23 11:28:02 -04:00
Jeff Schroeder 14d73dafe0 node: run go mod tidy
Necessary when updating the go ledger dependencies.
2024-04-22 16:31:18 -04: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
Jeff Schroeder 2712dd3f3f
node: upgrade to go 1.21.9 (#3855)
* node: update quic-go

Ran via:

    go get github.com/quic-go/quic-go@v0.42.0

* node: update mongo-drive dependency

Ran via:

    go get go.mongodb.org/mongo-driver@latest

* node: upgrade libp2p-go

Ran via:

    go get github.com/libp2p/go-libp2p@v0.33.1

Refs: #3863

* node: fallout from the go upgrade in the go.sum

Run via:

    go mod tidy

This updates the go.sum and removes unnecessary indirect references.

* docs: use go1.21.8

* github: use go1.21.8

Except for wormchain.

* node: update dockerfiles to use go 1.21.8

This was done with scripts/update-go-version.sh

* scripts: update linter dockerfile to use go 1.21.8

This was done with scripts/update-go-version.sh

* wormchain: update ibc-relayer to use go 1.21.8

This was done with scripts/update-go-version.sh

* scripts: add update-go-version.sh

This is a little helper to make updating the version of go a bit nicer.

* scripts: update-go-version.sh fixes

* set the default docker command to "dokcer"
* update the comment for the humongous sed command for dockerfiles

* github: fix go linting

* Upgrade golangci-lint to a version built with go 1.21.x. The older
  version was a binary version built with go 1.20.x and it was failing
  against the newer code built with go 1.21.x
* print the golangci-lint version in each run to see what version of go
  it was built with in case there are incompatibilties during the next
  upgrade
* remove the linter config skipping over pkg/supervisor entirely and
  instead put in an override to ignore the `unused` linter for the
  pkg/supervisor testhelpers bits for unsed test functions necessary
  to satisfy the test interface.

* scripts: update golang linter cli invocation

* github: use the latest version of golangci-lint

Because 1.52.2 is built with go 1.20.x which has issues with this project
now that it is upgraded to 1.21.8.

* node: remove implicit memory aliasing in a loop

Caught by an upgraded golangci-lint with the gosec linter:

    ::medium file=node/pkg/watchers/evm/connectors/batch_poller.go,line=226,col=8::G601: Implicit memory aliasing in for loop. (gosec)
    ::medium file=node/pkg/watchers/evm/connectors/batch_poller.go,line=285,col=8::G601: Implicit memory aliasing in for loop. (gosec)
    ::medium file=node/pkg/watchers/evm/connectors/batch_poller_test.go,line=128,col=37::G601: Implicit memory aliasing in for loop. (gosec)

See also: https://husni.dev/beware-of-implicit-memory-aliasing-in-go-foor-loop/

* node: update logging

* Update go to 1.21.9

Automated via:

    scripts/update-go-version.sh 1.21.9

* node: update test root context teardown time

Otherwise things get really sad.

* scripts: additions to update-go-versions.sh

* Standardized on prefacing functions with `function` for consistency
* Added a few more comments to explain how things work
* Automatically increment the go version and toolchain in go.mod
* Standardized on prefacing functions with `function` for consistency
* Make the go image debian version a variable for ease of maintenance

* node: update go.mod to specify 1.21.9

* node: update node tests

Review feedback from @pires

* scripts: run go mod tidy in update-go-version.sh

Required after running go mod edit or it refuses to build.

* node: update go.mod

Running `go mod tidy` removes the toolchain so the build works.

* node: update node tests

---------

Co-authored-by: Ryan Hamphrey <hamphreyryan26@gmail.com>
2024-04-19 14:43:36 -04:00
bruce-riley 04a13542d1
Node: Logging cleanup (#3888)
* Node: Logging cleanup

* Code review rework

---------

Co-authored-by: Bruce Riley <bruce@wormhole.labs.xyz>
2024-04-19 13:22:56 -05:00
Nikhil Suri 8ed75c9bfe
node: add emitters to ntt allowlist (#3884)
* node: add emitters to ntt allowlist

* node: tests: update TestNttVerifyMainnetEmitters
2024-04-16 17:40:43 -04:00
Jeff Schroeder 44a8453ee6
deployments: add RockawayX as a new Guardian (#3880)
* deployments: update for guardian set index v4

Wormholescan returns vaas base64 encoded, but guardianSetVAAs.csv
has them in hex format. This is the correct command to download a
guardian set upgrade vaa and convert it to hex in one go:

    curl -sq 0000000000000000000000000000000004/18252082506122526004 | \
        jq .vaaBytes -r | \
        base64 -d | \
        xxd -p | \
        tr -d '\n'
    echo

Refs: wormhole-foundation/wormhole-networks#53

* node: update admin template gsti to 4

Refs: wormhole-foundation/wormhole-networks#53
2024-04-16 13:02:37 -04:00
bruce-riley 85afd5d1f9
node,sdk: add support for Provenance over IBC (#3879) 2024-04-16 12:21:21 -04:00
djb15 40c51b29dd node: governor token list update 2024-04-16 09:52:23 -04: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
Nikhil Suri b18a7e61eb node: Fix NTT V1 testnet emitters 2024-04-12 18:30:14 -04:00
Nikhil Suri d4821808a0
node: update ntt_config.go (#3875) 2024-04-12 15:14:20 -04:00