astraly-labs/hyperlane_starknet

Audit: `recipient_ism` fallback mecanism

Opened this issue · 0 comments

Actual behavior

  • On the solidity implementation, the function recipient_ism allows the user to choose between a defined ism (specified in interchain_security_module or the mailbox default one, if this function is not defined. In cairo, we implemented the call_contract_syscall in order to call the interchain_security_module from the recipient in order to follow the actual behavior. However, in the starknet documentation, we have "An internal call can’t return Err(_) as this is not handled by the sequencer and the Starknet OS. If call_contract_syscall fails, this can’t be caught and will therefore result in the entire transaction being reverted." (cf here), which means that if the recipient_ism is not defined, the entire function will revert.

Expected behavior

  • We need to catch an error if the function is not implemented and fallback on the default ism if not provided. Since it is not possible currently on the starknet os, we will have to find an alternative solution for this to work properly