ethereumblockchainsolidityaxelar

Where does Axelar GMP Service gets the gas price for destination chain from?


I am sending 2-way messages, from BSC to Moonbase and then in the same tx, from Moonbase back to BSC. The thing is that it always fails on the callback with insufficient fee, seems like Moonbase needs 8-9 DEV to send the callback message back to BSC.

What I do is to manually pay the execution on BSC, and I wonder: why is it so expensive to run the callback from Moonbase to BSC (8-9 DEV is a lot, in that testnet) and how can I know it beforehand? Where is the BSC/DEV price coming from? Because at the end, axelar is asking me to pay in DEV the BSC gas, so there must be a bsc-dev price somewhere


Solution

  • When sending a two-way call from BSC to Moonbase and back to BSC, you need to ensure that you have enough gas to cover the entire round-trip transaction. The gas cost estimation is direction-dependent and can be very different for the outbound and return trip directions. To determine the amount of gas required for the round trip, you can use the estimateGasFee method from the AxelarJS SDK . You need to call this method twice, once for the gas cost for BSC >> Moonbase, and then again for the gas cost for Moonbase >> BSC. The total cost would be the sum of the two estimations.

    If the remaining gas amount is insufficient for the returned trip, the Insufficient Fee tag will show up on Axelarscan UI. In that case, the returned call won't be relayed until the gas is added. You can increase more gas to relay the call to the destination contract via the Axelar SDK or Axelarscan UI .

    Regarding the BSC/DEV price, the gas service uses current conversion rates to translate the gas paid on the source chain for the gas cost used by Axelar and the destination chains. However, the extracts provided do not contain specific information about the BSC/DEV price.