* deps: Remove Go-Spew and add new debugging function for VAAs
- Removes go-spew (https://github.com/davecgh/go-spew) as it has not
been updated in 7 years.
- Replaces the Go Spew functionality with a new function
DebugString() that can be used to get a spew-like output.
* Mezo mainnet deployment
- Provides .env.mezo.mainnet used for deploying WH Core and Token Bridge
contracts to Mezo Mainnet
* Add Mezo mainnet values to node and SDK
Adds support for Mezo on mainnet.
Core contract here
Token bridge contract here
To enable Mezo on mainnet, use the following config parameters:
```
--mezoRPC YOUR_MEZO_RPC
--mezoContract 0xaBf89de706B583424328B54dD05a8fC986750Da8
```
Verification
~~~
|- go run verify.go --chainId 50
Verifying prod mezo...
Verifying EVM chain ID for prod mezo ✓
Verifying finality values for prod mezo ✓
Verifying contract address for prod mezo ✓
Verifying test mezo...
Verifying EVM chain ID for test mezo ✓
Verifying finality values for test mezo ✓
Verifying contract address for test mezo ✓
~~~
* Update mainnet_tokens_test.go
SeiEVM -> Mezo in comment
---------
Co-authored-by: Adam <20446095+aadam-10@users.noreply.github.com>
* deps: Replace godo/fswatch with fsnotify/fsnotify
- The fswatch repository seems to be abandoned, whereas fsnotify is
actively supported and appears to be popular.
* Fix fsnotify usage
* fix typo in code comment: touch does NOT trigger
* Change level from Warn -> Info
* node: Add ability to limit Flow Cancel to pairs of chains
- Add a concept of "pipes" which consist of a pair of chains
- Add field in the Governer that enables flow cancel only for "pipes"
which are explicitly enabled
- Set the Eth-Sui pipe as the only flow cancel-enabled pair. Sui is the
only chain with frequent governor congestion so it is the only one
that really needs the Flow Cancel capabilities. Ethereum is the main
chain that Sui is interacting with in terms of volume moving in and
out of Sui.
- Refactor calling sites for flow cancel transfer functions so that all
checks are done in one place. (Should help prevent bugs where only one
calling site is updated.)
* node: Call pipe.valid() when adding a flow cancel transfer
* node: Add unit tests for Governor pipes. Modify pipe equality check
- Add unit tests to ensure that the flow cancel feature works iff valid
pipes are configured
- Adds unit tests for the pipe type (validity, equality between two
pipes)
- Modifies pipe.equals() to always return false for invalid pipes
* Fix linter errors
* Restore continue on error. Improve comments and error messages
* Fix lint
* Remove redundant validity check, add comment
* Add unit test for mainnet deployment of flow cancel pipes
* Remove continue statement when flow cancel returns error
* Improve unit test coverage for pipes
* lint
* re-order error checking; avoid early return if flow cancel fails
* Remove pipe configuration in devnet
* Change default allocation
* rename pipes to corridors
* cleanup after rebase
- The adminserver.go file was using an experimental version of the
slices package. This isn't necessary as the functions it uses are all
available in the stable package.
* txverifier: fix out of bounds panic for logs with no topics
- Adds handling for logs with no topics, fixing a panic in the code.
- Adds a unit test that passes a valid receipt with a log with no topics
to ensure the code does not panic
An in-the-wild example of this occurring is the transaction
0xa3692c2469b2ac9e7010aa07e550a26f3f35a959e8c20b23fb0abc03d81e54b4
* update comment
* Update node/pkg/txverifier/evm.go
* ci: update golangci-lint to 2.1.2
* fix importShadow violations
- Upgrading to golangci-lint 2.1.2 raised many new issues relating to
the importShadow rule from go-critic
* deps: Remove miguelmota/go-ethereum-hdwallet; delete unused code
- Remove the pkg/devnet/constants.go file which was largely unused. Most
of this code has also not been updated in a long time, and it refers
to both Ganache and Truffle where we now use Foundry for testing.
- Move the "Ganache" constant to the new devnet constants file under
SDK
- Delete the rest of the unused code
- Ran `go mod tidy` and committed the results, which removed one direct
dependency and a couple of indirect ones
* change format of new SDK constant
- Removes references to tendermint/random.
This package was being used to generate random Uint32 and Uint64 values
for sequence and nonce values. This dependency was added to the
admintemplate many years ago and there isn't a justification in
the commit for adding it instead of using std library functions.
- Adds new random functionality in the form of Uint32 and Uint64
functions.
These changes make it so that the only parts of the node that reference
Tendermint are the ones directly related to Cosmos code.
Note that both Tendermint and the CometBFT fork have either deleted or
deprecated this functionality anyway.
https://github.com/tendermint/tendermint/issues/2956https://github.com/cometbft/cometbft/blob/main/libs/rand/random.go
- Replaces the archived dependency's mock clock capabilities with an
interface defined in the files that use it. The implementation is
similar to how the library does it.
- Update go.mod via `go mod tidy`
- Minor refactoring of reobserve.go to change in-line durations to named
constants.
* ci: Bump golang linter version
* Fix initial set of lints
* Fixing more lints
* Fix more lints
* More linting updates
* More linting
* Almost there with the lints
* Last set of lints before rebase
* New lints with rebase
* PR feedback + fix test
* Update error string in algorand watcher
* Comments for watchers, revert adminserver change, remove unnecessary line in script
* Fix new lints from rebase
* Rebase fix
* Updating lints for Solana shim
* PR feedback
- Create a TxVerifier instance in the Run function of the EVM watcher
- Wrap all instances where a message would be published to the broadcasting msg channel with a new function, verifyAndPublish
- Messages are published with a new status: VerificationState.
- Modified the Transfer Verifier pkg API so that we can call the method with either an existing Receipt or a txHash.
- Added unit test in the watcher for new functionality
If Transfer Verifier is enabled:
- Messages that are token transfers will undergo Transfer Verification
- Message will be published with a status of Valid or Rejected depending on the result
- The calling code can then decide what to do based on this status
If Transfer Verifier is not enabled
- Existing behaviour will be preserved, but messages will be published with a status of NotVerified. No further actions are taken when a Message Publication has this status
Design Considerations
Modifying MessagePublication
This PR modifies MessagePublication to add a new status based on whether the Message Publication is verified. This decision was made to handle Transfer Verification cases across many chains. For example, the EVM logs are reliable enough that we can confidently rule a message as Valid or Rejected. Other ecosystems (i.e. Sui, but perhaps also Solana, etc.) are not so clear cut. In this case, we may want to mark a transaction as Anomalous rather than outright rejecting it.
Using this new enum allow us to do this.
Other potential benefits:
- Decouples the Verification of a Message from whether or not this can be published.
- Avoids scope-creep for the Watchers: they only watch messages, but do not need to reject them. (Instead this could be handled by the processor or some other security mechanism akin to the Governor or Accountant.)
- Allows configuring targeted action on a per-chain and per-status basis. For example, we may want to delay Anomalous messages but drop Rejected ones.
- Preserves a NotApplicable state that can be used as a fallback mechanism if the Transfer Verifier is disabled outright or on a particular chain
This status could be used in other cases beyond Transfer Verification, but should not interfere with existing message handling.
* Node: Buffer log messages
* Should shutdown the new go routine
* Go back to using a delay to get shutdown messages
* Redesign shutdown
* Tweak shutdown logic
* Remove wormhole_loki_write_failed metric
* Code review rework
Deletes the celo-blockchain package from go.mod. This is no longer
needed because recent updates to Celo resulted in the Guardian being
able to handle Celo connections using a general connector. The source
code that needed this dependency has already been deleted, so this
commit is just a cleanup.
To verify:
- Checkout main
- Run `go mod why -m $dep` on one of the deleted dependencies. It should
report that the dependency is not needed.
- RUn `go mod tidy` and it should give the same results as this PR.