Skip to content

Refactor logs operation #1640

@pav-kv

Description

@pav-kv

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 sequencer: Cache compact.Tree between sequencing runs #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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions