Replies: 3 comments 4 replies
-
Several questions:
|
Beta Was this translation helpful? Give feedback.
-
is need to think about cut blocks? |
Beta Was this translation helpful? Give feedback.
-
Because of the chain id of Ethereum Legacy transaction is included in Ethereum TransactionDue to the Interoperation TransactionThere are two kinds of interoperation transaction:
Here a set of rules is needed to reinterpret Firstly,
|
Beta Was this translation helpful? Give feedback.
-
Challenges Outlined
The question is how to reuse IBC’s message and relay process to implement cell visitor. Let's first figure out what we need to do:
The key is: how to get cells from CKB. Cosmos IBC protocol specifies a set of inter-chain communication schema that makes smooth message exchange possible. To reuse IBC Relayer, we need a component to play the role of the opponent chain. This component does not have to be a chain, as long as it can do verifications on Axon as a Cell Emitter that keeps sending cells to Relayer, meanwhile requesting Relayer to resend cells to Axon.
Here is my design draft:
This graph illustrates the process of how an IBC-based cell visitor works, where IBC Relayer takes care of the entire message relay. This design contains three major components:
The complete workflow can be summarized as follows:
Design Explained
Cell Emitter
Being the core of the system, Cell Emitter is responsible for sending the cells from CKB to IBC Relayer and further, to Axon’s chain. Cell Emitter can be based on either ckb-indexer or ckb-node.
There are two critical states of Cell Emitter:
latest block number
. Because of its read-only nature, the image cell cannot reuse the state of CKB IBC light client on Axon to generate its latest block number, but rather updates it by itself. Correspondingly, in ICSC, the latest updated block number must be maintained.The overall workflow of Cell Emitter is demonstrated in the following flowchart:
IBC Relayer
IBC Relayer needs to relay the requests from Cell Emitter to Axon and listen to Axon as well.
The interfaces of requests IBC relays:
The events IBC Relayer listens to are:
IBC Relayer is stateless, therefore. For reuse, the following modifications are needed:
ICSC
As mentioned above, two ICSC states are necessary for Cell Emitter to properly function: block number and Read Only/Read Write. Therefore, ICSC is a stateful contract which stores all the cells and block header relayed from CKB.
The ICSC contract interface for updating is:
To save the storage space of EVM MPT, this contract is set as system contract and is independently stored from EVM MPT. At the end of each execution, the MPT root of the cell will be stored in the storage root of the corresponding Account in this contract.
The ICSC contract interface for query is:
We can see from the code snippets that these two interfaces are different. The interface called by IBC Relayer needs to call multiple write methods, while the one called by the application-side contract is all about calling read methods. Therefore, ICSC contracts has two categories:
Here comes a permission question for the system contract part, that is, whether the system contract needs to have a whitelist to add restriction on who can call the contracts. The answer depends on whether Axon can trust the cell information forwarded by Relayer.
More research needs to be done for the final decision. Intuitively speaking, the first design that includes the whitelist seems easier in terms of development.
Beta Was this translation helpful? Give feedback.
All reactions