From 883f03b732e052899b830404130ddd9dc432451c Mon Sep 17 00:00:00 2001 From: jangko Date: Wed, 8 Jul 2020 21:14:19 +0700 Subject: [PATCH] update block witness docs --- stateless/readme.md | 5 +++-- stateless/tree_from_witness.nim | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/stateless/readme.md b/stateless/readme.md index 462b6ec5d..ee1324795 100644 --- a/stateless/readme.md +++ b/stateless/readme.md @@ -31,8 +31,9 @@ Every time you request a node using a hash key, you'll get one of the 3 types of ### Deviation from yellow paper * In the Yellow Paper, the `hash to next node` may be replaced by the next node directly if the RLP encoded node bytes count - less than 32. But in a real Ethereum State trie, this never happened. An empty RLP encoded `Account` will have length of 70. - Combined with the Hex Prefix encoding of nibbles, it will be more than 70 bytes. + less than 32. But in a real Ethereum State trie, this never happened for account trie. An empty RLP encoded `Account` will have length of 70. + Combined with the Hex Prefix encoding of nibbles, it will be more than 70 bytes. Short Rlp node only exist in storage trie + with depth >= 9. * In Yellow Paper, the 17th elem of the `Branch Node` can contains a value. But it always empty in a real Ethereum State trie. The block witness spec also ignore this 17th elem when encoding or decoding `Branch Node`. This can happen because in Ethereum `Secure Hexary Trie`, every keys have uniform length of 32 bytes or 64 nibbles. diff --git a/stateless/tree_from_witness.nim b/stateless/tree_from_witness.nim index e00b9a024..a229709c2 100644 --- a/stateless/tree_from_witness.nim +++ b/stateless/tree_from_witness.nim @@ -29,6 +29,8 @@ type # this TreeBuilder support short node parsing # but a block witness should not contains short node +# for account trie. Short rlp node only appears in +# storage trie with depth >= 9 # the InputStream still unstable # when using large dataset for testing