Skip to main content

diff_inactivity

Function diff_inactivity 

Source
pub fn diff_inactivity(base: &[u64], target: &[u64]) -> InactivityDiff
Expand description

Computes a compact inactivity-score delta.

The returned delta contains sufficient information to reconstruct target from base.

If every inactivity score in the target vector is zero, the encoder emits an InactivityDiff::AllZeros representation. Otherwise, only modified indices and their replacement values are stored.

Newly appended validator scores are included as an extension.

§Arguments

  • base - Base inactivity score vector.
  • target - Target inactivity score vector.

§Complexity

O(n)