google / google/trillian

Reduce code complexity related to maps

Open
#2,378 2 comments 0 reactions 0 assignees View on GitHub
cleanup
Dominant language
Go
Stars
3.7k
Forks
465
Avg merge
2d 16h
Merged PRs (30d)
5

Description

Some of the code is unnecessarily complex because previously it tried to accommodate both `Log` and `Map` trees. After maps removal [#2284] it makes sense to minimize this code, so that it's log-specific. If anything related to maps reappears in the repo, it still makes sense to keep the code decoupled to a greater degree than previously.

Examples:

- [ ] [storage/cache](https://github.com/google/trillian/tree/3615e67ca1e376d40e92178d524a5499ba485545/storage/cache) can be removed completely, or significantly [simplified](https://github.com/google/trillian/issues/1797#issuecomment-532637547).
- [x] The [NodeID&co](https://github.com/google/trillian/blob/3615e67ca1e376d40e92178d524a5499ba485545/storage/tree/node.go) types should be made log-specific. It likely needs to be replaced by a simple [compact.NodeID](https://github.com/google/trillian/blob/3bc7219b903515f5a24d5646c8c3679d017cda15/merkle/compact/nodes.go#L30), whereas for maps the [NodeID2](https://github.com/google/trillian/blob/3615e67ca1e376d40e92178d524a5499ba485545/storage/tree/node_id2.go) type is more suitable.
- [ ] The LogStorage/TreeStorage/MapStorage interfaces can be reduced.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.