Skip to main content

diff_validators

Function diff_validators 

Source
pub fn diff_validators(base_bytes: &[u8], target_bytes: &[u8]) -> ValidatorsDiff
Expand description

Computes a compact delta between two validator registry SSZ buffers.

Both inputs must contain contiguous serialized validators in canonical SSZ form.

The encoder compares validators field-by-field using fixed protocol offsets. Only fields whose values differ are emitted as patches.

Immutable validator fields are ignored, while protocol-derived fields are omitted whenever they can be reconstructed deterministically during application.

Validators appended to the end of the registry are copied verbatim into the resulting delta.

§Arguments

  • base_bytes - Base validator registry as contiguous SSZ bytes.
  • target_bytes - Target validator registry as contiguous SSZ bytes.

§Complexity

O(n), where n is the number of validators.

§Panics

Never.