feat(aptos): add wormhole support#628
Open
karim-en wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces optional Wormhole integration into the Aptos OmniBridge, enabling the bridge to emit Wormhole VAAs (Verifiable Action Approvals) for key bridge actions, with full parity to the EVM implementation. The integration is controlled by an admin-settable flag, and includes new payload encoders, on-chain wiring to the Wormhole emitter, and comprehensive test coverage. The bridge remains fully functional when Wormhole publishing is disabled.
The most important changes are:
Wormhole Integration and Control
initializeand stores theEmitterCapabilityinBridgeState. Admins can enable or disable Wormhole publishing at any time using the newset_wormhole_enabledentry function, which simply toggles a flag. The same emitter ID is used across enable/disable cycles, providing a stable identity for off-chain consumers. [1] [2] [3] [4] [5] [6]Wormhole Payload Publishing in Bridge Actions
init_transfer,fin_transfer,deploy_token, andlog_metadataaction emits a Wormhole VAA. The caller pays the Wormhole message fee inCoin<AptosCoin>, and the payloads mirror the EVMOmniBridgeWormhole.solbyte layout for cross-chain compatibility. [1] [2] [3] [4] [5]Wormhole Payload Encoders
bridge_types.move, matching the EVM-side byte layouts exactly:init_transfer_wormhole_payload,fin_transfer_wormhole_payload,deploy_token_wormhole_payload, andlog_metadata_wormhole_payload. These ensure consistent cross-chain message formats. [1] [2]Stubbed Wormhole Dependency
vendor/wormhole, allowing the bridge to compile against the deployed Wormhole ABI without republishing the modules. This is documented in bothMove.tomland the code. [1] [2]Expanded Documentation and Test Coverage
CLAUDE.md) is updated to reflect the new Wormhole integration, including module layout, admin controls, and rationale for the stub. Test coverage is expanded to include Wormhole payload layouts and the gating logic for enabling/disabling publishing. [1] [2] [3] [4]