Further decouple SystemInterval values. #289
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In principle, most values in a
SystemInterval
can already be reported independently to the backend, which is a good thing. Unfortunately there are still two constraints:txcount
andpeers
must be sent together.block
information must always be sent with any other information, i.e. it is not possible to send any update that does not include block information.This unnecessarily restricts the granularity at which values can be sent to the telemetry backend. For example, the
txcount
andpeers
actually come from quite different sources in substrate, where either one may be unavailable independently of the other. This either prevents reporting one of these values when the other is not available or requires the code that sends these values to remember the last values of any such fields that are coupled together in this manner, just so an update can be sent.I think the frontend, i.e. the Telemetry, is the best place to handle this by giving maximum flexibility to the incoming data, meaning as much as possible it does not prescribe which values must be sent together and just updates its local state whenever it gets a new value. Therefore this PR decouples
txcount
andpeers
in theSystemInterval
message and makes theblock
field optional.Context: https://github.com/paritytech/substrate/pull/6986/files#r487127101.