Skip to content

sui_v0.20.0_1672349675_ci

@longbowlu longbowlu tagged this 29 Dec 20:05
In one of my other PRs (will link once published), `fn
new_from_system_state` is used to create new AuthorityAggregator for a
new epoch. In current AuthorityAggregator construction functions, we
always create new metrics `AuthAggMetrics` and `SafeClientMetricsBase`
with an existing Prom registry. This does not work because attempting to
register already-registered metrics with the same registry will [return
an
error](https://docs.rs/prometheus/latest/src/prometheus/registry.rs.html#48).

This PR creates an `fn new_with_metrics` to allow to create
AuthorityAggregator with `AuthAggMetrics` and `SafeClientMetricsBase`
rather than a registry.

Note: `fn new_from_system_state` works fine today because its only
callsite uses a new Registry rather than the "global" one. This may not
be a big deal for the callsite, which only happens for the epoch change
tx during reconfig, but is certainly a problem for other cases.
Assets 2
Loading