Repository navigation
Conversation
|
Claude finished @djb15's task in 5m 47s —— View job Code Review: EVM Watcher Divergence Tests (PR #4931)
SummaryThis is a well-structured PR that accomplishes two things: (1) refactors the EVM watcher's Verdict: Approve (no blocking issues found) Production Code Changeswatcher.go refactoring — The five extracted methods (
Test AdditionsObservation/Reobservation Parity Test — The Generated Receipt Golden Vectors — 210 synthetic vectors covering edge cases (empty/binary/all-zero payloads, leading-zero emitters, uint64-max sequences, high-bit timestamps, multiple Wormhole events per receipt, non-standard chain IDs, all consistency levels). The coverage test ( Metadata Independence Test — Test Helpers — FindingsTwo low-severity inline comments posted:
No security, correctness, or performance issues identified. |
2ac3b24 to
42b3ab0
Compare
014fe79 to
47131ff
Compare
47131ff to
ff73554
Compare
johnsaigle
left a comment
There was a problem hiding this comment.
Some initial thoughts on the PR, mostly suggestions.
I'll take a deeper look at this soon but I wanted to provide some of the feedback I have so far.
johnsaigle
left a comment
There was a problem hiding this comment.
I think the PR is in good shape. The testing strategy should help catch regressions which is great.
Overall I'm in support of the refactoring. It's nice to have the message publication be built only in a single place as well as to split out some of the more complicated functionality into separate functions. This facilitates testing.
A few things to note:
- For safety we probably want to run this on devnet/testnet for a while just to make sure the watcher changes are sound
- The test cases are generated from Ethereum mainnet. We could consider adding real receipts from other chains too. This would be a separate PR though.
- I double-checked the goroutine refactoring parts and I believe the new functions containing them are exactly the same as the originals
- The script to generate the test cases isn't included here. We could consider adding this in a follow-up PR in case we ever want to regenerate the test cases.
…message publications
de7f77f to
76495a3
Compare
|
|
||
| verifyCtx, cancel := context.WithCancel(parentCtx) | ||
| defer cancel() | ||
| pubErr := w.verifyAndPublish(msg, verifyCtx, ev.Raw.TxHash, receipt) |
There was a problem hiding this comment.
I did a quick investigation into this, since the transaction status is verified earlier during evm-require-successful-receipt-before-observation. I don't understand the rule at all, but some guided work tells me that the CodeQL rule needs to include context of the validateTransactionReceipt function.
Additionally, isSafeMessageEventsFunction only checks MessageEventsForTransaction, and not MessageEventsForTransactionReobservation.
The CodeQL rule will need to be updated to support the refactor (cc @djb15 @bemic).
This PR introduces a set of tests that verify the normal observation path will always lead to the same hash as the reobservation path for the EVM watcher.
It includes some refactor to the watcher to aid in testing which should be reviewed carefully to ensure that the current behaviour hasn't been changed inadvertently.