Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions crates/libs/api/src/routes/admin/node_maintenance.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use pplx_space_common_core::sql;

Check warning on line 1 in crates/libs/api/src/routes/admin/node_maintenance.rs

View workflow job for this annotation

GitHub Actions / rust_static / Rust clippy

[archcheck] reported by reviewdog 🐶 crates/libs/api/src/routes/admin/node_maintenance.rs is down to 666 code lines, within the 1,000-line limit. Remove it from architecture-baseline.toml. Raw Output: message:"crates/libs/api/src/routes/admin/node_maintenance.rs is down to 666 code lines, within the 1,000-line limit. Remove it from architecture-baseline.toml." location:{path:"crates/libs/api/src/routes/admin/node_maintenance.rs" range:{start:{line:1}}} severity:WARNING source:{name:"archcheck"} code:{value:"file_size.stale_entries"}
use std::{collections::HashSet, time::Duration};

use axum::{
Expand Down Expand Up @@ -189,9 +189,12 @@
}
}

/// The substrate whose nodes this registry owns. Every registry statement
/// scopes to it, and an update's `verify` reads only a node of it, so the
/// registry never touches a node another substrate manages.
/// The substrate whose nodes this registry owns. Every registry write to
/// `nodes`/`node_direct` binds it, and an update's `verify` proceeds only for
/// a live node of it, so registration never changes a node another substrate
/// manages. Its reads (`fetch_node`, `fetch_nodes`) return nodes of every
/// substrate, and the template pull and delete routes (`node_templates.rs`)
/// act on any node `fetch_node` returns.
const REGISTRY_SUBSTRATE: SubstrateKind = SubstrateKind::Space;

fn require_admin_node_registry(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! The Direct node registry reads and writes only Direct (`'space'`) nodes.
//! The Direct node registry writes, and `verify` proceeds for, only Direct
//! (`'space'`) nodes.
//!
//! Each case pairs a Direct node with an otherwise identical node whose
//! `managed_by` is `'k8s'`. Both keep a `node_direct` row, so only the
Expand Down
6 changes: 3 additions & 3 deletions crates/libs/common/core/src/types/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,9 @@ impl SubstrateKind {
///
/// - Kubernetes: yes. A dormant sandbox (suspended, or created and never
/// started) has no pod until a wake creates one.
/// - Space: no. Direct wakes a dormant sandbox on the access path before
/// connecting (`DirectSubstrate::access_runtime_client` in the api
/// crate), not after a failed control connect.
/// - Space: no. Direct wakes a suspended or restoring sandbox on the
/// access path before connecting (`DirectSubstrate::access_runtime_client`
/// in the api crate), not after a failed control connect.
pub const fn wakes_after_failed_control_connect(self) -> bool {
match self {
Self::Kubernetes => true,
Expand Down
8 changes: 0 additions & 8 deletions docs/rust/space-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,6 @@ sandbox store's public `SandboxRecord.managed_by` and
as text (`proves_no_execution` parses the latter). Convert them when touched;
they are not a pattern to copy.

- A decision about one row's substrate, its sandbox or node `managed_by`,
calls a `SubstrateKind` method named for the question; add one when no
method asks it. Rust that repeats a statement's fixed scope compares
against the named `SubstrateKind` const the statement binds, and mapping a
variant to a value (wire labels, route identity, construction) may match
it. A fact about the running substrate reads the api crate's
`capabilities()` (`SubstrateCapabilities`). Never compare the label string.

- A decision about one row's substrate, its sandbox or node `managed_by`,
calls a `SubstrateKind` method named for the question (for example
`proves_execution_absence` or `restores_through_pods`); add one when no
Expand Down
Loading