Skip to content

feat: wormhole executor adapter - #123

Open
DhairyaSethi wants to merge 2 commits into
mainfrom
feat/wormhole-executor
Open

DhairyaSethi wants to merge 2 commits into
mainfrom
feat/wormhole-executor

Conversation

@DhairyaSethi

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

Certora Run Started (Certora Prover Run)

  • Group ID: f9e42599-058c-4c8b-8d4e-2e1d23f3d09f
Config Status Link Log File
verifyCrossChainControllerWithEmergency.conf Submitted link security/certora/confs/verifyCrossChainControllerWithEmergency.conf-615987e1f07f.log
verifyCrossChainForwarder-encode-decode-correct.conf --rule encode_decode_well_formed_TX Submitted link security/certora/confs/verifyCrossChainForwarder-encode-decode-correct.conf-3a2815629885.log
verifyCrossChainForwarder-envelopRetry.conf Submitted link security/certora/confs/verifyCrossChainForwarder-envelopRetry.conf-2e98b4c2548f.log
verifyCrossChainForwarder-invariants.conf Submitted link security/certora/confs/verifyCrossChainForwarder-invariants.conf-21623eff428f.log
verifyCrossChainForwarder-newEnvelope.conf Submitted link security/certora/confs/verifyCrossChainForwarder-newEnvelope.conf-95355a2e1f2a.log
verifyCrossChainForwarder-sanity.conf Submitted link security/certora/confs/verifyCrossChainForwarder-sanity.conf-5d44d2fe992d.log
verifyCrossChainForwarder-shuffle.conf Submitted link security/certora/confs/verifyCrossChainForwarder-shuffle.conf-9073eaacf4a7.log
verifyCrossChainForwarder-simpleRules.conf Submitted link security/certora/confs/verifyCrossChainForwarder-simpleRules.conf-7449e696a956.log
verifyCrossChainReceiver.conf Submitted link security/certora/confs/verifyCrossChainReceiver.conf-9bf94a9ceb18.log

Certora Run Summary

  • Started 9 jobs
  • 0 jobs failed

Download Logs

@certora-run certora-run Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Certora Prover Run

  • Group ID: f9e42599-058c-4c8b-8d4e-2e1d23f3d09f
  • Commit: cd79997
Job Result VERIFIED Link
verifyCrossChainReceiver.conf ✅ 50 Link
verifyCrossChainForwarder-simpleRules.conf ✅ 10 Link
verifyCrossChainForwarder-shuffle.conf ✅ 3 Link
verifyCrossChainForwarder-sanity.conf ✅ 1 Link
verifyCrossChainForwarder-newEnvelope.conf ✅ 2 Link
verifyCrossChainForwarder-invariants.conf ✅ 6 Link
verifyCrossChainForwarder-envelopRetry.conf ✅ 2 Link
verifyCrossChainForwarder-encode-decode-correct.conf --rule encode_decode_well_formed_TX ✅ 2 Link
verifyCrossChainControllerWithEmergency.conf ✅ 6 Link

uint16 public immutable WORMHOLE_SOURCE_CHAIN_ID;

/// @inheritdoc IWormholeExecutorAdapter
uint8 public constant CONSISTENCY_LEVEL = 202;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Interface natspec says this should be chain specific, but it's hardcoded here ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah i'll fix the natspec, but checked with wormhole team and this number acts as a sentinel value for 'finalised' consistency across chains

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Okay, thanks for the explanation. Good for me to amend the Natspec to mention it clearly then.

* configured trusted remotes.
*/
contract WormholeExecutorAdapter is BaseAdapter, IWormholeExecutorAdapter, IVaaV1Receiver {
using WormholeExecutorEncoding for *;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unused ? I see call using WormholeExecutorEncoding.xxx() instead ?

{
require(wormholeCore != address(0), Errors.WORMHOLE_CORE_CANT_BE_ADDRESS_0);
require(executorQuoterRouter != address(0), Errors.WORMHOLE_QUOTER_ROUTER_CANT_BE_ADDRESS_0);
require(quoter != address(0), Errors.WORMHOLE_QUOTER_CANT_BE_ADDRESS_0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why not asserting refundAddress as well ? When do we want it to be address(0) ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

fwiw the refund goes to refundAddr on the source chain so natspec saying destination is off. BNB and Monad are deployed with 0 but they only receive so it’s fine.

require(nativeChainId != uint16(0), Errors.DESTINATION_CHAIN_ID_NOT_SUPPORTED);
require(receiver != address(0), Errors.RECEIVER_NOT_SET);

bytes memory relayInstructions = WormholeExecutorEncoding.encodeGas(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

executeVAAv1 verifies guardian signatures inside the relayed gas limit, but BASE_GAS_LIMIT defaults to 0. Suggest requiring a non-zero value sized via fork test, or adding verification cost when building relayInstructions.

vm.mockCall(
quoterRouter,
executorFee,
abi.encodeWithSelector(IExecutorQuoterRouter.requestExecution.selector),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

requestExecution is mocked with any args, so a wrong emitter, sequence, gas or refund address would still pass. Should we add a vm.expectCall checking its exact arguments, like publishMessage?

) private returns (uint64 sequence) {
bytes32 emitter = bytes32(uint256(uint160(address(this))));

// quote using a placeholder sequence: the executor fee does not depend on the sequence number

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can the quoter's price ever depend on the message number? The fee is quoted for placeholder sequence 0 but paid for the real one. Would quoting after publishMessage be safer?

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.

4 participants