From 17d8878ccb6b30be8c084c800fb64172ffd61603 Mon Sep 17 00:00:00 2001 From: Raul Laprida Date: Mon, 20 Nov 2023 16:45:26 +0000 Subject: [PATCH 1/2] Update RSKIP107.md Status moved to Adopted. Specification updated with the correct field for the tree size (childrenSize), which excludes the size of the subtree's root. --- IPs/RSKIP107.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/IPs/RSKIP107.md b/IPs/RSKIP107.md index 18865f9d..6dc2023d 100644 --- a/IPs/RSKIP107.md +++ b/IPs/RSKIP107.md @@ -2,7 +2,7 @@ rskip: 107 title: Smaller Unitrie Nodes for Higher Scalability description: -status: Draft +status: Adopted purpose: Sca author: SDL (@sergiodemianlerner) layer: Core @@ -19,7 +19,7 @@ created: 2019 | **Purpose** | Sca | | **Layer** | Core | | **Complexity** | 1 | -| **Status** | Draft | +| **Status** | Adopted | # Abstract @@ -77,9 +77,8 @@ The new node format is as follows: - **valueHash**, 32 bytes: Hash digest of value stored - **valueLength**, uint24 (3 bytes): size of the value contained (if lvalue>0 and hasLongVal) -- if the left and right nodes are not present: - - - **treeSize**, 0-9 bytes: the size of the tree, variable length integer +- if the node is not terminal (either left or right nodes are present. This can be validated by checking that at least one of the 2 bits for nodePresent is in 1) : + - **childrenSize**, 0-9 bytes: the size in bytes of the subtree excluding the current node (size of the node's children), variable length integer - if !hasLongVal: - **value**, variable-size extends up to the bounds of the node buffer: stored value @@ -90,7 +89,7 @@ The overhead for a small leaf node is 2 bytes (flags and 1-byte of prefix length Because an Unitrie account having 1 RBTC-wei occupies 3 bytes. Assuming a 27-byte shared prefix, the space consumed without node overhead is 30 bytes. Therefore we've reduced the overhead of small accounts from 266% (80/30) to 7% (2/30). -The value treeSize enables sharding the state tree between nodes and requesting pieces in parallel from different nodes by specifying and offset and size of the requested chunk, while still being able to validate each piece independently, without the need to collect all pieces first. +The value childrenSize enables sharding the state tree between nodes and requesting pieces in parallel from different nodes by specifying and offset and size of the requested chunk, while still being able to validate each piece independently, without the need to collect all pieces first. **Shared Prefix Size Compression** From 8fa1b08208c8a9f55ed6d8cd78f9890f842fc9ea Mon Sep 17 00:00:00 2001 From: Raul Laprida Date: Mon, 20 Nov 2023 16:55:25 +0000 Subject: [PATCH 2/2] Update RSKIP107.md Text description of childrenSize rephrased. --- IPs/RSKIP107.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IPs/RSKIP107.md b/IPs/RSKIP107.md index 6dc2023d..ab3e8885 100644 --- a/IPs/RSKIP107.md +++ b/IPs/RSKIP107.md @@ -77,8 +77,8 @@ The new node format is as follows: - **valueHash**, 32 bytes: Hash digest of value stored - **valueLength**, uint24 (3 bytes): size of the value contained (if lvalue>0 and hasLongVal) -- if the node is not terminal (either left or right nodes are present. This can be validated by checking that at least one of the 2 bits for nodePresent is in 1) : - - **childrenSize**, 0-9 bytes: the size in bytes of the subtree excluding the current node (size of the node's children), variable length integer +- if the node is not terminal (meaning either the left or right nodes are present, which can be validated by checking that at least one of the two bits for 'nodePresent' is set to 1) : + - **childrenSize**, 0-9 bytes: the size in bytes of the underlying subtree, excluding the current node (the root of the subtree), represented as a variable-length integer - if !hasLongVal: - **value**, variable-size extends up to the bounds of the node buffer: stored value