Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't compute the unused ephemeral nodes #2579

Merged
merged 2 commits into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions storage/cache/log_tile.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ func PopulateLogTile(st *storagepb.SubtreeProto, hasher hashers.LogHasher) error
return err
}
}
_, err := cr.GetRootHash(store)
if err != nil {
return fmt.Errorf("failed to compute root hash: %v", err)
}

// Additional check - after population we should have the same number of internal nodes
// as before the subtree was written to storage. Either because they were loaded from
Expand Down
4 changes: 0 additions & 4 deletions storage/mysql/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ func createLogNodesForTreeAtSize(t *testing.T, ts, rev int64) ([]stree.Node, err
return nil, err
}
}
// Store the ephemeral nodes as well.
if _, err := cr.GetRootHash(store); err != nil {
return nil, err
}

// Unroll the map, which has deduped the updates for us and retained the latest
nodes := make([]stree.Node, 0, len(nodeMap))
Expand Down
2 changes: 1 addition & 1 deletion storage/testonly/fake_node_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func NewMultiFakeNodeReaderFromLeaves(batches []LeafBatch) *MultiFakeNodeReader
}
}
// TODO(pavelkalinnikov): Use testing.T.Fatalf instead of panics.
root, err := cr.GetRootHash(store) // Store the ephemeral nodes as well.
root, err := cr.GetRootHash(nil)
if err != nil {
panic(fmt.Errorf("GetRootHash: %v", err))
}
Expand Down