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

Acala integration impidiment #103

Open
flowersinthesand opened this issue Sep 30, 2021 · 1 comment
Open

Acala integration impidiment #103

flowersinthesand opened this issue Sep 30, 2021 · 1 comment

Comments

@flowersinthesand
Copy link
Collaborator

flowersinthesand commented Sep 30, 2021

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

@trmaphi
Copy link
Collaborator

trmaphi commented Oct 1, 2021

  1. 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.

There's no official confirmation, but I checked out the discord community and confirm, there're no support for !ink smart contract on Acala 😔

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants