Bind cold start to production authorities

This commit is contained in:
ms2k 2026-07-16 18:39:03 +09:00
commit b2f178d25e

View file

@ -282,17 +282,53 @@ where
generation: Generation,
session: Session,
) -> Result<(), LifecycleError<A::Error>> {
self.bootstrap_new_domain_while_owner_live(generation, session, || true)
.map(|_| ())
}
/// Drives cold start while checking the bootstrap owner's exact lifetime authority.
///
/// Returns `false` after applying the modeled bootstrap-owner disconnect transition.
///
/// # Errors
/// Returns the first invalid transition, durable update, or production adapter failure.
pub fn bootstrap_new_domain_while_owner_live(
&mut self,
generation: Generation,
session: Session,
mut owner_live: impl FnMut() -> bool,
) -> Result<bool, LifecycleError<A::Error>> {
let session_id = session.session_id;
self.start_new_domain(generation, session)?;
macro_rules! checkpoint {
() => {
if !owner_live() {
self.disconnect_session(session_id)?;
return Ok(false);
}
};
}
checkpoint!();
self.create_trust_anchor()?;
checkpoint!();
self.start_runtime_supervisor()?;
checkpoint!();
self.lease_prepared_lower()?;
checkpoint!();
self.mount_state_anchor()?;
checkpoint!();
self.start_sidecar()?;
checkpoint!();
self.start_connectivity_helper()?;
checkpoint!();
self.mark_network_ready()?;
checkpoint!();
self.arm_runtime_causal_edge()?;
checkpoint!();
self.start_sandbox()?;
self.publish_domain()
checkpoint!();
self.publish_domain()?;
Ok(true)
}
/// # Errors