fix(blend): verify membership info early on for edge service (#2741)

This commit is contained in:
Antonio 2026-05-13 14:28:32 +02:00 committed by GitHub
parent 617b8cf78f
commit 5510f55cd6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -468,6 +468,20 @@ where
let Some(zk_info) = &new_membership_info.zk else {
return Err(Error::NetworkIsTooSmall(0));
};
// Validate the edge node condition up front so the service shuts down on
// an invalid membership regardless of whether secret PoL info has arrived
// yet. Without this check, an invalid membership would silently update
// `current_membership_info` and surface later as a panic in
// `handle_new_secret_epoch_info`.
let membership_size = new_membership_info.membership.size();
if membership_size < settings.minimum_network_size.get() as usize {
return Err(Error::NetworkIsTooSmall(membership_size));
}
if new_membership_info.membership.contains_local() {
return Err(Error::LocalIsCoreNode);
}
debug!(target: LOG_TARGET, "New session received, trying to create a new message handler");
// Update session and core public inputs, preserving the current epoch's