Skip to content

Commit

Permalink
fix: hash difference to previous version
Browse files Browse the repository at this point in the history
  • Loading branch information
kstdl committed Nov 28, 2023
1 parent f852fc1 commit c447316
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion taraxa/trie/layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions taraxa/trie/node_enc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
1 change: 1 addition & 0 deletions taraxa/trie/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit c447316

Please sign in to comment.