fn should_node_become_unassigned(
    registry: &dyn RegistryClient,
    node_id: NodeId,
    subnet_id: SubnetId,
    cup: &CatchUpPackage,
) -> bool {
    let dkg_summary = &cup
        .content
        .block
        .get_value()
        .payload
        .as_ref()
        .as_summary()
        .dkg;
    let oldest_relevant_version = dkg_summary.get_subnet_membership_version().get();
    for version in oldest_relevant_version..=registry.get_latest_version().get() {
        if let Ok(Some(members)) =
            registry.get_node_ids_on_subnet(subnet_id, RegistryVersion::from(version))
        {
            if members.iter().any(|id| id == &node_id) {
                return false;
            }
        }
    }
    true
}
// Checks if the node still belongs to the subnet it was assigned the last time.
// We decide this by checking the subnet membership starting from the oldest
// relevant version of the local CUP and ending with the latest registry
// version.
Checks if the node still belongs to the subnet it was assigned the last time.
We decide this by checking the subnet membership starting from the oldest
relevant version of the local CUP and ending with the latest registry
version.
Checks if the node still belongs to the subnet it was assigned the last time . We decide this by checking the subnet membership starting from the oldest relevant version of the local CUP and ending with the latest registry version .
fn should_node_become_unassigned(
    registry: &dyn RegistryClient,
    node_id: NodeId,
    subnet_id: SubnetId,
    cup: &CatchUpPackage,
) -> bool {
    let dkg_summary = &cup
        .content
        .block
        .get_value()
        .payload
        .as_ref()
        .as_summary()
        .dkg;
    let oldest_relevant_version = dkg_summary.get_subnet_membership_version().get();
    for version in oldest_relevant_version..=registry.get_latest_version().get() {
        if let Ok(Some(members)) =
            registry.get_node_ids_on_subnet(subnet_id, RegistryVersion::from(version))
        {
            if members.iter().any(|id| id == &node_id) {
                return false;
            }
        }
    }
    true
}
fn should_node_become_unassigned ( registry : & dyn RegistryClient , node_id : NodeId , subnet_id : SubnetId , cup : & CatchUpPackage , ) -> bool { let dkg_summary = & cup . content . block . get_value ( ) . payload . as_ref ( ) . as_summary ( ) . dkg ; let oldest_relevant_version = dkg_summary . get_subnet_membership_version ( ) . get ( ) ; for version in oldest_relevant_version ..= registry . get_latest_version ( ) . get ( ) { if let Ok ( Some ( members ) ) = registry . get_node_ids_on_subnet ( subnet_id , RegistryVersion :: from ( version ) ) { if members . iter ( ) . any ( | id | id == & node_id ) { return false ; } } } true }
Checks if the node still belongs to the subnet it was assigned the last time.
Checks if the node still belongs to the subnet it was assigned the last time .
registry
&dyn RegistryClient
node_id
NodeId
subnet_id
SubnetId
cup
&CatchUpPackage
registry
&dyn RegistryClient
node_id
NodeId
subnet_id
SubnetId
cup
&CatchUpPackage