8000 node: Integrate Transfer Verifier into the Ethereum watcher by johnsaigle · Pull Request #4233 · wormhole-foundation/wormhole · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

node: Integrate Transfer Verifier into the Ethereum watcher #4233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 41 commits into from
Mar 20, 2025

Conversation

johnsaigle
Copy link
Contributor
@johnsaigle johnsaigle commented Jan 22, 2025

New Features

  • 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.

Scope of this PR

The idea with this PR is to test the modifications to the Ethereum watcher without enabling the transfer verifier yet. We can release this in testnet or mainnet to be sure that the changes here are stable.

Once we're confident that the underlying mechanism is working well, we can add some logic in the Guardian to actually react when a MessagePublication has a status like Rejected or Anomalous. For now, changing the reaction of the watcher to a "bad" message is out of scope.

Questions

  • Is it necessary to update the Protobuf files somewhere in order to capture the changes to Message Publication?

Related Work

Copy link
Contributor
@banescusebi banescusebi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of suggestions

@johnsaigle johnsaigle force-pushed the tv-eth-watcher branch 3 times, most recently from 688ee88 to 96a2566 Compare February 27, 2025 20:36
@johnsaigle johnsaigle marked this pull request as ready for review February 28, 2025 15:58
Copy link
Collaborator
@djb15 djb15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integration looks good overall! Would be good to deal with the outstanding TODOs if possible

@johnsaigle johnsaigle marked this pull request as draft March 3, 2025 18:02
@johnsaigle johnsaigle marked this pull request as ready for review March 3, 2025 20:31
@johnsaigle johnsaigle requested review from pleasew8t and djb15 March 3, 2025 20:31
@johnsaigle johnsaigle marked this pull request as draft March 3, 2025 20:35
pleasew8t
pleasew8t previously approved these changes Mar 18, 2025
@johnsaigle johnsaigle requested review from bruce-riley and djb15 March 18, 2025 18:21
Copy link
Contributor
@bruce-riley bruce-riley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple minor comments and one more major one that I think we should be pegging prom metrics or something when verification fails. Otherwise how will anyone know it's happening?

@bruce-riley
Copy link
Contributor

Left a couple minor comments and one more major one that I think we should be pegging prom metrics or something when verification fails. Otherwise how will anyone know it's happening?

@johnsaigle and I talked offline and agreed that adding a metric could be handled in a follow-on PR.

bruce-riley
bruce-riley previously approved these changes Mar 19, 2025
djb15
djb15 previously approved these changes Mar 20, 2025
Copy link
Collaborator
@djb15 djb15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A3E2

Minor comment, looks good otherwise. I assume this is going to be tested in testnet/devnet first with some token transfers and performance evaluated?

@johnsaigle johnsaigle dismissed stale reviews from djb15 and bruce-riley via 057bd23 March 20, 2025 12:55
@johnsaigle
Copy link
Contributor Author

@djb15 Yeah I think we can spend some time testing and benchmarking before the feature actually gets enabled by the Guardians.

Copy link
Contributor
@evan-gray evan-gray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only reviewed devnet as that was the only change missing code owner approval.

@johnsaigle johnsaigle merged commit 983dd07 into wormhole-foundation:main Mar 20, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants
0