Skip to content
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

Node: Change TxHash to TxID in MessagePublication #4219

Conversation

bruce-riley
Copy link
Contributor

@bruce-riley bruce-riley commented Jan 14, 2025

This PR updates the MessagePublication object used to publish message observations internal to the guardian.

The TxHash field (a go-ethereum Hash) is being replaced by the TxID field (a byte array) so that we can use something other than the 32 byte go-ethereum Hash as our transaction identifier. For instance, on Solana we want to use the 64 byte signature in some cases.

The tx_hash in the protobuf is already a byte array, so we don't need to mess with that (other than testing to verify nothing, such as Wormholescan, breaks if it is more than 32 bytes long.

This change also requires updating the governor and accountant DB code to migrate from the old format to the new one.

Testing:

  • Node tests pass
  • CI passes
  • Ran load test and verified other guardians and the fly heartbeat monitor see observations and VAAs
  • Ran load test while forcing the EVM TxID to be more than 32 characters. Verfied fly monitor saw correct value
  • Verified the accountant and NTT accountant contracts properly handle TxHash of more than 32 bytes
  • Used go tests to verify migration of database entries for governor and accountant
  • Verified that the accountant can handle a full batch all of 64 byte TxHash values
  • Verified that a SignedObservationBatch full of 64 byte TxHash values does not exceed the default p2p limit
  • Verified with @M-Picco that these changes should not break Wormholescan

@bruce-riley bruce-riley force-pushed the node_change_TxHash_to_TxID_in__MessagePublication branch 3 times, most recently from 935cb69 to a3c9247 Compare January 14, 2025 23:51
@bruce-riley bruce-riley marked this pull request as ready for review January 15, 2025 14:04
@bruce-riley bruce-riley force-pushed the node_change_TxHash_to_TxID_in__MessagePublication branch 3 times, most recently from 0451dd5 to 3feb5a8 Compare January 16, 2025 16:47
@bruce-riley bruce-riley force-pushed the node_change_TxHash_to_TxID_in__MessagePublication branch from 3feb5a8 to 864d70a Compare January 17, 2025 14:01
evan-gray
evan-gray previously approved these changes Jan 17, 2025
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.

agree with proposing the minimally invasive change in the watchers, though it did make me cringe a little to convert from bytes to hash back to bytes 😬

node/pkg/processor/message.go Show resolved Hide resolved
node/pkg/processor/observation.go Outdated Show resolved Hide resolved
node/pkg/db/governor.go Outdated Show resolved Hide resolved
panoel
panoel previously approved these changes Jan 17, 2025
@bruce-riley bruce-riley force-pushed the node_change_TxHash_to_TxID_in__MessagePublication branch from e8c083d to 8c30686 Compare January 17, 2025 17:28
panoel
panoel previously approved these changes Jan 17, 2025
evan-gray
evan-gray previously approved these changes Jan 17, 2025
@johnsaigle johnsaigle self-assigned this Jan 17, 2025
node/pkg/common/chainlock.go Outdated Show resolved Hide resolved
Copy link
Contributor

@johnsaigle johnsaigle left a comment

Choose a reason for hiding this comment

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

Suggested some changes, mostly along the lines of encapsulating the new functionality in a custom type.

node/pkg/accountant/accountant_test.go Outdated Show resolved Hide resolved
node/pkg/common/chainlock.go Show resolved Hide resolved
node/pkg/common/chainlock.go Show resolved Hide resolved
node/pkg/common/chainlock.go Show resolved Hide resolved
node/pkg/common/chainlock.go Outdated Show resolved Hide resolved
node/pkg/common/chainlock.go Outdated Show resolved Hide resolved
@bruce-riley bruce-riley dismissed stale reviews from evan-gray and panoel via 916e370 January 21, 2025 15:44
@bruce-riley bruce-riley force-pushed the node_change_TxHash_to_TxID_in__MessagePublication branch from b4b9029 to 46fde63 Compare January 21, 2025 16:56
@johnsaigle johnsaigle removed their assignment Jan 21, 2025
@bruce-riley bruce-riley merged commit 1ed88d1 into wormhole-foundation:main Jan 22, 2025
28 checks passed
@bruce-riley bruce-riley deleted the node_change_TxHash_to_TxID_in__MessagePublication branch January 22, 2025 15:43
kakucodes added a commit that referenced this pull request Feb 3, 2025
wormchain: pulled in the pre-release cw_wormhole ict/integration test

added shutdown tests

lint cleanup

shutdown utils cleanup

Deploy SeiEVM testnet (#4209)

* cli: arbitrary chain registration

* Deploy SeiEVM Testnet

---------

Co-authored-by: Evan Gray <battledingo@gmail.com>

Node: Update Celo watcher (#4210)

* Node: Update Celo watcher

* Code review rework

docs: add TransferFees conformance note (#4212)

* docs: add TransferFees conformance note

* docs: clarify cosmwasm core contract

* fix: make link relative

Deploy Monad testnet (#4218)

CONTRIBUTING: update to forbid PRs the contain only minor wording adjustments

Node/Solana: Reobservation by transaction ID (#4223)

* Node/Solana: Reobservation by transaction ID

* Code review rework

Double the limits on Ethereum and Solana (#4225)

* Double the limits on Ethereum and Solana

Due to high network volumes on Ethereum and Solana, the limits are being doubled for these 2 chains

* Fixed the hardcoded max daily limit in the tests

chore: add cw wormhole interchain tests (#4189)

* wormchain: cw_wormhole ict start

* wormchain(interchaintest): initial test implementation

* Add Additional Core Contract ICTs

* Finish Core Contract VAA ICTs

* Add Replay Protection Checks

* Extract Helper Commands

* Fix Modify Genesis

* Hook into ICT Workflow

* Add Missing UpgradeContract VAA Test

* Add Additional Fee Checks

---------

Co-authored-by: Kaku <105181329+kakucodes@users.noreply.github.com>
Co-authored-by: Obie Kaku <obiekaku@gmail.com>

node: Add Transfer Verifier mechanism (#4169)

Adds a new package and command-line tool for Transfer Verification. This is a process of validating message publications from the core contracts. When a message is emitted, Transfer Verification will examine the corresponding receipt or other logs to ensure that funds were sent into the token bridge whenever this kind of message is emitted from the core bridge.
This is a defense-in-depth mechanism to guard against a scenario where an attacker finds a way to spoof message publications.

Node/Solana: Beef up commitment check (#4231)

Github: Update node code owners (#4232)

Node: Change TxHash to TxID in MessagePublication (#4219)

* Node: Change TxHash to TxID in MessagePublication

* Code review rework

* More code review rework

* Limit TxID to 255 bytes and add test for it

* Code review rework

node: Governor token list update (#4208)

* node: governor token list update

* Update based on USD depeg stats

* Update codeowners

---------

Co-authored-by: djb15 <djb15@users.noreply.github.com>

clients/js: support alternative aptos networks

Node: Add support for Movement (#4236)

pulled in joel's ict based shutdown contract tests

update ict cw_wormhole wasm binary

updated makefile to run the tests with proper features

updated rust tests in workflow

ignore unused variables and functions during shutdown mode

fixing package exclusion

rerendered artifacts

rerendered artifacts

Node: Audit chain IDs

Node: Allow no heartbeating in testnet (#4240)

Deploy token bridge to Monad testnet (#4238)

Node/Aptos: Don't replay old observation on startup (#4243)

Deployment: Add Movement testnet token bridge (#4245)

Node/Solana: Shim support in testnet (#4241)

* Node/Solana: Shim support in testnet

* Code review rework

Node: Remove references to SignedObservation (#4244)

* Node: Remove references to SignedObservation

* Code review rework

Node/Hack: Add tool to test go-ethereum subscriptions (#4214)

* Node/Hack: SeiEVM watcher test app

* Make tool general purpose

Revert #4225 (#4247)

Node: Remove Monad Devnet support (#4248)

Node/Solana: Fix shim observation message (#4249)

feat: mainnet validator hot swaps (#4203)

* Add ICT Local Image

* Fix ICT Workflow

* feat: allow validator hot swapping in mainnet

* Integrate with CI

* fix: comments

* readd state lookup

updated ict workflow versions

updated dockerfile to seperately generate the shutdown contracts

removed unnecessary files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants