From 84ebfbdb6a327821cc08c4f7e8cfd3e7ed9357cc Mon Sep 17 00:00:00 2001 From: matt-nervos <88007636+matt-nervos@users.noreply.github.com> Date: Fri, 19 Jan 2024 13:35:16 -0500 Subject: [PATCH] Update 0051-ckb2023.md Adjust grammar and clarity of language --- rfcs/0051-ckb2023/0051-ckb2023.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/rfcs/0051-ckb2023/0051-ckb2023.md b/rfcs/0051-ckb2023/0051-ckb2023.md index fddffdc4..8ef0bd97 100644 --- a/rfcs/0051-ckb2023/0051-ckb2023.md +++ b/rfcs/0051-ckb2023/0051-ckb2023.md @@ -8,15 +8,15 @@ Created: 2023-04-17 # CKB Consensus Change (Edition CKB2023) -The current edition of CKB consensus rules is CKB2021. CKB2023 refers to the new edition of CKB consensus rules after its second hardfork, The purpose of a hard fork is to upgrade and update the rules encoded in the network. The changes are not backward compatible. This document outlines the changes in this upgrade. +The current edition of CKB consensus rules is CKB2021. CKB2023 refers to the new edition of CKB consensus rules after the network's second hardfork, the purpose of a hard fork is to upgrade and update the rules encoded in the network. The changes are not backward compatible. This document outlines the changes in this upgrade. ## What's in CKB2023 -CKB2023 will bring significant changes to the consensus rules, these changes include the removal of the reservation rule on version field in the block header, the introduction of a new version of the virtual machine (VM) with new syscalls and standard extensions, and the optimization of performance with new mops. This RFC provides a detailed overview of these changes. +CKB2023 will bring significant changes to CKB's consensus rules: these changes include the removal of the reservation rule on version field in the block header, the introduction of a new version of the virtual machine (VM) with new syscalls and standard extensions, and the optimization of performance with new MOPs. This RFC provides a detailed overview of these changes. ### CKB VM v2 -Since CKB2023, there will be multiple VM versions available. [RFC32] introduces a CKB VM version mechanism. It piggybacks on the `hash_type` field in the Script structure. +Once CKB2023 is activated, there will be multiple VM versions available. [RFC32] introduces a CKB VM version mechanism. It piggybacks on the `hash_type` field in the Script structure. | `hash_type` | JSON representation | matches by | VM version | | ----------- | ---------- | ---------------- | ---------- | @@ -26,24 +26,24 @@ Since CKB2023, there will be multiple VM versions available. [RFC32] introduces | 4 | "data2" | data hash | 2 | -[RFC0049] introduces what's new in CKB VM v2 and [RFC0050] adds new syscalls for VM v2. +[RFC0049] specifies the changes made in CKB VM v2 and [RFC0050] adds new syscalls for VM v2. -CKB VM v2 bring the following features: +CKB VM v2 brings the following features: -* New syscalls Spawn, Get Memory Limit, Set Content will be added. The syscall Spawn is the core part of this update. The Spawn and the latter two syscalls: Get Memory Limit and Set Content together, implement a way to call another CKB Script in a CKB Script. Unlike the Exec syscall, Spawn saves the execution context of the current script, like posix_spawn, the parent script blocks until the child script ends. -* [“A” Standard Extension](https://five-embeddev.com/riscv-isa-manual/latest/a.html), strictly speaking “A” Standard Extension in ckb-vm does not bring functional changes, but many existing code will be compiled with Atomic Instructions and need to be patched, while ckb-vm can implement A instructions to eliminate such work. For example, in CKB VM v2, if you write a script with rust, you can now use [log](https://crates.io/crates/log) crate directly. -* Introduce more [macro-op fusion](https://en.wikichip.org/wiki/macro-operation_fusion) to reduce cycles consumption of scripts. +* New syscalls Spawn, Get Memory Limit, Set Content will be added. The syscall Spawn is the core part of this update. Together, the Spawn and the latter two syscalls: Get Memory Limit and Set Content, implement a way to call another CKB Script from within a CKB Script. Unlike the Exec syscall, Spawn saves the execution context of the current script, and, like posix_spawn, the parent script blocks until the child script ends. +* [“A” Standard Extension](https://five-embeddev.com/riscv-isa-manual/latest/a.html), strictly speaking, introducing the “A” Standard Extension in ckb-vm does not bring functional changes, however, while it was previously for code to be compiled with Atomic Instructions and then patched to run on ckb-vm, ckb-vm v2 implements A instructions to eliminate such work. For example, in CKB VM v2, if you write a script with Rust, you can now use the [log](https://crates.io/crates/log) crate directly. +* Introduces more [macro-op fusion](https://en.wikichip.org/wiki/macro-operation_fusion) to reduce cycles consumption of scripts. ### Remove Block Header Version Reservation Rule -In CKB2021, the version field of the block header is reserved and only allowed to be 0. In the 2023 edition this reservation will be removed to allow for the use of [RFC0043] +In CKB2021, the version field of the block header is reserved and only allowed to be 0. In the 2023 edition this reservation will be removed to allow for the use of [RFC0043 - CKB Soft Fork Activation]. ## CKB2023 Timeline The mainnet upgrade is divided into three phases. -* **Stage 1 - Code Preview**: An RC version of 0.200.0 is ready for preview on June 30 2023 via nervosnetwork/ckb [releases](https://github.com/nervosnetwork/ckb/releases). It will introduce the incompatible changes to help developers to adapt their tools and apps to CKB2023. But this version does not activate the consensus incompatible changes in CKB2023. Developers can test the new rules by running a dev chain locally. +* **Stage 1 - Code Preview**: An RC version of 0.200.0 is ready for preview on June 30 2023 via nervosnetwork/ckb [releases](https://github.com/nervosnetwork/ckb/releases). It introduces the breaking changes to help developers to adapt their tools and apps to CKB2023. But this version does not activate the consensus incompatible changes in CKB2023. Developers can test the new rules by running a dev chain locally. * **Stage 2 - Testnet Activation**: @@ -51,12 +51,12 @@ The mainnet upgrade is divided into three phases. ## Upgrade Strategies -First, the SDK, Tool, and dApps authors must adapt to any 0.200.0 rc version. +First, all SDK, Tool, and dApps authors must adapt to any 0.200.0 rc version. -There are two strategies for ecosystem developers to upgrade to the CKB2023 consensus. Choose the former one if the developers can pause the app during the fork activation, otherwise, use the latter one. +There are two strategies for ecosystem developers to upgrade to the CKB2023 consensus. Choose the former one if it is possible for a developer to pause the app during the fork activation, otherwise, use the latter one. - Release two different versions or use the feature switcher. Manually deploy the newer version or enable the feature CKB2023 after the fork activation. -- Use feature switcher and enable the feature CKB2023 automatically when the chain grows into the activation epoch. The activation epoch is different in the testnet and the mainnet, which is available via the updated `get_consensus` RPC. +- Use feature switcher and enable the feature CKB2023 automatically when the chain reaches the activation epoch. The activation epoch is different in the testnet and the mainnet, which is available via the updated `get_consensus` RPC. ## Appendix