From 5391e2972a28d1638347bc9c5fa9b3ef24bac551 Mon Sep 17 00:00:00 2001 From: Pavel Kalinnikov Date: Mon, 5 Jul 2021 08:06:23 -0400 Subject: [PATCH] Don't store the ephemeral node hashes They are not used for reads, everything is based on compact ranges which don't use the ephemeral nodes. --- log/sequencer.go | 4 ++-- log/sequencer_test.go | 12 ------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/log/sequencer.go b/log/sequencer.go index 27dc75199b..6cff64b42a 100644 --- a/log/sequencer.go +++ b/log/sequencer.go @@ -187,8 +187,8 @@ func updateCompactRange(cr *compact.Range, leaves []*trillian.LogLeaf, label str return nil, nil, err } } - // Store ephemeral nodes on the right border of the tree as well. - hash, err := cr.GetRootHash(store) + // Note: The ephemeral node hashes are not stored. + hash, err := cr.GetRootHash(nil) if err != nil { return nil, nil, err } diff --git a/log/sequencer_test.go b/log/sequencer_test.go index a93e671bec..ba9520afda 100644 --- a/log/sequencer_test.go +++ b/log/sequencer_test.go @@ -99,10 +99,6 @@ var ( ID: compact.NewNodeID(0, 16), Hash: testonly.MustDecodeBase64("L5Iyd7aFOVewxiRm29xD+EU+jvEo4RfufBijKdflWMk="), }, - { - ID: compact.NewNodeID(5, 0), - Hash: testonly.MustDecodeBase64("R57DrKTGuZdjCNXjv6InGrm4rABLOn9yWpdHmYOoLwU="), - }, } testRoot = &types.LogRootV1{ @@ -128,14 +124,6 @@ var ( } // Nodes that will be stored after updating the tree of size 21. updatedNodes21 = []tree.Node{ - { - ID: compact.NewNodeID(5, 0), - Hash: testonly.MustDecodeBase64("1oUtLDlyOWXLHLAvL3NvWaO4D9kr0oQYScylDlgjey4="), - }, - { - ID: compact.NewNodeID(3, 2), - Hash: testonly.MustDecodeBase64("1yCvo/9xbNIileBAEjc+c00GxVQQV7h54Tdmkc48uRU="), - }, { ID: compact.NewNodeID(1, 10), Hash: testonly.MustDecodeBase64("S55qEsQMx90/eq1fSb87pYCB9WIYL7hBgiTY+B9LmPw="),