feat: replace store_update_{time,height} by metadata update #973
Labels
A: breaking
Admin: breaking change that may impact operators
O: optimization
Objective: aims to optimize performance, allocations and computations
store_update_time and store_update_height methods are always called
together. In fact, they are also usually called together with
store_consensus_state.
Sadly, since they are separate calls, the implementations need to
treat them as separate pieces of data. For example, if an
implementation stores update times and heights in a map, it must
perform two separate lookups to update each value.
Change the interface such that store_consensus_state in addition takes
host timestamp and height. This makes it possible for implementations
to perform optimisations where timestamp and height are stored in
a single location. This reduces number of lookups and possibly also
improves memory footprint of the implementation.
In fact, they may be stared together with the consensus state making
the optimisation potential even stronger.
Alas, updating of the timestamp and height is at times called without
updating the consensus state. To accommodate that use case, introduce
store_consensus_metadata call which only takes the timestamp and
height arguments.
The text was updated successfully, but these errors were encountered: