Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Database is broken down in to pages, each page has 4 KB size.
* Snapshot ID (8 bytes)
* This is the Version when page is created.
* Page content (4088 bytes)
* This is ether root page or subtrie page.
* This is either root page or subtrie page.

```mermaid
block-beta
Expand Down Expand Up @@ -151,7 +151,7 @@ block-beta

### Branch Node

Due to the exponential decrease in Trie density as deeper portions of the Trie are traversed, we expect the overwhelming majority of Branch nodes to contain a small number of children (2-4) and short prefix (0-4 nibbles), but also expect the top portion of the Trie to primarily consist of nearly-16-child Branches with 0 additional prefix. In order to keep the encoded size of a Branch node relatively stable as individual children are inserted and removed, we choose to use a variable branching factor for the Branch node based on the number of children it contains. Based on the value of the Chilidren Bitmask, the Branch will contain 2, 4, 8, or 16 Child slots in order to only resize the Branch node on each doubling of Child occupancy.
Due to the exponential decrease in Trie density as deeper portions of the Trie are traversed, we expect the overwhelming majority of Branch nodes to contain a small number of children (2-4) and short prefix (0-4 nibbles), but also expect the top portion of the Trie to primarily consist of nearly-16-child Branches with 0 additional prefix. In order to keep the encoded size of a Branch node relatively stable as individual children are inserted and removed, we choose to use a variable branching factor for the Branch node based on the number of children it contains. Based on the value of the Children Bitmask, the Branch will contain 2, 4, 8, or 16 Child slots in order to only resize the Branch node on each doubling of Child occupancy.

Note that a Branch Node with a non-empty Path Prefix is treated as both an Extension Node and a Branch Node for the purpose of RLP encoding and merkleization, and must be hashed twice.

Expand Down
2 changes: 1 addition & 1 deletion cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Current stats, all presented with minimum, maximum, and mean:
* Bytes per page
* Depth of trie in nodes
* Depth of trie in pages
* Path prefix lenth
* Path prefix length
* Number of children per branch
* Node size in bytes

Expand Down
2 changes: 1 addition & 1 deletion src/storage/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3483,7 +3483,7 @@ mod tests {
storage_engine.get_page(&context, context.root_node_page_id.unwrap()).unwrap();
let root_subtrie_contents_before = root_subtrie_page.contents().to_vec();

// WHEN: an account with a similiar but divergent path is deleted
// WHEN: an account with a similar but divergent path is deleted
let address_nibbles = Nibbles::unpack(hex!(
"0xf80f21938e5248ec70b870ac1103d0dd01b7811550a7ffffffffffffffffffff"
));
Expand Down