Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orchestrator batch_market feature might throws unpredictable exceptions #361

Open
dzmitryhil opened this issue Oct 15, 2021 · 0 comments
Open

Comments

@dzmitryhil
Copy link

The component:

Orchestrator

Description

When the orchestrator relays transactions from cosmos to Ethereum and batch_market feature is enabled, the orchestrator gets the swap price of "bridging ERC20/WETH" using "quoteExactInputSingle(address,address,uint24,uint256,uint160)" on uniswap3 (Quoter.sol) and might fails with the output:

[2021-09-27T06:55:33Z INFO  relayer::batch_relaying] Unable to determine swap price of token 0x73bA9F88bEbCc8c86E602c0dfAA7268389AEd5e0 for WETH due to communication error Some(ContractCallError("Bad response from swap price")) - Will not be relaying batch TransactionBatch { nonce: 1, batch_timeout: 4594, transactions: [BatchTransaction { id: 1, sender: onomy15dw6lgy4ver2qqgcladvmvtgvd0v3uqju9xa75, destination: 0xBf660843528035a5A4921534E156a27e64B231fE, erc20_token: Erc20Token { amount: Uint256(1000000000000000000000), token_contract_address: 0x73bA9F88bEbCc8c86E602c0dfAA7268389AEd5e0 }, erc20_fee: Erc20Token { amount: Uint256(1), token_contract_address: 0x73bA9F88bEbCc8c86E602c0dfAA7268389AEd5e0 } }], total_fee: Erc20Token { amount: Uint256(1), token_contract_address: 0x73bA9F88bEbCc8c86E602c0dfAA7268389AEd5e0 }, token_contract: 0x73bA9F88bEbCc8c86E602c0dfAA7268389AEd5e0 }
[2021-09-27T06:55:33Z INFO  relayer::batch_relaying] Not relaying batch due to it not being profitable: TransactionBatch { nonce: 1, batch_timeout: 4594, transactions: [BatchTransaction { id: 1, sender: onomy15dw6lgy4ver2qqgcladvmvtgvd0v3uqju9xa75, destination: 0xBf660843528035a5A4921534E156a27e64B231fE, erc20_token: Erc20Token { amount: Uint256(1000000000000000000000), token_contract_address: 0x73bA9F88bEbCc8c86E602c0dfAA7268389AEd5e0 }, erc20_fee: Erc20Token { amount: Uint256(1), token_contract_address: 0x73bA9F88bEbCc8c86E602c0dfAA7268389AEd5e0 } }], total_fee: Erc20Token { amount: Uint256(1), token_contract_address: 0x73bA9F88bEbCc8c86E602c0dfAA7268389AEd5e0 }, token_contract: 0x73bA9F88bEbCc8c86E602c0dfAA7268389AEd5e0 }

And there are two reasons for it.

  1. WETH is different on different networks (Ropsten; Kovan; Rinkeby; Goerli, Mainnet).
  2. The swap pair doesn't exist on uniswap

Expected resolution

  1. Make WETH address configurable for the orchestrator/gbt
  2. Improve gbt/client to check whether the pair exists on uniswap before the transaction submission.
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

No branches or pull requests

1 participant