Replies: 3 comments 3 replies
-
Thanks for this @driftluo ! A couple of questions
I struggle to understand why this is a design objective. It might be due to the fact that this is how most blockchains go through upgrades, as it implicitly involves running a different binary ; source code. What operator decisions do operators have to make? We can break down the problem into 2 questions
For 1, users do not have much freedom , as they need to be running the new binary . I believe this post aims to be address 2, how we trigger the upgrades and state transitions.
Depending on how you view things, hardfork might not always need to involve sunsetting the old version. In some cases , they are protocol additions , therefore there is might be a strong need to maintain bakwards compatibility the the pre-hardfork version of the software. I would take inspiration from Cosmos (cosmos visor) , and Substrate (runtime upgrades) , as they are also frameworks for building chains and seemed to have solved this issue. |
Beta Was this translation helpful? Give feedback.
-
After some discussions, considering the convenience of Axon chain maintainers, we initially came up with the following proposal: PremiseThe hard fork is only responsible for activating the function, and the use of the function is operated by the chain maintainer. For example, suppose we need to modify the upper limit of the contract size, hardfork will open the permission to modify it, but it will not limit the specific value, which is determined by the chain maintainer. Planwe use the block header
|
Beta Was this translation helpful? Give feedback.
-
What is Hardfork
A blockchain hardfork usually refers to a situation where a chain needs to be updated in an incompatible way, requiring all clients to upgrade to continue obtaining new blocks. The node maintainers need to update their nodes to a version that supports the hardfork function before the hardfork. Otherwise, the hardfork will split the chain, causing it to become two chains, such as BTC and BCH.
Does Axon support hardfork?
Not yet, but we are discussing and designing it. Predictably, we need it to do some incompatible updates or bug fixes. This post is based on some of our discussions. We have not yet decided which method to use, but we have generally identified several routes.
The general approach to implementing hardforks involves hardcoding the block number/epoch number in the code. When this condition is met, the VM execution logic, network message format, transaction broadcast behavior, block structure, etc. will undergo incompatible modifications. This is enough for a single chain. The hardcoded block number can be replaced with the corresponding configuration file for testing, and the configuration file can be packaged in binary for unified distribution.
However, this solution may not fully meet the requirements of Axon, as it is a framework that can be operated by any organization as independent chains and requires more flexibility in making hardfork decisions.
When designing the axon hardfork solution, we need to keep in mind that any user can make a flexible hardfork decision at the time they want. It should be configurable and does not depend on source code updates, but only on the decision of each operator.
Preliminary options
1. System Contract
(k, v)
= (the number of a hardfork, time point: block height)k
, write it into the document, and then write the code according to the value ofv
v
block.version
on the chain is updated tov
version synchronously (to facilitate light-client verification)It needs to provide a configuration scheme when initializing the chain and confirm the version at initialization.
Advantages:
Disadvantages:
v
, the system can only detect and prevent a change to a smallerv
value.2. Configuration File
Since Axon is a framework, the information confirmed by hardfork cannot be packaged in the general Axon binary distribution, which brings some troubles.
The consistency of the configuration file needs to be confirmed by the operator. If the configuration of each node is inconsistent, it may cause some problems, such as some nodes will go offline or temporarily stopping the chain due to insufficient consensus nodes. These problems can be solved by modifying the configuration file, but unfortunately, due to the configuration file scheme, the setting of the data has not been agreed on the chain, only when there is a problem, can it be known, and cannot be queried on the chain.
HardFork Process
Hardfork-related codes also need to be processed in three states:
The Axon consensus is to first agree on the block, and then execute the transaction content. The transaction broadcast does not include the transaction execution status. If the block structure and transaction structure are not updated, compared with ckb, the state processing during hardfork will be much simpler.
The goals that the network communication protocol needs to achieve before and after hardfork are as follows:
The reason for not deleting directly is that network propagation takes time, and node upgrades also take time. Hardfork cannot stop supporting the original protocol immediately after its own node update is completed. This will affect the upgrade process of downstream nodes. The disabling of the old protocol needs to be done after a period of time after the hard fork is completed.
Related PR
Beta Was this translation helpful? Give feedback.
All reactions