Skip to content

Commit

Permalink
Don't store the ephemeral node hashes
Browse files Browse the repository at this point in the history
They are not used for reads, everything is based on compact ranges which
don't use the "ephemeral" nodes.
  • Loading branch information
pav-kv committed Jul 19, 2021
1 parent 65021e5 commit 0d1f2c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
4 changes: 2 additions & 2 deletions log/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
12 changes: 0 additions & 12 deletions log/sequencer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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="),
Expand Down

0 comments on commit 0d1f2c1

Please sign in to comment.