Skip to main content

private_request_version

Function private_request_version 

Source
pub fn private_request_version(
    rpc: PrivateRpc,
    image: Option<&MetadataImage>,
) -> i16
Expand description

The version of rpc a sender puts in the request header, negotiated from image, the sender’s current metadata image.

It is KrabkaVersion::finalized(image).max_request_version(rpc). The fallbacks all land on a version every peer serves:

  • With no image (None), it is PRIVATE_BASELINE_VERSION, v0.
  • An image that has not finalized krabka.version reads as level 0, which gives v0 too.
  • A level above this build’s KRABKA_VERSION_MAX sends this build’s highest version. The controller finalized that level because every registered node supports it, and a node that supports a level serves every version below the one it gives.