Key points and detail design of next Darwinia Ethereum-chains message protocol #753
Closed
8 tasks done
Labels
P-High
[Priority] High
According to the conclusions in darwinia-network/darwinia-messages-sol#76, we should use same frame message framework as substrate to substrate bridge to build the message protocol for bridges between Darwinia and Ethereum-chains. This benefit as following:
Key points and detail design:
We should use parity-bridge-common's substrate to substrate message pallet as a framework/template to develop the message pallet for the bridge between substrate and ethereum. The detail design and framework should be an important reference for the implementation of substrate-ethereum pallet. Due to following differences, we should develop separate pallet to accelerate the milestone instead of generalized pallet which will require upstream approve and merge. The generalization can be done in future. @AsceticBear @xiaoch05
ABI encode and SCALE encode conversion. In evm, the smart contracts might be hard to provide SCALE encode of remote calls, so the pallet might need to do conversion from ABI encode of call to SCALE encode before do runtime call dispatch in substrate side.Inbound MessageRoot Commitment Spec
of Basic Message Channel, we've changed the leaf spec to(OutboundLandData_Hash, InboundLandData_Hash)
, and formessage_proof()
anddevilvery_message_proof()
, the proof will beProof: merkle proof + OutboundLandData + InboundLandData_Hash
andProof: merkle proof + OutboundLandData_Hash + InboundLandData
, for evm smart contract to save gas and easily decode OutboundLandData and InboundLandData from substrate, OutboundLandData and InboundLandData in storage might need to be encoded using ABI.We will need an alternative ethereum light client pallet for header sync and using (account_in_header_state_root, storage_in_account) to verify and decode messages and etheruem's InboundLaneData, instead of current version running in production which is using a. Include ethereum MMR b.
(header_hash_in_mmr_root, event_in_reciept_root)
as proof c. using txid to avoid replay attack instead of message nonce in new design.We need an v2 version of the evm smart contract implementation of message protocol, it will also reference the substrate InboundLaneData and OutboundLaneData as mentioned in Use s2s struct and framework to eliminate the requirement of MMR in message layer, and support receive_messages_delivery_proof(and app transactional support) darwinia-messages-sol#76 @hujw77
Shadow MMR services might not needed since the truth(on-chain light client) layer may not need mmr too, especially for chains like BSC etc. Thus, pull request feat: add heco and bsc mmr generation shadow#152 might not needed further, and hopefully, current mmr related codes/services in shadow and verification game can also be removed. cc @AurevoirXavier @xiaoch05 .
The changes mentioned in this issue required to be done in #714 (Darwinia <> Ethereum Bridge Upgrade CheckList), there are multiple instances in Ethereum chain family, the order may be as following:
The text was updated successfully, but these errors were encountered: