Refactor logs operation
- Dominant language
- Go
- Stars
- 3.7k
- Forks
- 465
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 5
Description
`LogOperation` and its co-types are poorly designed:
- [ ] They are meant to be stateless, but in reality there are caches in various places like `SequencerManager` (see the list below). We should rather make an explicit per-tree cache that can be extended (e.g. with compact ranges cached between sequencing runs as in #1598).
- [ ] Interfaces and method signatures are redundant. For example, `log.NewSequencer` takes a `Signer` created from a `Tree`, but then the same `Tree` is passed into `sequencer.IntegrateBatch` when in fact there is only one `Tree` that can be accepted.
- [ ] `log_operation_manager.go` is meant to be agnostic of sequencing, but it contains a bunch of sequencing-related metrics. It is likely that `LogOperation` abstraction is YAGNI.
- [ ] TODO: Keep listing changes.
The list of things we cache:
- Log names (in `OperationManager`).
- Signers (in `SequencerManager`).
- Masterships (in `OperationManager`).
- Compact ranges (not yet).
Contributor guide
Assessment
This issue has not been assessed yet.