Skip to content

Aptos Watcher Tests + event type check#4838

Merged
djb15 merged 12 commits into
wormhole-foundation:mainfrom
mdulin2:aptos_tests
Jul 14, 2026
Merged

Aptos Watcher Tests + event type check#4838
djb15 merged 12 commits into
wormhole-foundation:mainfrom
mdulin2:aptos_tests

Conversation

@mdulin2

@mdulin2 mdulin2 commented May 26, 2026

Copy link
Copy Markdown
Contributor

The PR does the following:

  • Separates the core processing functionality for the Aptos watcher into separate functions. This is to make the code more testable.
  • Adds an event type verification to the message handling. This required a small change to the watcher configuration. This should be the ONLY functionality change to the watcher from the refactor.
  • Rewrote the JSON modification framework in the test suite to be more modular.

@mdulin2

mdulin2 commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

I ran the reobservation flow on the production watcher for a while. It was picking up all of the events that were identifiable on Wormholesan.

Comment thread node/pkg/watchers/aptos/watcher.go
@mdulin2

mdulin2 commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

This broke the tilt CI. I'll figure out why and fix that.

@mdulin2 mdulin2 marked this pull request as draft May 26, 2026 18:23
@mdulin2 mdulin2 marked this pull request as ready for review June 1, 2026 22:45
Comment thread node/pkg/watchers/aptos/watcher.go
Comment thread node/pkg/watchers/aptos/watcher.go Outdated
Comment thread node/pkg/watchers/aptos/watcher.go Outdated
Comment thread node/pkg/watchers/aptos/watcher.go
Comment thread node/pkg/watchers/aptos/watcher.go Outdated
Comment thread node/pkg/watchers/aptos/watcher_test.go Outdated
djb15
djb15 previously approved these changes Jun 10, 2026

@djb15 djb15 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor comment on the code comment, but otherwise this looks good

Comment thread node/pkg/watchers/aptos/watcher.go Outdated
@djb15 djb15 self-requested a review June 12, 2026 23:06
Comment thread node/pkg/watchers/aptos/watcher.go Outdated
Comment thread node/pkg/watchers/aptos/watcher.go Outdated
Comment thread node/pkg/watchers/aptos/watcher.go Outdated
Comment thread node/pkg/watchers/aptos/watcher.go Outdated

@pleasew8t pleasew8t left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

First pass looks good. Left a few suggestions.

djb15
djb15 previously approved these changes Jun 15, 2026

@djb15 djb15 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Happy from my side. Will review any changes requested by the other reviewers

@mdulin2

mdulin2 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@pleasew8t I made some changes based on your feedback. Feel free to review it again.

djb15
djb15 previously approved these changes Jun 17, 2026

@djb15 djb15 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Changes in the latest commit look good

@bemic bemic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I went over the code and my one comment would be regarding the 0x/0X, but it is already covered in Jason's comment.
The second comment, apparently Aptos addresses with stripped zeros can be used. Example from Aptos docs is 0x1. However I don't really know how rare it is.

@mdulin2

mdulin2 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@bemic I saw this too but didn't decide to dig further. It appears that the type and the guid get truncated. For instance, check this out: 7730cd28ee1cdc9e999336cbc430f99e7c44397c0aa77516f6f23a78559bb5

The type is returned as 0x7730cd28ee1cdc9e999336cbc430f99e7c44397c0aa77516f6f23a78559bb5::pool::ThalaSwap even though the real type would have the zeros. I'll fix the code to trim leading zeros on the comparison.

Comment thread node/pkg/watchers/aptos/watcher.go
Comment thread node/pkg/watchers/aptos/watcher.go
Comment thread node/pkg/watchers/aptos/watcher.go
Comment thread node/pkg/watchers/aptos/watcher_test.go
Comment thread node/pkg/watchers/aptos/config.go Outdated
Comment thread node/pkg/watchers/aptos/watcher.go
@djb15 djb15 merged commit 175b52c into wormhole-foundation:main Jul 14, 2026
138 of 143 checks passed
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.

6 participants