wormhole-foundation / wormhole

A reference implementation for the Wormhole blockchain interoperability protocol.
https://wormhole.com
Other
1.67k stars 685 forks source link

acala mainnet bug #4096

Open HelloRWA opened 2 months ago

HelloRWA commented 2 months ago

Description and context

When I calling wormholeRelayer.quoteEVMDeliveryPrice on acala mainnet, it return error

Steps to reproduce

  1. deploy hello wormhole contract which have a logic to call the wormholeRelayer.quoteEVMDeliveryPrice on acala mainnet
  2. call your method which call wormholeRelayer.quoteEVMDeliveryPrice

Experienced behavior

it shows the error

Error: ContractFunctionExecutionError: The contract function "quoteCrossChainMessage" reverted with the following reason:
Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).

Contract Call:
  address:   0xf9982e648ee8f9e3e9039b0071ba939c3bc19652
  function:  quoteCrossChainMessage(uint16 targetChain)
  args:                            (12)

Expected behavior

it should return a bigint as cost for the cross message call.

Solution recommendation

I dig into the source code, find two code: https://github.com/wormhole-foundation/wormhole/blob/78771ff5297e689938f467f946f3647e00bd083a/relayer/ethereum/contracts/relayer/deliveryProvider/DeliveryProvider.sol#L42 https://github.com/wormhole-foundation/wormhole/blob/78771ff5297e689938f467f946f3647e00bd083a/relayer/ethereum/contracts/relayer/deliveryProvider/DeliveryProviderSetters.sol#L79

It maybe cause by the setAssetConversionBuffer that admin input 0 as toleranceDenominator ?

scnale commented 2 months ago

Hello there, the standard relayers contract, i.e. the WormholeRelayer, is not deployed on Acala mainnet. What are you trying to do?

HelloRWA commented 2 months ago

Hello there, the standard relayers contract, i.e. the WormholeRelayer, is not deployed on Acala mainnet. What are you trying to do?

Oh, I suppose this is the standard relayer? https://docs.wormhole.com/wormhole/reference/blockchain-environments/evm#mainnet-contracts-787

I am building uni-bridge which provides a universal bridge that can bridge native/erc20/erc721/erc1155 in one bridge.

https://github.com/HelloRWA/uni-bridge/pull/1

If it is not a standard relayer, can we deploy one there? As I see current relayer on acala do not have any tx yet?