Skip to content

Commit acd071e

Browse files
committed
RFC(0053): CKB Hardfork
1 parent 2a6fa7a commit acd071e

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
Number: "0053"
3+
Category: Standards Track
4+
Status: Draft
5+
Author: Dingwei Zhang <[email protected]>
6+
Created: 2024-09-13
7+
---
8+
9+
# Nervos CKB Hardfork
10+
11+
## Introduction
12+
13+
This RFC presents a proposal for a hardfork in the Nervos Common Knowledge Base (CKB) blockchain. A hardfork represents a significant protocol update that introduces a permanent divergence from the previous version. Unlike minor updates, a hardfork involves changes that are not backward-compatible, requiring all network nodes to upgrade to maintain consensus.
14+
15+
## Motivation
16+
17+
A key distinction between a hardfork and a softfork lies in their upgrade requirements: a hardfork mandates that all nodes in the network adopt the new protocol, whereas a softfork only requires miners to upgrade. This fundamental difference amplifies the scope and impact of a hardfork.
18+
19+
The Nervos CKB implements hardforks to achieve the following objectives:
20+
21+
- **New Functionalities**: To unlock advanced capabilities and features that enhance the platform’s utility for developers and users. This includes modifications to data structures, the introduction of new RISC-V extensions, additional system calls (syscalls), and other enhancements.
22+
- **Security Upgrades**: To address critical vulnerabilities, fix significant bugs, and resolve limitations in the existing protocol that cannot be remedied through backward-compatible changes.
23+
24+
## Timing Policy
25+
26+
The timing policy for hardforks establishes a minimum interval of one year (equivalent to 2190 epochs) between successive hardforks. This cadence ensures that each hardfork delivers substantial, forward-compatible improvements while allowing sufficient time for rigorous testing. By spacing out these mandatory upgrades, the policy also minimizes the risk of network instability caused by frequent changes.
27+
28+
## Naming Convention
29+
30+
Each hardfork is designated as an "edition," comprising a cohesive set of impactful updates. Edition names are drawn from heroes in the game Dota, and they follow the format **CKB Edition [Name] (Year)**, reflecting the year of implementation. Both the mainnet and testnet share the same edition name, with suffixes (e.g., **Meepo mainnet** and **Meepo testnet**) added when differentiation is necessary.
31+
32+
### Naming Examples
33+
34+
- **CKB Edition Meepo (2024)**: Includes **Meepo mainnet** and **Meepo testnet**.
35+
36+
### Historical Editions
37+
38+
At the launch of Nervos CKB, the mainnet and testnet were assigned distinct names: Lina (mainnet) and Aggron (testnet). The first hardfork, termed the CKB2021 edition, renamed them to Mirana (mainnet) and Pudge (testnet). Starting with the second hardfork, a unified naming convention was adopted, aligning the testnet name with the mainnet’s edition name and eliminating separate designations. Historical editions have been retroactively updated to reflect this convention:
39+
40+
- **CKB Edition Lina (2019)**
41+
- **CKB Edition Mirana (2021)**
42+
43+
## Hardfork Process
44+
45+
The hardfork deployment unfolds in three distinct phases:
46+
47+
### Phase 1: Proposal and Discussion
48+
49+
1. **Proposal Creation**: The process begins with the drafting of a comprehensive hardfork proposal.
50+
2. **Feedback Collection and Discussion**: The proposal is shared with the community to solicit feedback and suggestions, refining the scope of updates through collaborative discussion.
51+
3. **RFC Presentation**: The finalized proposal is submitted as a formal RFC.
52+
4. **Initial Implementation and Testing**: Development commences based on the defined scope, followed by initial testing. Adjustments are made as needed based on early results.
53+
5. **Hardfork-Ready Version**: A preview version of the CKB node, compatible with the hardfork, is released for local testing in a development chain environment. This phase also involves updating ecosystem components—such as SDKs, block explorers, and wallets—to support the changes.
54+
6. **Duration**: This phase typically spans approximately 9 months, with flexibility based on development progress (e.g., 3 months for discussion and 6 months for implementation and testing).
55+
56+
### Phase 2: Public Preview and Testnet Deployment
57+
58+
1. **Public Preview Network Deployment**: Once the implementation is largely complete and well-tested, a public preview network incorporating the hardfork changes is launched, enabling participants to evaluate the updates.
59+
2. **Monitoring and Testing**: The preview network is closely monitored and tested to confirm its stability.
60+
3. **Testnet Hardfork Deployment**: Upon achieving stability in the preview network, the hardfork is rolled out to the testnet, involving:
61+
- **Release New Node Binary**: A new version of the node software is distributed.
62+
- **Announce Epoch Number**: A specific epoch is designated for hardfork activation. The upgrade takes effect at this epoch, not immediately upon binary release, even if all nodes have upgraded earlier.
63+
- **Activation**: Nodes transition to the hardfork-ready binary, and the upgrade activates at the specified epoch. The deployment is deemed successful if the majority of nodes upgrade smoothly by this point. Nodes running older versions will lose connectivity to the testnet post-hardfork.
64+
65+
### Phase 3: Mainnet Deployment
66+
67+
When the network community is prepared, the mainnet deployment mirrors the testnet process:
68+
69+
1. **Release Mainnet Hardfork Binary and Epoch Number**: A new binary and activation epoch are released for the mainnet.
70+
2. **Preparation Period**: A minimum of 3 months is allocated to allow participants ample time to upgrade.
71+
3. **Activation**: The hardfork activates on the mainnet at the designated epoch, following a majority node upgrade, signifying a successful deployment.
72+
73+
### Timeline Summary
74+
75+
- **Phase 1**: Proposal, Discussion, Implementation, and Testing – Approximately 9 months
76+
- **Phase 2**: Public Preview and Testnet Deployment – Duration varies based on stability
77+
- **Phase 3**: Mainnet Deployment – At least 3 months of preparation post-announcement
78+
79+
## Hardfork Activation Mechanism
80+
81+
Hardforks can be activated using one of two methods, each with distinct characteristics:
82+
83+
### Expedited Activation
84+
85+
- **Description**: This method triggers activation within a short timeframe, even if some validating nodes have not upgraded. Safety is enhanced by requiring near-unanimous miner enforcement of the new rules.
86+
- **Process**: Activation occurs automatically after 90% of the network’s hashpower signals readiness, followed by a predetermined delay.
87+
- **Risk Mitigation**: If consensus is lacking, this approach can detect it through failure to reach the 90% hashpower threshold, preventing premature activation.
88+
89+
### Flag Day Activation
90+
91+
- **Description**: This method schedules activation for a specific future date, chosen to ensure nearly all node operators have upgraded to software enforcing the new rules.
92+
- **Process**: Activation proceeds automatically without relying on miner signaling or support.
93+
- **Risk**: Without a built-in consensus check, this approach risks a chainsplit if adoption is incomplete—detectable only through mandatory signaling during activation or violations of the new rules afterward.
94+
95+
### Historical and Future Activation Methods
96+
97+
- **CKB Edition Mirana** and **CKB Edition Meepo** utilized the Flag Day Activation method.
98+
- Future hardforks will transition to the Expedited Activation method to bolster consensus verification and reduce the likelihood of network instability.

0 commit comments

Comments
 (0)