Skip to content
This repository was archived by the owner on Mar 7, 2023. It is now read-only.
This repository was archived by the owner on Mar 7, 2023. It is now read-only.

Acala integration impidiment #103

@flowersinthesand

Description

@flowersinthesand

Problem 1

To integrate BTP, a set of Relaychain and Parachain should provide the following JSON-RPC APIs:

  • eth_call
  • eth_chainId
  • eth_estimateGas
  • eth_gasPrice
  • eth_getCode
  • eth_getTransactionCount
  • eth_getTransactionReceipt
  • eth_sendRawTransaction
  • chain_getBlock
  • chain_getBlockHash
  • grandpa_proveFinality
  • state_getMetadata
  • state_getReadProof
  • state_getStorageAt

APIs in bolded text are missing in implementation of Acala network on Acala/Karura environment. They only have 2 JSON RPC methods to interact with EVM, which are evm_call and evm_estimateGas, and they can logically replace eth_call and eth_estimateGas, respectively. However, for BTP integration, these 2 JSON RPC methods are not enough. This is because Acala has their own implementation called Bodhi, instead of using Frontier implementation unlike Moonbeam. Compared to Frontier, Bodhi does not support standard Ethereum RPC and is not Web3 compatible.

You can check Karura (Acala network's Parachain on Kusama)'s API list by choosing 'rpc' in 'call the selected endpoint' dropdown and clicking 'Submit RPC call' in https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkarura-rpc-0.aca-api.network#/rpc

Problem 2

The second problem is that since Acala's implementation doesn't support evm.log event as a system event unlike Frontier, there is no way to prove the EVM event log contains BTP Message(s). As a result, the current BMV proof won’t work.

Problem 3

Also note that Acala isn't compatible with Truffle which we have used for development since day 1 according to Compatible Toolings. To run all existing tests on Acala environment, it's required to change the development environment from Truffle to Waffle and rewrite all tests. Technically, this is a time consuming task rather than a blocker.

Solution

Here are solutions sorted from easiest to hardest:

  1. Ask Acala team to support evm.Log event in EVM Pallet/Frame (The second problem) and missing APIs for BMR (The first problem)
  2. Rewrite BMC, BMV, BSH in !ink to natively support Relay chain and Parachain so that it can support Parachains supporting !ink whether they use Frontier or not. Note that not every Parachain supports !ink e.g. Moonbeam.
  3. As a runtime level solution, we could write a btp Pallet/FRAME module containing BMC, BMV, BSH aiming to every Parachain. In this case, Parachains don't even need to provide precompiles like sha3-256.

cc @trmaphi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions