Replies: 1 comment 1 reply
-
I figure out that it's actually possible to validate the state root as well even using the strategy wrapper block with relaxed consensus rules. We do not even need child storage -- just create a separate merkle db alongside the Substrate one, and validate the state root via the consensus layer. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This discussion aims at steer up some interests in the Ellaism community for a possible upgrade path using the Substrate blockchain framework and the Frontier toolkit. If and when the upgrade is finished, we can hopefully deal with many of the pressing issues in the community.
What will not change
If this hard fork is conducted, we aim at preserving all material aspects of Ellaism. This includes:
What will be changed
As this hard fork will drastically change the existing codebase, the following things will have to be modified:
Technical details
The recommended way from me to conduct this upgrade is through what I call wrapper block with relaxed consensus rules. I'll also list two alternative upgrade paths we can take below, for references.
Wrapper block is a strategy that can be used in Substrate to incorporate other blockchains that has not designed with Substrate in mind. In short, we take the existing Ethereum block structure, and wrap it with a Substrate block structure. We make sure that there is a one-to-one correspondence of the Ethereum/Ellaism and the Substrate block.
Relaxed consensus rules mean that we skip the validation of state root, but instead generate our own. This is safe because the security of a PoW blockchain is on the PoW seal. We think this is a good trade-off compared with strict consensus rules, as the later would require us to implement a feature not yet available in Substrate, and thus massively increase the development time.
Pre-upgrade
For pre-upgrade, we build a Substrate node that is capable of importing Ellaism blocks and generating its own states.
Technically, this means that we create a consensus engine in Substrate that takes a complete Ellaism block (with the header, transactions and receipts) as a pre-runtime digest*. The consensus engine is then responsible for checking the PoW seal. Then, the work is passed to runtime. We check that the extrinsic list is empty (because we do not want to take any other external data other than the Ellaism block), and use Frontier toolkit to execute the Ellaism block. With this, we can import all existing Ellaism blocks.
Hard fork
On the hard fork block, the consensus engine is switched from the pre-upgrade importing engine into a real PoW consensus engine. Then, the pre-runtime digest is removed. We then move new extrinsic submissions into the Substrate block structure and execute new blocks normally.
Nodes and user experiences
During the pre-upgrade time, the existing Geth/OE nodes and the new Substrate node must co-exist. This is because at this stage, only Geth/OE can construct new blocks, while the new Substrate node can only import new blocks. After the upgrade, Geth/OE will split and from there on, Substrate nodes will be able to construct new blocks by themselves.
This is certainly slightly more complicated than a normal hard fork, as in that case we always only deal with one executable. We can simplify the user experience by creating a third executable that will run both Geth/OE and the new Substrate nodes, and dispatch RPC requests accordingly.
Alternatives
The above described wrapper block with relaxed consensus rules is one of many possible paths we can take. Alternatives are:
Beta Was this translation helpful? Give feedback.
All reactions