Repository navigation
feat: wormhole executor adapter - #123
DhairyaSethi wants to merge 2 commits into
Conversation
Certora Run Started (Certora Prover Run)
Certora Run Summary
|
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Interface natspec says this should be chain specific, but it's hardcoded here ?
There was a problem hiding this comment.
yeah i'll fix the natspec, but checked with wormhole team and this number acts as a sentinel value for 'finalised' consistency across chains
There was a problem hiding this comment.
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 *; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
why not asserting refundAddress as well ? When do we want it to be address(0) ?
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
No description provided.