From c4473166974f9dcc7567350571d27367e9c7f6e4 Mon Sep 17 00:00:00 2001 From: Dmytro Kostenko Date: Tue, 28 Nov 2023 10:18:37 +0100 Subject: [PATCH] fix: hash difference to previous version --- taraxa/trie/layout.go | 2 +- taraxa/trie/node_enc.go | 1 + taraxa/trie/writer.go | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/taraxa/trie/layout.go b/taraxa/trie/layout.go index ed4672f52..586b1fa3b 100644 --- a/taraxa/trie/layout.go +++ b/taraxa/trie/layout.go @@ -20,7 +20,7 @@ type node interface { String() string } -const full_node_child_cnt = 17 +const full_node_child_cnt = 16 type full_node struct { children [full_node_child_cnt]node diff --git a/taraxa/trie/node_enc.go b/taraxa/trie/node_enc.go index a0ee4f6eb..d53ee7271 100644 --- a/taraxa/trie/node_enc.go +++ b/taraxa/trie/node_enc.go @@ -41,6 +41,7 @@ func (n *full_node) encode(w rlp.EncoderBuffer, res *Resolver) { w.Write(rlp.EmptyString) } } + w.Write(rlp.EmptyString) w.ListEnd(offset) } diff --git a/taraxa/trie/writer.go b/taraxa/trie/writer.go index e75bf3ec0..b34651f42 100644 --- a/taraxa/trie/writer.go +++ b/taraxa/trie/writer.go @@ -111,6 +111,7 @@ func (w *Writer) commit(db_tx IO, ctx *commit_context, full_nodes_above byte, ke } } ctx.enc_storage.ListEnd(storage_list_start) + ctx.enc_hash.AppendString(nil) ctx.enc_hash.ListEnd(hash_list_start, is_root, &n.hash) if n.hash != nil { db_tx.PutNode(n.get_hash().common_hash(), ctx.enc_storage.ToBytes(storage_list_start))