diff --git a/Cargo.toml b/Cargo.toml index 0c578c7fb4..d1e0a0bc92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = [ "crates/aggregator", "crates/bfv-client", "crates/bfv-test-support", - "crates/ciphernode-builder", + "crates/ciphernode/builder", "crates/cli", "crates/committee", "crates/committee-hash", @@ -29,7 +29,7 @@ members = [ "crates/keyshare", "crates/layout-lock", "crates/logger", - "crates/multithread", + "crates/ciphernode/multithread", "crates/net", "crates/openvm-host", "crates/openvm-types", @@ -41,7 +41,7 @@ members = [ "crates/request", "crates/safe", "crates/sdk", - "crates/daemon-server", + "crates/ciphernode/daemon-server", "crates/slashing", "crates/sortition", "crates/sync", @@ -93,7 +93,7 @@ e3-committee = { version = "0.20.0-dev.3", path = "./crates/committee" } e3-config = { version = "0.20.0-dev.3", path = "./crates/config" } e3-console = { version = "0.20.0-dev.3", path = "./crates/console" } e3-dashboard = { version = "0.20.0-dev.3", path = "./crates/dashboard" } -e3-ciphernode-builder = { version = "0.20.0-dev.3", path = "./crates/ciphernode-builder" } +e3-ciphernode-builder = { version = "0.20.0-dev.3", path = "./crates/ciphernode/builder" } e3-crypto = { version = "0.20.0-dev.3", path = "./crates/crypto" } e3-data = { version = "0.20.0-dev.3", path = "./crates/data" } e3-data-availability = { version = "0.20.0-dev.3", path = "./crates/data-availability" } @@ -113,7 +113,7 @@ e3-fhe = { version = "0.20.0-dev.3", path = "./crates/fhe" } e3-fhe-params = { version = "0.20.0-dev.3", path = "./crates/fhe-params" } e3-fs = { version = "0.20.0-dev.3", path = "./crates/fs" } e3-indexer = { version = "0.20.0-dev.3", path = "./crates/evm/indexer" } -e3-multithread = { version = "0.20.0-dev.3", path = "./crates/multithread" } +e3-multithread = { version = "0.20.0-dev.3", path = "./crates/ciphernode/multithread" } e3-keyshare = { version = "0.20.0-dev.3", path = "./crates/keyshare" } e3-logger = { version = "0.20.0-dev.3", path = "./crates/logger" } e3-net = { version = "0.20.0-dev.3", path = "./crates/net" } @@ -121,7 +121,7 @@ e3-compute-provider = { version = "0.20.0-dev.3", path = "./crates/compute-provi e3-openvm-host = { version = "0.20.0-dev.3", path = "./crates/openvm-host" } e3-openvm-types = { version = "0.20.0-dev.3", path = "./crates/openvm-types" } e3-sortition = { version = "0.20.0-dev.3", path = "./crates/sortition" } -e3-daemon-server = { version = "0.20.0-dev.3", path = "./crates/daemon-server" } +e3-daemon-server = { version = "0.20.0-dev.3", path = "./crates/ciphernode/daemon-server" } e3-program-runner = { version = "0.20.0-dev.3", path = "./crates/program-runner" } e3-program-server = { version = "0.20.0-dev.3", path = "./crates/program-server" } e3-polynomial = { version = "0.20.0-dev.3", path = "./crates/polynomial" } diff --git a/README.md b/README.md index 20107e98d1..4e8ca36016 100644 --- a/README.md +++ b/README.md @@ -284,6 +284,13 @@ pnpm test:integration --no-prebuild cryptam + + + zerozebrazone +
+ zerozebrazone +
+ diff --git a/crates/Dockerfile b/crates/Dockerfile index 5add3c367e..ddc2b9e541 100644 --- a/crates/Dockerfile +++ b/crates/Dockerfile @@ -49,7 +49,7 @@ COPY crates/aggregator/Cargo.toml ./aggregator/Cargo.toml COPY crates/bfv-client/Cargo.toml ./bfv-client/Cargo.toml COPY crates/bfv-test-support/Cargo.toml ./bfv-test-support/Cargo.toml COPY crates/cli/Cargo.toml ./cli/Cargo.toml -COPY crates/ciphernode-builder/Cargo.toml ./ciphernode-builder/Cargo.toml +COPY crates/ciphernode/builder/Cargo.toml ./ciphernode/builder/Cargo.toml COPY crates/compute-provider/Cargo.toml ./compute-provider/Cargo.toml COPY crates/committee/Cargo.toml ./committee/Cargo.toml COPY crates/committee-hash/Cargo.toml ./committee-hash/Cargo.toml @@ -73,7 +73,7 @@ COPY crates/init/Cargo.toml ./init/Cargo.toml COPY crates/keyshare/Cargo.toml ./keyshare/Cargo.toml COPY crates/layout-lock/Cargo.toml ./layout-lock/Cargo.toml COPY crates/logger/Cargo.toml ./logger/Cargo.toml -COPY crates/multithread/Cargo.toml ./multithread/Cargo.toml +COPY crates/ciphernode/multithread/Cargo.toml ./ciphernode/multithread/Cargo.toml COPY crates/net/Cargo.toml ./net/Cargo.toml COPY crates/openvm-host/Cargo.toml ./openvm-host/Cargo.toml COPY crates/openvm-types/Cargo.toml ./openvm-types/Cargo.toml @@ -89,7 +89,7 @@ COPY crates/sdk/Cargo.toml ./sdk/Cargo.toml COPY crates/slashing/Cargo.toml ./slashing/Cargo.toml COPY crates/sortition/Cargo.toml ./sortition/Cargo.toml COPY crates/dashboard/Cargo.toml ./dashboard/Cargo.toml -COPY crates/daemon-server/Cargo.toml ./daemon-server/Cargo.toml +COPY crates/ciphernode/daemon-server/Cargo.toml ./ciphernode/daemon-server/Cargo.toml COPY crates/sync/Cargo.toml ./sync/Cargo.toml COPY crates/test-support/Cargo.toml ./test-support/Cargo.toml COPY crates/task-pool/Cargo.toml ./task-pool/Cargo.toml diff --git a/crates/README.md b/crates/README.md index c80abd0f6f..9d1b64ac0c 100644 --- a/crates/README.md +++ b/crates/README.md @@ -33,22 +33,22 @@ modes. Each generated project's separate `runner/` binary links its own program library; the CLI owns compile/start orchestration. CPU admission/cancellation primitives live in [e3-task-pool](task-pool/README.md). The ciphernode -[compute dispatcher](multithread/README.md) owns replay/retry policy and prover-memory sizing rather -than making those policies part of the executor. +[compute dispatcher](ciphernode/multithread/README.md) owns replay/retry policy and prover-memory +sizing rather than making those policies part of the executor. ## Find a component | Capability | Entry points | | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Operator commands and assembly | [CLI](cli/README.md), [entrypoint](entrypoint/README.md), [ciphernode builder](ciphernode-builder/README.md), [configuration](config/README.md) | +| Operator commands and assembly | [CLI](cli/README.md), [entrypoint](entrypoint/README.md), [ciphernode composition and services](ciphernode/README.md) | | Events and state | [event types/pipeline](events/README.md), [runtime assembly](event-system/README.md), [storage](data/README.md), [sync/replay](sync/README.md), [request routing](request/README.md) | | Participation and key lifecycle | [sortition](sortition/Readme.md), [keyshare](keyshare/README.md), [aggregation](aggregator/README.md), [slashing](slashing/README.md) | -| Runtime adapters | [EVM](evm/README.md), [network](net/README.md), [shared compute workers](multithread/README.md), [task admission](task-pool/README.md), [FHE](fhe/README.md), [local crypto](crypto/README.md) | +| Runtime adapters | [EVM](evm/README.md), [network](net/README.md), [shared compute workers](ciphernode/multithread/README.md), [task admission](task-pool/README.md), [FHE](fhe/README.md), [local crypto](crypto/README.md) | | Application computation | [Secure Process/provider](compute-provider/Readme.md), [OpenVM host](openvm-host/README.md), [guest/journal types](openvm-types/README.md), [program HTTP server](program-server/README.md), [DA clients](data-availability/README.md) | | Client libraries | [Rust SDK](sdk/README.md), [BFV client](bfv-client/README.md), [WASM](wasm/README.md), [EVM client](evm/client/README.md), [indexer](evm/indexer/README.md) | | Parameters, math, and proofs | [committee](committee/README.md), [committee hashes](committee-hash/README.md), [FHE presets](fhe-params/README.md), [TrBFV](trbfv/README.md), [SAFE](safe/README.md), [polynomials](polynomial/README.md), [parity matrices](parity-matrix/README.md), [ZK config](zk/config/README.md), [witnesses](zk/witness/README.md), [prover](zk/prover/README.md) | | Project tooling and utilities | [initializer](init/README.md), [program runner](program-runner/README.md), [circuit builder](zk/build/README.md), [benchmarks](zk/benchmarks/README.md), [samples](zk/samples/README.md), [VFS](fs/README.md), [utilities](utils/README.md), [byte derive](utils-derive/README.md), [immutable map](hamt/README.md) | -| Diagnostics and tests | [logger](logger/README.md), [console](console/README.md), [local daemon](daemon-server/README.md), [dashboard](dashboard/README.md), [mechanical test support](test-support/README.md), [BFV ballots](bfv-test-support/README.md), [system tests](tests/README.md), [layout locks](layout-lock/README.md) | +| Diagnostics and tests | [logger](logger/README.md), [console](console/README.md), [local daemon](ciphernode/daemon-server/README.md), [dashboard](dashboard/README.md), [mechanical test support](test-support/README.md), [BFV ballots](bfv-test-support/README.md), [system tests](tests/README.md), [layout locks](layout-lock/README.md) | For current public flows, see [committee selection](../docs/architecture/committee-selection.md), [DKG](../docs/architecture/dkg.md), and diff --git a/crates/aggregator/README.md b/crates/aggregator/README.md index bb43d1f464..a7edb5a87a 100644 --- a/crates/aggregator/README.md +++ b/crates/aggregator/README.md @@ -29,7 +29,7 @@ Use the extensions in `e3_aggregator::ext` with an `e3_request::E3RouterBuilder` - `ThresholdPlaintextAggregatorExtension::create(...)` creates or hydrates `plaintext`, using the bus, sortition actor, proof-aggregation setting, canonical keys, and sequence-history reader. -The [ciphernode wiring](../ciphernode-builder/src/builder/extensions.rs) shows registration through +The [ciphernode wiring](../ciphernode/builder/src/extensions.rs) shows registration through `with_recipient`, including the FHE dependency. Consumers do not construct the private public-key/plaintext actor modules directly. Committee formation is owned by [sortition](../sortition/Readme.md#runtime-integration), not aggregation. Canonical-key inputs come @@ -42,7 +42,7 @@ intents; confirmed contract events establish canonical completion. ## Using the capability -For a complete runtime use [CiphernodeBuilder](../ciphernode-builder/README.md). The crate also +For a complete runtime use [CiphernodeBuilder](../ciphernode/builder/README.md). The crate also exports typed recovery states and repository factory traits for persistence integration. See [DKG](../../docs/architecture/dkg.md) and [threshold decryption](../../docs/architecture/threshold-decryption.md) for protocol boundaries. diff --git a/crates/ciphernode-builder/src/lib.rs b/crates/ciphernode-builder/src/lib.rs deleted file mode 100644 index 442a4500a9..0000000000 --- a/crates/ciphernode-builder/src/lib.rs +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-only -// -// This file is provided WITHOUT ANY WARRANTY; -// without even the implied warranty of MERCHANTABILITY -// or FITNESS FOR A PARTICULAR PURPOSE. - -mod builder; -mod ciphernode; -mod finalized_lifecycle; -mod recovery; -pub use builder::CiphernodeBuilder; -pub use ciphernode::*; diff --git a/crates/ciphernode/README.md b/crates/ciphernode/README.md new file mode 100644 index 0000000000..15983e5247 --- /dev/null +++ b/crates/ciphernode/README.md @@ -0,0 +1,22 @@ +# Ciphernode composition and services + +Ciphernode composition, compute dispatch, and local command transport share this family because they +assemble and operate a ciphernode. Each remains an independently importable package in the root +Cargo workspace; this directory is not a package or nested workspace. + +- [builder](builder/README.md) composes full/bootstrap nodes and recovery. +- [daemon-server](daemon-server/README.md) provides loopback CLI control transport. +- [multithread](multithread/README.md) coordinates node compute admission and replay/retry policy. + +The [configuration](../config/README.md), [CLI](../cli/README.md), CLI-owned +[initializer](../init/README.md), and process-fenced [entrypoint](../entrypoint/README.md) currently +remain at their flat locations. Generic [task-pool](../task-pool/README.md), +[console](../console/README.md), and [filesystem](../fs/README.md) capabilities remain separate +roots rather than becoming node-specific utilities. + +Checkout-relative paths for this family's members now start with `crates/ciphernode/`; Cargo package +selection and downstream Git dependency names are unchanged. Use the +[workspace setup](../README.md#setup-and-checks) and each member's checks. Startup ordering and +dispatch recovery remain governed by +[persistence and replay](../../docs/architecture/persistence-and-replay.md); +[upgrades](../../docs/architecture/upgrades.md) owns compatibility and rollback decisions. diff --git a/crates/ciphernode-builder/AGENTS.md b/crates/ciphernode/builder/AGENTS.md similarity index 72% rename from crates/ciphernode-builder/AGENTS.md rename to crates/ciphernode/builder/AGENTS.md index 7caeea4b2f..8b761e0fc9 100644 --- a/crates/ciphernode-builder/AGENTS.md +++ b/crates/ciphernode/builder/AGENTS.md @@ -2,8 +2,8 @@ See [README.md](README.md) for profiles, configuration, and handle lifecycle. This is the ciphernode composition root. Protocol decisions belong to their capability crates; attach them here without -copying their rules. `builder/startup.rs` documents the dependency order of Storage → Restart → Live -→ Protocol; preserve the prerequisites, not just the current line order. +copying their rules. `src/startup.rs` documents the dependency order of Storage → Restart → Live → +Protocol; preserve the prerequisites, not just the current line order. - Keep the full/bootstrap profiles closed: bootstrap has only the Interfold reader and no protocol extensions/writers or compute scheduler. Do not expose independent component switches that bypass @@ -20,7 +20,8 @@ copying their rules. `builder/startup.rs` documents the dependency order of Stor - Do not make shared test support depend on this crate: lower-level tests would pull the complete stack and can cycle through event-system. Multi-node composition belongs in `crates/tests`. -[Persistence](../../docs/architecture/persistence-and-replay.md) owns startup and failure-signal -semantics; [slashing](../../docs/architecture/slashing.md) owns chain-specific manager resolution. -Use the [README test commands and prerequisites](README.md#tests). Recovery and profile changes need -the affected multi-node scenarios; in-memory construction alone is not restart coverage. +[Persistence](../../../docs/architecture/persistence-and-replay.md) owns startup and failure-signal +semantics; [slashing](../../../docs/architecture/slashing.md) owns chain-specific manager +resolution. Use the [README test commands and prerequisites](README.md#tests). Recovery and profile +changes need the affected multi-node scenarios; in-memory construction alone is not restart +coverage. diff --git a/crates/ciphernode-builder/Cargo.toml b/crates/ciphernode/builder/Cargo.toml similarity index 100% rename from crates/ciphernode-builder/Cargo.toml rename to crates/ciphernode/builder/Cargo.toml diff --git a/crates/ciphernode-builder/README.md b/crates/ciphernode/builder/README.md similarity index 54% rename from crates/ciphernode-builder/README.md rename to crates/ciphernode/builder/README.md index 0924709261..6f5124c8f6 100644 --- a/crates/ciphernode-builder/README.md +++ b/crates/ciphernode/builder/README.md @@ -4,34 +4,35 @@ Library composition root for a ciphernode: it connects storage, chain adapters, networking, request routing, and protocol capabilities. It is not an executable; normal operators use the -[CLI](../cli/README.md), whose [entrypoint](../entrypoint/README.md) also owns process fencing. +[CLI](../../cli/README.md), whose [entrypoint](../../entrypoint/README.md) also owns process +fencing. Production startup and the in-process test harness use the same builder. It returns a `CiphernodeHandle` once the node has completed startup recovery and reached live-source readiness. ## Map -| Module | Responsibility | -| ---------------------------------------------------------------- | ------------------------------------------------------------------------------ | -| [`builder/mod.rs`](src/builder/mod.rs) | Public builder, options, defaults, and full/bootstrap profiles. | -| [`builder/startup.rs`](src/builder/startup.rs) | Startup phases and their `Storage`, `Restart`, `Live`, and `Protocol` outputs. | -| [`builder/evm.rs`](src/builder/evm.rs) | Contract readers and writers for enabled chains. | -| [`builder/chain_parameters.rs`](src/builder/chain_parameters.rs) | Chain-derived DKG fold contexts and accusation vote validity. | -| [`builder/extensions.rs`](src/builder/extensions.rs) | Request routing, proof recovery, and full-node protocol extensions. | -| [`builder/sortition.rs`](src/builder/sortition.rs) | Sortition and ciphernode-selector assembly from restored state. | -| [`builder/net.rs`](src/builder/net.rs) | Network policy, libp2p/channel transport, and startup buffering. | -| [`builder/restart.rs`](src/builder/restart.rs) | Restart decisions derived from local lifecycle stages. | -| [`recovery.rs`](src/recovery.rs) | Restart-state backfill and committee snapshot reconciliation. | -| [`finalized_lifecycle.rs`](src/finalized_lifecycle.rs) | Reconciliation with finalized chain lifecycle. | -| [`ciphernode.rs`](src/ciphernode.rs) | Running node handle, health signals, and shutdown. | +| Module | Responsibility | +| ------------------------------------------------------ | ------------------------------------------------------------------------------ | +| [`lib.rs`](src/lib.rs) | Public builder, options, defaults, and full/bootstrap profiles. | +| [`startup.rs`](src/startup.rs) | Startup phases and their `Storage`, `Restart`, `Live`, and `Protocol` outputs. | +| [`evm.rs`](src/evm.rs) | Contract readers and writers for enabled chains. | +| [`chain_parameters.rs`](src/chain_parameters.rs) | Chain-derived DKG fold contexts and accusation vote validity. | +| [`extensions.rs`](src/extensions.rs) | Request routing, proof recovery, and full-node protocol extensions. | +| [`sortition.rs`](src/sortition.rs) | Sortition and ciphernode-selector assembly from restored state. | +| [`net.rs`](src/net.rs) | Network policy, libp2p/channel transport, and startup buffering. | +| [`restart.rs`](src/restart.rs) | Restart decisions derived from local lifecycle stages. | +| [`recovery.rs`](src/recovery.rs) | Restart-state backfill and committee snapshot reconciliation. | +| [`finalized_lifecycle.rs`](src/finalized_lifecycle.rs) | Reconciliation with finalized chain lifecycle. | +| [`ciphernode.rs`](src/ciphernode.rs) | Running node handle, health signals, and shutdown. | ## Startup lifecycle `build_inner` assembles the node in phases: storage admission and restart recovery, the live event pipeline, protocol infrastructure, EVM adapters, extensions, networking, and synchronization. The phase outputs carry the resources needed by subsequent steps. The module documentation in -[`startup.rs`](src/builder/startup.rs) explains the sequence; the -[persistence contract](../../docs/architecture/persistence-and-replay.md) describes replay and +[`startup.rs`](src/startup.rs) explains the sequence; the +[persistence contract](../../../docs/architecture/persistence-and-replay.md) describes replay and failure boundaries across crates. ## Choose a node profile @@ -55,8 +56,8 @@ Persisted directories are role-stamped: full and bootstrap nodes cannot reuse ea ## Configure and start -The production recipe is [entrypoint startup](../entrypoint/src/start/start.rs): seed a `SharedRng`, -load the password-backed `Cipher`, choose a profile, then configure: +The production recipe is [entrypoint startup](../../entrypoint/src/start/start.rs): seed a +`SharedRng`, load the password-backed `Cipher`, choose a profile, then configure: - `with_chains(&[ChainConfig])` and `with_network(profile, peers, quic_port)`; - `with_persistence(&log_path, &kv_path)` (otherwise storage is in memory); @@ -67,7 +68,7 @@ load the password-backed `Cipher`, choose a profile, then configure: readiness before returning. Run it inside an Actix runtime; its actor setup uses local tasks, so do not move the startup future to an arbitrary `tokio::spawn` worker. Enabled chains need reachable RPC endpoints and deployed contracts. Full nodes also need matching -[Noir/Barretenberg artifacts](../zk/prover/README.md); preparation may install artifacts. The +[Noir/Barretenberg artifacts](../../zk/prover/README.md); preparation may install artifacts. The entrypoint applies a configured startup deadline around `build()`. ## Handle and shutdown @@ -83,8 +84,8 @@ bootstrap does not resolve managers or sign accusation votes. Consume the handle with `shutdown(deadline).await`: it acknowledges shutdown handlers, flushes the event pipeline, then drains snapshots and closes storage within the supplied deadline. See -[persistence and replay](../../docs/architecture/persistence-and-replay.md) for guarantees and -recovery limits, and [e3-tests](../tests/README.md) for in-process multi-node usage. +[persistence and replay](../../../docs/architecture/persistence-and-replay.md) for guarantees and +recovery limits, and [e3-tests](../../tests/README.md) for in-process multi-node usage. ## Tests @@ -96,16 +97,16 @@ cargo test --locked -p e3-ciphernode-builder This runs the crate's startup, profile, recovery, and handle tests. The finalized-lifecycle tests start Anvil, so Foundry is required. Prepare the -[system test prerequisites](../tests/README.md#prerequisites-and-assurance) first; the dependency +[system test prerequisites](../../tests/README.md#prerequisites-and-assurance) first; the dependency graph includes Solidity fixtures and build-time Noir preparation. -Multi-node scenarios live in [e3-tests](../tests/README.md), which also uses this builder. List its -scenarios with `cargo test --locked -p e3-tests --test integration -- --list`, then select the +Multi-node scenarios live in [e3-tests](../../tests/README.md), which also uses this builder. List +its scenarios with `cargo test --locked -p e3-tests --test integration -- --list`, then select the scenario to run. In-memory startup tests and persisted restart scenarios exercise different paths. ## Related documentation -- [Entrypoint](../entrypoint/README.md): production startup and process management. -- [Event system](../event-system/README.md): lower-level event runtime assembly. -- [Slashing](../../docs/architecture/slashing.md): chain-specific manager resolution. +- [Entrypoint](../../entrypoint/README.md): production startup and process management. +- [Event system](../../event-system/README.md): lower-level event runtime assembly. +- [Slashing](../../../docs/architecture/slashing.md): chain-specific manager resolution. - [AGENTS.md](AGENTS.md): conventions and constraints for changing this crate. diff --git a/crates/ciphernode-builder/src/builder/chain_parameters.rs b/crates/ciphernode/builder/src/chain_parameters.rs similarity index 100% rename from crates/ciphernode-builder/src/builder/chain_parameters.rs rename to crates/ciphernode/builder/src/chain_parameters.rs diff --git a/crates/ciphernode-builder/src/ciphernode.rs b/crates/ciphernode/builder/src/ciphernode.rs similarity index 100% rename from crates/ciphernode-builder/src/ciphernode.rs rename to crates/ciphernode/builder/src/ciphernode.rs diff --git a/crates/ciphernode-builder/src/builder/evm.rs b/crates/ciphernode/builder/src/evm.rs similarity index 100% rename from crates/ciphernode-builder/src/builder/evm.rs rename to crates/ciphernode/builder/src/evm.rs diff --git a/crates/ciphernode-builder/src/builder/extensions.rs b/crates/ciphernode/builder/src/extensions.rs similarity index 100% rename from crates/ciphernode-builder/src/builder/extensions.rs rename to crates/ciphernode/builder/src/extensions.rs diff --git a/crates/ciphernode-builder/src/finalized_lifecycle.rs b/crates/ciphernode/builder/src/finalized_lifecycle.rs similarity index 100% rename from crates/ciphernode-builder/src/finalized_lifecycle.rs rename to crates/ciphernode/builder/src/finalized_lifecycle.rs diff --git a/crates/ciphernode-builder/src/builder/mod.rs b/crates/ciphernode/builder/src/lib.rs similarity index 99% rename from crates/ciphernode-builder/src/builder/mod.rs rename to crates/ciphernode/builder/src/lib.rs index d9808eb59f..7494104cf2 100644 --- a/crates/ciphernode-builder/src/builder/mod.rs +++ b/crates/ciphernode/builder/src/lib.rs @@ -8,13 +8,18 @@ //! the startup steps that [`CiphernodeBuilder::build`] orders. mod chain_parameters; +mod ciphernode; mod evm; mod extensions; +mod finalized_lifecycle; mod net; +mod recovery; mod restart; mod sortition; mod startup; +pub use ciphernode::*; + use actix::Addr; use derivative::Derivative; use e3_config::{chain_config::ChainConfig, NetworkProfile}; diff --git a/crates/ciphernode-builder/src/builder/net.rs b/crates/ciphernode/builder/src/net.rs similarity index 100% rename from crates/ciphernode-builder/src/builder/net.rs rename to crates/ciphernode/builder/src/net.rs diff --git a/crates/ciphernode-builder/src/recovery.rs b/crates/ciphernode/builder/src/recovery.rs similarity index 100% rename from crates/ciphernode-builder/src/recovery.rs rename to crates/ciphernode/builder/src/recovery.rs diff --git a/crates/ciphernode-builder/src/builder/restart.rs b/crates/ciphernode/builder/src/restart.rs similarity index 100% rename from crates/ciphernode-builder/src/builder/restart.rs rename to crates/ciphernode/builder/src/restart.rs diff --git a/crates/ciphernode-builder/src/builder/sortition.rs b/crates/ciphernode/builder/src/sortition.rs similarity index 100% rename from crates/ciphernode-builder/src/builder/sortition.rs rename to crates/ciphernode/builder/src/sortition.rs diff --git a/crates/ciphernode-builder/src/builder/startup.rs b/crates/ciphernode/builder/src/startup.rs similarity index 100% rename from crates/ciphernode-builder/src/builder/startup.rs rename to crates/ciphernode/builder/src/startup.rs diff --git a/crates/daemon-server/AGENTS.md b/crates/ciphernode/daemon-server/AGENTS.md similarity index 100% rename from crates/daemon-server/AGENTS.md rename to crates/ciphernode/daemon-server/AGENTS.md diff --git a/crates/daemon-server/Cargo.toml b/crates/ciphernode/daemon-server/Cargo.toml similarity index 100% rename from crates/daemon-server/Cargo.toml rename to crates/ciphernode/daemon-server/Cargo.toml diff --git a/crates/daemon-server/README.md b/crates/ciphernode/daemon-server/README.md similarity index 79% rename from crates/daemon-server/README.md rename to crates/ciphernode/daemon-server/README.md index 9227a1e6a5..704f7fdf40 100644 --- a/crates/daemon-server/README.md +++ b/crates/ciphernode/daemon-server/README.md @@ -23,8 +23,8 @@ CLI, not this transport. The server accepts non-Send handlers and uses `spawn_local`: run it inside an Actix/local-task context, not an ordinary multi-thread Tokio task alone. The CLI's -[socket setup](../cli/src/start.rs) demonstrates the complete local command handler; allowed remote -command conversions are in [cli.rs](../cli/src/cli.rs). +[socket setup](../../cli/src/start.rs) demonstrates the complete local command handler; allowed +remote command conversions are in [cli.rs](../../cli/src/cli.rs). ## Transport limits @@ -32,11 +32,11 @@ There is no authentication or TLS. Keep the control socket local. Its manual HTT content-length framing, not arbitrary chunked requests, and is not a general-purpose HTTP server with framework body/time limits. Handler errors become HTTP 500 responses. -Use [program-server](../program-server/README.md) for the separate computation-job HTTP API. +Use [program-server](../../program-server/README.md) for the separate computation-job HTTP API. ## Tests `cargo check --locked -p e3-daemon-server --tests` checks its callback/transport types without a live node. There are currently no dedicated crate test functions. The -[CLI startup handler](../cli/src/start.rs) is the integration point for exercising allowed commands -and output forwarding. See [AGENTS.md](AGENTS.md) for transport-change constraints. +[CLI startup handler](../../cli/src/start.rs) is the integration point for exercising allowed +commands and output forwarding. See [AGENTS.md](AGENTS.md) for transport-change constraints. diff --git a/crates/daemon-server/src/lib.rs b/crates/ciphernode/daemon-server/src/lib.rs similarity index 100% rename from crates/daemon-server/src/lib.rs rename to crates/ciphernode/daemon-server/src/lib.rs diff --git a/crates/multithread/AGENTS.md b/crates/ciphernode/multithread/AGENTS.md similarity index 73% rename from crates/multithread/AGENTS.md rename to crates/ciphernode/multithread/AGENTS.md index 435440ff45..7f5bc04350 100644 --- a/crates/multithread/AGENTS.md +++ b/crates/ciphernode/multithread/AGENTS.md @@ -14,7 +14,7 @@ semaphore. - A missing-outcome redelivery waits until no matching job remains queued/running. Memory-only gate buffers are not a transactional outbox or a complete exactly-once guarantee. -[Persistence](../../docs/architecture/persistence-and-replay.md#effect-recovery-and-shutdown) owns -budgets/retries and current limits. Use the [README tests/prerequisites](README.md#tests). Gate and -retry changes need replay/redrive/cancellation histories; fake outcomes do not measure production -prover memory or verify cryptographic correctness. +[Persistence](../../../docs/architecture/persistence-and-replay.md#effect-recovery-and-shutdown) +owns budgets/retries and current limits. Use the [README tests/prerequisites](README.md#tests). Gate +and retry changes need replay/redrive/cancellation histories; fake outcomes do not measure +production prover memory or verify cryptographic correctness. diff --git a/crates/multithread/Cargo.toml b/crates/ciphernode/multithread/Cargo.toml similarity index 100% rename from crates/multithread/Cargo.toml rename to crates/ciphernode/multithread/Cargo.toml diff --git a/crates/multithread/README.md b/crates/ciphernode/multithread/README.md similarity index 65% rename from crates/multithread/README.md rename to crates/ciphernode/multithread/README.md index 093ad4026b..4d7eecc9e4 100644 --- a/crates/multithread/README.md +++ b/crates/ciphernode/multithread/README.md @@ -3,18 +3,18 @@ ## Purpose Ciphernode compute dispatch for ZK and threshold-BFV work, using shared admission from -[e3-task-pool](../task-pool/README.md). It keeps expensive jobs off actor mailboxes and coordinates -replay-safe effects; protocol validity remains with the requesting capabilities. +[e3-task-pool](../../task-pool/README.md). It keeps expensive jobs off actor mailboxes and +coordinates replay-safe effects; protocol validity remains with the requesting capabilities. ## Map -| Location | Responsibility | -| -------------------------------------- | -------------------------------------------------------------------------------- | -| [e3-task-pool](../task-pool/README.md) | Semaphore admission, Rayon execution, cancellation groups, and task results. | -| [`memory.rs`](src/memory.rs) | CPU/requested-job and host/cgroup-memory capacity calculation. | -| [`effect_gate.rs`](src/effect_gate.rs) | Current-boot dispatch gating, duplicate/redrive matching, and retained outcomes. | -| [`multithread.rs`](src/multithread.rs) | Bus-facing ZK/TrBFV dispatch, retries, request teardown, and result publication. | -| [`report.rs`](src/report.rs) | Timing/capacity report actor and flattened diagnostics. | +| Location | Responsibility | +| ----------------------------------------- | -------------------------------------------------------------------------------- | +| [e3-task-pool](../../task-pool/README.md) | Semaphore admission, Rayon execution, cancellation groups, and task results. | +| [`memory.rs`](src/memory.rs) | CPU/requested-job and host/cgroup-memory capacity calculation. | +| [`effect_gate.rs`](src/effect_gate.rs) | Current-boot dispatch gating, duplicate/redrive matching, and retained outcomes. | +| [`multithread.rs`](src/multithread.rs) | Bus-facing ZK/TrBFV dispatch, retries, request teardown, and result publication. | +| [`report.rs`](src/report.rs) | Timing/capacity report actor and flattened diagnostics. | The dispatcher admits an event through the effect gate, queues its work in the shared pool, executes off the actor thread, and publishes a correlated result. Effect readiness and request termination @@ -40,14 +40,14 @@ outcomes. Cancellation retires pending C0 verification without retry or invalid- Selected compute-owner dependencies (Cargo manifests contain the full graph): ```text -ciphernode-builder -> multithread, zk/prover, task-pool -multithread -> task-pool, zk/prover, trbfv -zk/prover -> task-pool, zk/witness, zk/config, trbfv -task-pool -> Rayon, Tokio (no protocol dependencies) +builder -> multithread, zk/prover, task-pool +multithread -> task-pool, zk/prover, trbfv +zk/prover -> task-pool, zk/witness, zk/config, trbfv +task-pool -> Rayon, Tokio (no protocol dependencies) ``` Circuit-request adaptation and ZK execution belong to -[`zk/prover`](../zk/prover/src/request_execution.rs); deterministic preparation remains in +[`zk/prover`](../../zk/prover/src/request_execution.rs); deterministic preparation remains in `zk/witness`. This dispatcher owns admission, replay gates, retry policy, correlation, timing publication and terminal filtering. Native request execution, RNG access and typed calculation failures belong to `trbfv`. The dispatcher only wraps native results with their E3/correlation @@ -60,7 +60,7 @@ pool and node scope, so direct Rust callers must supply them when constructing t protocol/schema or node-generation counter change is proposed for this ownership split. For production sizing, `ComputeCapacity::detect(requested_jobs, cpu_jobs)` applies CPU and detected -host/cgroup-memory limits. [CiphernodeBuilder](../ciphernode-builder/README.md) exposes +host/cgroup-memory limits. [CiphernodeBuilder](../builder/README.md) exposes `with_multithread_config` and optional shared task pools/reports. ZK and TrBFV work share admission instead of each using unrelated pool capacity. @@ -68,9 +68,8 @@ instead of each using unrelated pool capacity. `Multithread::attach` installs threshold-BFV dispatch. `attach_with_zk` additionally supplies the prover backend, restored lifecycle stages, and canonical keys. Both need the bus, RNG, local cipher, -task pool, and node-specific task scope; see the -[builder caller](../ciphernode-builder/src/builder/extensions.rs) for the complete wiring. These are -node-wide workers, not per-E3 router extensions. +task pool, and node-specific task scope; see the [builder caller](../builder/src/extensions.rs) for +the complete wiring. These are node-wide workers, not per-E3 router extensions. Dispatch correlates jobs with their request/E3 and gates recovery on current-boot effect readiness. Queued cancellation does not stop an executing closure. Prover process deadlines are separate, and @@ -78,13 +77,13 @@ local resource failure is not proof that a peer supplied invalid crypto. `Multit `ToReport` expose timing and capacity diagnostics, not proof validity. See -[effect recovery](../../docs/architecture/persistence-and-replay.md#effect-recovery-and-shutdown) +[effect recovery](../../../docs/architecture/persistence-and-replay.md#effect-recovery-and-shutdown) for admission/retry limits. ## Tests `cargo test --locked -p e3-multithread` transitively builds the prover; read its -[build prerequisites and side effects](../zk/prover/README.md) first. +[build prerequisites and side effects](../../zk/prover/README.md) first. Inline suites distinguish deterministic capacity calculations, effect-gate replay/redelivery, and bus dispatch/retry/teardown. Pool cancellation/panic tests live in `e3-task-pool`. Fake outcomes diff --git a/crates/multithread/src/effect_gate.rs b/crates/ciphernode/multithread/src/effect_gate.rs similarity index 100% rename from crates/multithread/src/effect_gate.rs rename to crates/ciphernode/multithread/src/effect_gate.rs diff --git a/crates/multithread/src/lib.rs b/crates/ciphernode/multithread/src/lib.rs similarity index 100% rename from crates/multithread/src/lib.rs rename to crates/ciphernode/multithread/src/lib.rs diff --git a/crates/multithread/src/memory.rs b/crates/ciphernode/multithread/src/memory.rs similarity index 100% rename from crates/multithread/src/memory.rs rename to crates/ciphernode/multithread/src/memory.rs diff --git a/crates/multithread/src/multithread.rs b/crates/ciphernode/multithread/src/multithread.rs similarity index 100% rename from crates/multithread/src/multithread.rs rename to crates/ciphernode/multithread/src/multithread.rs diff --git a/crates/multithread/src/report.rs b/crates/ciphernode/multithread/src/report.rs similarity index 100% rename from crates/multithread/src/report.rs rename to crates/ciphernode/multithread/src/report.rs diff --git a/crates/cli/README.md b/crates/cli/README.md index b988660dfb..38910df960 100644 --- a/crates/cli/README.md +++ b/crates/cli/README.md @@ -6,7 +6,7 @@ The `interfold` executable manages ciphernode operation and application projects configuration/identity, full/bootstrap startup, multi-node processes, offline state checks, Noir artifacts, binary updates/removal, and program compilation/services. It delegates node lifecycle to [e3-entrypoint](../entrypoint/README.md) and composition to -[e3-ciphernode-builder](../ciphernode-builder/README.md). +[e3-ciphernode-builder](../ciphernode/builder/README.md). ## Map diff --git a/crates/console/README.md b/crates/console/README.md index 9956baa3e5..1a0e95f57d 100644 --- a/crates/console/README.md +++ b/crates/console/README.md @@ -37,6 +37,6 @@ unbounded: this is not acknowledged delivery or a backpressure mechanism. `cargo check --locked -p e3-console --tests` checks the crate and test-target compilation without external services; it currently has no dedicated test functions. The channel example above is a -capture pattern for command tests. The [daemon](../daemon-server/README.md) and +capture pattern for command tests. The [daemon](../ciphernode/daemon-server/README.md) and [CLI](../cli/README.md) are concrete consumers. See [AGENTS.md](AGENTS.md) for framing and drain constraints. diff --git a/crates/event-system/README.md b/crates/event-system/README.md index 6b11976647..3e31ccf496 100644 --- a/crates/event-system/README.md +++ b/crates/event-system/README.md @@ -64,7 +64,7 @@ Both in-memory and persisted assembly connect the aggregate router to that same event with no configured store therefore reports fatal storage failure without a panic or dispatch to another aggregate. The CLI or library caller must monitor the watch to stop its process. -For production lifecycle/replay use [CiphernodeBuilder](../ciphernode-builder/README.md) and the +For production lifecycle/replay use [CiphernodeBuilder](../ciphernode/builder/README.md) and the [persistence contract](../../docs/architecture/persistence-and-replay.md). ## Tests diff --git a/crates/events/README.md b/crates/events/README.md index 7fd2e8c60b..dd8f08f7ca 100644 --- a/crates/events/README.md +++ b/crates/events/README.md @@ -46,7 +46,7 @@ re-exported here because slashing already depends on events. ## Runtime use Most consumers obtain an enabled `BusHandle` from [EventSystem](../event-system/README.md) or -[CiphernodeBuilder](../ciphernode-builder/README.md), not by manually wiring the actors: +[CiphernodeBuilder](../ciphernode/builder/README.md), not by manually wiring the actors: - `subscribe(EventType, recipient)` delivers matching sequenced events to Actix recipients. - `publish(data, context)` preserves causation; `publish_without_context(data)` creates an origin. diff --git a/crates/evm/runtime/README.md b/crates/evm/runtime/README.md index 9305a30bb2..c710955d45 100644 --- a/crates/evm/runtime/README.md +++ b/crates/evm/runtime/README.md @@ -35,8 +35,8 @@ produces `ProviderCache` for signer-backed effects. `EvmSystemChainBuilder::new(bus, provider)` attaches contract-address routes and builds an `EvmChainGatewayHandle`. Configure log windows, startup buffer limits, provider factories, and optional ingestion progress before building. The composition root's -[EVM wiring](../../ciphernode-builder/src/builder/evm.rs) is the complete reader/writer recipe; -operators should normally use [CiphernodeBuilder](../../ciphernode-builder/README.md). +[EVM wiring](../../ciphernode/builder/src/evm.rs) is the complete reader/writer recipe; operators +should normally use [CiphernodeBuilder](../../ciphernode/builder/README.md). Subscriptions wake canonical backfill; they do not themselves prove complete ingestion. Configured confirmation depth applies independently of whether the RPC URL is loopback. Gateway diff --git a/crates/fhe/README.md b/crates/fhe/README.md index 8ee8f46b1d..2666b4408e 100644 --- a/crates/fhe/README.md +++ b/crates/fhe/README.md @@ -40,8 +40,8 @@ coefficients and must remain behind encrypted-storage/caller boundaries. Register `ext::FheExtension::create(bus, rng)` on `E3RouterBuilder`. On `E3Requested` it stores the request's FHE snapshot and injects `Arc` at `ext::FHE_KEY`; it does not register an event-recipient actor. Hydration restores parameters/CRP and injects the supplied RNG separately. -The [builder caller](../ciphernode-builder/src/builder/extensions.rs) installs it alongside -aggregation extensions. `FheRepositoryFactory` supplies typed snapshot storage. +The [builder caller](../ciphernode/builder/src/extensions.rs) installs it alongside aggregation +extensions. `FheRepositoryFactory` supplies typed snapshot storage. ## Tests diff --git a/crates/keyshare/README.md b/crates/keyshare/README.md index 795267a5fe..eb07ffca67 100644 --- a/crates/keyshare/README.md +++ b/crates/keyshare/README.md @@ -35,7 +35,7 @@ record keys/shares without starting collectors or timers until `EffectsEnabled` The constructor takes the bus, local encryption `Cipher`, operator address, per-chain Interfold addresses, `DkgTimingReader`, signer, and shared `canonical_key::CanonicalPublicKeys`. The timing reader returns the request's canonical deadline/window; metadata comes from the router context. See -the [production wiring](../ciphernode-builder/src/builder/extensions.rs) for dependencies and +the [production wiring](../ciphernode/builder/src/extensions.rs) for dependencies and named-recipient registration rather than reproducing a runtime fixture. The crate exports actor construction parameters, recovery payload/state types, and diff --git a/crates/net/README.md b/crates/net/README.md index e2435416f0..494b0f5fa0 100644 --- a/crates/net/README.md +++ b/crates/net/README.md @@ -34,9 +34,9 @@ rules. `local_unrestricted()` is an explicit local/test policy, not a public-net `setup_net` connects a `NetInterface` to the event bus and timestamp-history reader. The `setup_net_with_limits` / `setup_net_with_limits_and_interests` variants configure startup buffering and participation-aware document fetching. See -[builder network startup](../ciphernode-builder/src/builder/net.rs) for the complete recipe, -including readiness and the transport task. Normal node users use -[CiphernodeBuilder](../ciphernode-builder/README.md). +[builder network startup](../ciphernode/builder/src/net.rs) for the complete recipe, including +readiness and the transport task. Normal node users use +[CiphernodeBuilder](../ciphernode/builder/README.md). For an in-process harness, `create_channel_bridge()` returns a `NetInterfaceHandle` and inverted `NetChannelBridge`; the [system harness](../tests/tests/ciphernode_system) keeps its mock network diff --git a/crates/request/README.md b/crates/request/README.md index 0ea2249653..b42b1914c7 100644 --- a/crates/request/README.md +++ b/crates/request/README.md @@ -29,8 +29,8 @@ recipient's cryptographic state machine. `E3RouterBuilder::with(extension)` or `with_recipient("recipient_name", extension)`, then await `build()` to hydrate and attach. Named recipients let the router defer relevant history until the extension creates its actor. Use the -[ciphernode extension wiring](../ciphernode-builder/src/builder/extensions.rs) for a complete -composition, including restored selections and terminal-state gates. +[ciphernode extension wiring](../ciphernode/builder/src/extensions.rs) for a complete composition, +including restored selections and terminal-state gates. `E3Extension` implements synchronous `on_event(context, event)` and async `hydrate(context, snapshot)`. An extension can inject typed dependencies with @@ -44,9 +44,9 @@ receives `EffectsEnabled`; extensions must pass that state to actors created dur ## Lifecycle and key authority `E3LifecycleCoordinator` is a separate node-wide observer with persisted stage projection; it is -attached by [builder startup](../ciphernode-builder/src/builder/startup.rs). Terminal local state -does not itself prove confirmed chain completion, and failed contexts can remain alive for -accusation work. Peer traffic cannot create an admitted E3. +attached by [builder startup](../ciphernode/builder/src/startup.rs). Terminal local state does not +itself prove confirmed chain completion, and failed contexts can remain alive for accusation work. +Peer traffic cannot create an admitted E3. Peer events arriving before chain admission wait in a bounded memory-only queue. They follow the admitting chain event in arrival order; a restart before admission loses that held history. This diff --git a/crates/slashing/README.md b/crates/slashing/README.md index 190819a27a..17f3d986d4 100644 --- a/crates/slashing/README.md +++ b/crates/slashing/README.md @@ -36,9 +36,9 @@ Register these per-E3 capabilities through `E3RouterBuilder::with_recipient`: `commitment_consistency_checker` recipient. The factory maps a BFV preset to the expected `CommitmentLink` rules; the standard composition uses `e3_zk_prover::default_links`. -The [builder caller](../ciphernode-builder/src/builder/extensions.rs) shows chain-specific -configuration and registration. Exported `AccusationManager` and `CommitmentConsistencyChecker` also -support lower-level harnesses; extensions are the normal runtime entry. +The [builder caller](../ciphernode/builder/src/extensions.rs) shows chain-specific configuration and +registration. Exported `AccusationManager` and `CommitmentConsistencyChecker` also support +lower-level harnesses; extensions are the normal runtime entry. ## Evidence boundary diff --git a/crates/sortition/Readme.md b/crates/sortition/Readme.md index a547d6f540..319cb7206e 100644 --- a/crates/sortition/Readme.md +++ b/crates/sortition/Readme.md @@ -28,14 +28,14 @@ not reorder members or renumber finalized slots. `Sortition::attach(SortitionAttachParams { ... }).await` restores repositories/backend and subscribes to registry/request events. `CiphernodeSelector::attach` restores local party/aggregator -roles. The [builder caller](../ciphernode-builder/src/builder/sortition.rs) shows their combined -setup, including committee reconciliation and pending ticket intents. Consumers query the actor with +roles. The [builder caller](../ciphernode/builder/src/sortition.rs) shows their combined setup, +including committee reconciliation and pending ticket intents. Consumers query the actor with messages such as `GetNodesForE3`; they do not rerun selection from current balances. Full nodes also attach `CommitteeFinalizer::attach_with_recovery(bus, repository, chain_time_reader)` at the existing -[startup boundary](../ciphernode-builder/src/builder/startup.rs). The `CommitteeChainTimeReader` -reads latest block time for the request's chain; the [EVM adapter](../evm/runtime/src/chain_time.rs) +[startup boundary](../ciphernode/builder/src/startup.rs). The `CommitteeChainTimeReader` reads +latest block time for the request's chain; the [EVM adapter](../evm/runtime/src/chain_time.rs) creates a fresh provider per attempt. The actor retains deadline/rank, effects gating and cancellation. It remains separate from `Sortition`, and bootstrap does not attach it. Recovery keeps its original store key and schema despite the ownership move. diff --git a/crates/sync/README.md b/crates/sync/README.md index b6929ae485..b68f449ac2 100644 --- a/crates/sync/README.md +++ b/crates/sync/README.md @@ -27,8 +27,8 @@ Storage admission precedes actor writes: inspect raw persisted schema and role, compatible checkpoint, and reconcile the router before resuming work. Public helpers include `inspect_persisted_schema_version`, `preflight_schema_version`, `preflight_node_role`, `reconcile_request_router_checkpoint`, and `project_restored_request_contexts`. The -[builder startup caller](../ciphernode-builder/src/builder/startup.rs) supplies repositories, -aggregate IDs, and the sequence-history reader in the production order. +[builder startup caller](../ciphernode/builder/src/startup.rs) supplies repositories, aggregate IDs, +and the sequence-history reader in the production order. `sync(bus, evm_config, repositories, aggregate_config, eventstore).await` performs the replay/history workflow. Production uses `sync_with_net_ready` with a readiness future armed before diff --git a/crates/trbfv/README.md b/crates/trbfv/README.md index be9c45e45b..2b8fc00028 100644 --- a/crates/trbfv/README.md +++ b/crates/trbfv/README.md @@ -35,8 +35,8 @@ Each public module exposes a typed request/response and its calculation function `TrBFVRequest`, `TrBFVResponse`, and `TrBFVError` provide the worker dispatch envelope. `TrBFVFailure` retains structured threshold error/party attribution when available, in addition to a -human-readable message. The [multithread dispatcher](../multithread/src/multithread.rs) is the -production caller showing RNG/cipher/request handling. +human-readable message. The [compute dispatcher](../ciphernode/multithread/src/multithread.rs) is +the production caller showing RNG/cipher/request handling. `TrBFVRequest::execute(&rng, &cipher)` is the synchronous native execution boundary. It dispatches to the existing calculations, locks caller-owned randomness only for randomized operations, and diff --git a/crates/zk/prover/README.md b/crates/zk/prover/README.md index 68ab04d0ec..e61d0e89d7 100644 --- a/crates/zk/prover/README.md +++ b/crates/zk/prover/README.md @@ -56,7 +56,7 @@ Node runtimes use `setup_zk_actors` with `ZkActorRecovery`, canonical committees repositories, plus the compute dispatcher's shared `e3_task_pool::TaskPool` and node scope. C0 verification runs off the actor runtime through that pool, preserving serial response/barrier order. These arguments are required: callers must not create an independent production verification pool. -The [builder wiring](../../ciphernode-builder/src/builder/extensions.rs) shows hydration before +The [builder wiring](../../ciphernode/builder/src/extensions.rs) shows hydration before effect-enabled replay. Operators normally use the [CLI Noir commands](../../cli/src/noir.rs), not manual actor construction. Slashing implementation lives in [e3-slashing](../../slashing/README.md). diff --git a/docs/architecture/persistence-and-replay.md b/docs/architecture/persistence-and-replay.md index 4145dd6655..cb0cbebfe1 100644 --- a/docs/architecture/persistence-and-replay.md +++ b/docs/architecture/persistence-and-replay.md @@ -2,7 +2,7 @@ Owners: [event system](../../crates/event-system/), [events](../../crates/events/), [data](../../crates/data/), [request router](../../crates/request/), [sync](../../crates/sync/), and -[ciphernode builder](../../crates/ciphernode-builder/). [Design principles](design-principles.md) +[ciphernode builder](../../crates/ciphernode/builder/). [Design principles](design-principles.md) describe the direction; owner-local documentation describes implementation boundaries. Neither makes an unimplemented durability guarantee true. @@ -327,8 +327,9 @@ call-count ceiling cannot establish safe delivery. Proof-skipping rejection is t validation function rather than the full startup path. [Schema tests](../../crates/entrypoint/tests/validate_older_schema.rs) check failure before recovery; -[finalized reconciliation tests](../../crates/ciphernode-builder/src/finalized_lifecycle.rs) include -bounded failed-batch retry. [Effect-gate tests](../../crates/multithread/src/effect_gate.rs) include +[finalized reconciliation tests](../../crates/ciphernode/builder/src/finalized_lifecycle.rs) include +bounded failed-batch retry. +[Effect-gate tests](../../crates/ciphernode/multithread/src/effect_gate.rs) include `replayed_failure_does_not_suppress_a_recovery_attempt`. Run affected focused Cargo tests and `pnpm test:integration` for cross-layer restart/shutdown scenarios. None closes the gaps merely by existing. diff --git a/docs/architecture/threshold-decryption.md b/docs/architecture/threshold-decryption.md index 1796742df7..73dba33a53 100644 --- a/docs/architecture/threshold-decryption.md +++ b/docs/architecture/threshold-decryption.md @@ -138,7 +138,7 @@ chain history arrives. See [network delivery](network-delivery.md) for loss and `plaintext_dependencies_use_chain_rosters_across_restart`, and [keyshare tests](../../crates/keyshare/src/threshold_keyshare/tests.rs), including `retained_c6_work_recovers_key_bytes_in_every_decryption_phase`, cover recovery admission. -- [Effect-gate tests](../../crates/multithread/src/effect_gate.rs), including +- [Effect-gate tests](../../crates/ciphernode/multithread/src/effect_gate.rs), including `replayed_c6_compute_requires_canonical_public_inputs`, guard logged request release. - [BfvDecryptionVerifier tests](../../packages/interfold-contracts/test/BfvDecryptionVerifier.spec.ts) own on-chain domain/anchor checks. Use `cargo test -p e3-aggregator`, `pnpm evm:test`, and diff --git a/scripts/blueprint/facts/01-entry.json b/scripts/blueprint/facts/01-entry.json index f9527dfc2d..e4dbd5f371 100644 --- a/scripts/blueprint/facts/01-entry.json +++ b/scripts/blueprint/facts/01-entry.json @@ -279,55 +279,55 @@ "id": "e3-ciphernode-builder", "documentation": [{ "title": "Startup and recovery", "path": "docs/architecture/persistence-and-replay.md" }], "kind": "crate", - "path": "crates/ciphernode-builder", + "path": "crates/ciphernode/builder", "one_line": "Composition root for full or bootstrap nodes: orders storage preflight, restart recovery, live bus, protocol core, EVM readers, extensions, networking and sync.", "actors": [ { "name": "EventBus", "role": "fresh node-local bus, passed to the event system before storage opens", - "ref": "crates/ciphernode-builder/src/builder/startup.rs@105@EventBus::::new(EventBusConfig { deduplicate: true }).start();" + "ref": "crates/ciphernode/builder/src/startup.rs@105@EventBus::::new(EventBusConfig { deduplicate: true }).start();" }, { "name": "E3LifecycleCoordinator", "role": "additive observer that tracks each E3's stage for restart and shutdown", - "ref": "crates/ciphernode-builder/src/builder/startup.rs@419@E3LifecycleCoordinator::attach(bus, storage.store.clone()).await?;" + "ref": "crates/ciphernode/builder/src/startup.rs@419@E3LifecycleCoordinator::attach(bus, storage.store.clone()).await?;" }, { "name": "CiphernodeSelector", "role": "selection state for this address, attached before Sortition", - "ref": "crates/ciphernode-builder/src/builder/sortition.rs@48@let ciphernode_selector = CiphernodeSelector::attach(" + "ref": "crates/ciphernode/builder/src/sortition.rs@48@let ciphernode_selector = CiphernodeSelector::attach(" }, { "name": "Sortition", "role": "attached with its backend and stores; the production node uses the score backend", - "ref": "crates/ciphernode-builder/src/builder/sortition.rs@59@let sortition = Sortition::attach(SortitionAttachParams {" + "ref": "crates/ciphernode/builder/src/sortition.rs@59@let sortition = Sortition::attach(SortitionAttachParams {" }, { "name": "EvmSystemChainBuilder", "role": "per enabled chain: assembles the contract-reader ingestion gateway", - "ref": "crates/ciphernode-builder/src/builder/evm.rs@141@let mut system = EvmSystemChainBuilder::new(bus, provider);" + "ref": "crates/ciphernode/builder/src/evm.rs@141@let mut system = EvmSystemChainBuilder::new(bus, provider);" }, { "name": "E3Router", "role": "request router: extensions register on it, and it is attached after networking starts", - "ref": "crates/ciphernode-builder/src/builder/extensions.rs@240@Ok(E3Router::builder(bus, storage.store.clone())" + "ref": "crates/ciphernode/builder/src/extensions.rs@240@Ok(E3Router::builder(bus, storage.store.clone())" }, { "name": "ThresholdKeyshareExtension", "role": "registered with ZK actors only for the full-node profile", - "ref": "crates/ciphernode-builder/src/builder/extensions.rs@79@ThresholdKeyshareExtension::create(" + "ref": "crates/ciphernode/builder/src/extensions.rs@79@ThresholdKeyshareExtension::create(" }, { "name": "Multithread", "role": "full-node compute worker, started with the configured pool and ZK backend", - "ref": "crates/ciphernode-builder/src/builder/extensions.rs@205@Multithread::attach_with_zk(" + "ref": "crates/ciphernode/builder/src/extensions.rs@205@Multithread::attach_with_zk(" } ], "consumes": [ { "name": "NetReady", "by": "CiphernodeBuilder", - "ref": "crates/ciphernode-builder/src/builder/startup.rs@140@let net_ready = live.bus.wait_for(EventType::NetReady);" + "ref": "crates/ciphernode/builder/src/startup.rs@140@let net_ready = live.bus.wait_for(EventType::NetReady);" } ], "emits": [], @@ -335,39 +335,39 @@ { "name": "event log at log_file and sled key/value store at db_file (persisted mode)", "where": "disk", - "ref": "crates/ciphernode-builder/src/builder/mod.rs@167@pub fn with_persistence(mut self, log_path: &PathBuf, kv_path: &PathBuf) -> Self {" + "ref": "crates/ciphernode/builder/src/lib.rs@172@pub fn with_persistence(mut self, log_path: &PathBuf, kv_path: &PathBuf) -> Self {" }, { "name": "correlation-ids file next to the event log", "where": "disk", - "ref": "crates/ciphernode-builder/src/builder/startup.rs@246@e3_events::reserve_correlation_ids(&log_path.with_file_name(\"correlation-ids\"))?;" + "ref": "crates/ciphernode/builder/src/startup.rs@246@e3_events::reserve_correlation_ids(&log_path.with_file_name(\"correlation-ids\"))?;" }, { "name": "ingestion heartbeat files, one per chain", "where": "disk", - "ref": "crates/ciphernode-builder/src/builder/evm.rs@62@.map(ingestion_heartbeat_files)" + "ref": "crates/ciphernode/builder/src/evm.rs@62@.map(ingestion_heartbeat_files)" }, { "name": "in-memory event system (tests and benchmarks)", "where": "memory", - "ref": "crates/ciphernode-builder/src/builder/startup.rs@462@EventSystemType::InMem => EventSystem::in_mem()," + "ref": "crates/ciphernode/builder/src/startup.rs@462@EventSystemType::InMem => EventSystem::in_mem()," } ], "key_types": [ { "name": "CiphernodeBuilder", "what": "builder with one field per setting; build() returns the started handle", - "ref": "crates/ciphernode-builder/src/builder/mod.rs@48@pub struct CiphernodeBuilder {" + "ref": "crates/ciphernode/builder/src/lib.rs@53@pub struct CiphernodeBuilder {" }, { "name": "CiphernodeHandle", "what": "what a started node returns: bus, store, eventstore, peer id, status and shutdown", - "ref": "crates/ciphernode-builder/src/ciphernode.rs@45@pub struct CiphernodeHandle {" + "ref": "crates/ciphernode/builder/src/ciphernode.rs@45@pub struct CiphernodeHandle {" }, { "name": "NodeProfile", "what": "private full/bootstrap choice; full carries the ZK backend, bootstrap installs no protocol extensions", - "ref": "crates/ciphernode-builder/src/builder/mod.rs@81@enum NodeProfile {" + "ref": "crates/ciphernode/builder/src/lib.rs@86@enum NodeProfile {" }, { "name": "ProviderCache (e3-evm)", @@ -377,7 +377,7 @@ { "name": "Storage / Restart / Live / Protocol", "what": "private phase outputs passed between the ordered startup steps", - "ref": "crates/ciphernode-builder/src/builder/startup.rs@52@pub(super) struct Storage {" + "ref": "crates/ciphernode/builder/src/startup.rs@52@pub(super) struct Storage {" }, { "name": "EvmSystemChainBuilder (e3-evm)", @@ -388,15 +388,15 @@ "read_first": [ { "why": "the function that builds the node; it hands off to build_inner", - "ref": "crates/ciphernode-builder/src/builder/startup.rs@97@pub async fn build(self) -> anyhow::Result {" + "ref": "crates/ciphernode/builder/src/startup.rs@97@pub async fn build(self) -> anyhow::Result {" }, { "why": "the ordered startup steps, from storage checks to the sync wait", - "ref": "crates/ciphernode-builder/src/builder/startup.rs@102@async fn build_inner(mut self)" + "ref": "crates/ciphernode/builder/src/startup.rs@102@async fn build_inner(mut self)" }, { "why": "where protocol extensions are registered, and under which roles", - "ref": "crates/ciphernode-builder/src/builder/extensions.rs@42@pub(super) async fn setup_extensions(" + "ref": "crates/ciphernode/builder/src/extensions.rs@42@pub(super) async fn setup_extensions(" }, { "why": "the production caller, with the settings for a full node", @@ -407,32 +407,32 @@ { "pattern": "builder-pattern", "note": "each with_* method takes self and returns it, so settings chain", - "ref": "crates/ciphernode-builder/src/builder/mod.rs@153@pub fn with_name(mut self, name: &str) -> Self {" + "ref": "crates/ciphernode/builder/src/lib.rs@158@pub fn with_name(mut self, name: &str) -> Self {" }, { "pattern": "let-else", "note": "bootstrap returns the router without installing full-node protocol extensions", - "ref": "crates/ciphernode-builder/src/builder/extensions.rs@65@let NodeProfile::Full { zk_backend } = &self.profile else {" + "ref": "crates/ciphernode/builder/src/extensions.rs@65@let NodeProfile::Full { zk_backend } = &self.profile else {" }, { "pattern": "arc-shared", "note": "the cipher is held in an Arc and cloned into the components that need it", - "ref": "crates/ciphernode-builder/src/builder/mod.rs@56@cipher: Arc," + "ref": "crates/ciphernode/builder/src/lib.rs@61@cipher: Arc," }, { "pattern": "enum-match", "note": "the profile selects full or bootstrap storage-role fencing", - "ref": "crates/ciphernode-builder/src/builder/mod.rs@146@match self.profile {" + "ref": "crates/ciphernode/builder/src/lib.rs@151@match self.profile {" }, { "pattern": "tokio-select", "note": "startup waits for sync, EVM gateways and networking, or fails on a fatal storage error", - "ref": "crates/ciphernode-builder/src/builder/startup.rs@159@tokio::select! {" + "ref": "crates/ciphernode/builder/src/startup.rs@159@tokio::select! {" }, { "pattern": "lifetime", "note": "ChainReaders borrows one chain's bus, config and provider during reader assembly", - "ref": "crates/ciphernode-builder/src/builder/evm.rs@32@struct ChainReaders<'a> {" + "ref": "crates/ciphernode/builder/src/evm.rs@32@struct ChainReaders<'a> {" } ], "depends_on": [ @@ -455,7 +455,7 @@ "e3-sync", "e3-utils" ], - "tests": "Unit tests in src/ciphernode.rs, finalized_lifecycle.rs, recovery.rs and builder/ (startup, sortition, extensions, EVM and restart); run: cargo test -p e3-ciphernode-builder (the test-helpers feature enables the test overrides)", + "tests": "Unit tests in src/ciphernode.rs, finalized_lifecycle.rs, recovery.rs and src/ (startup, sortition, extensions, EVM and restart); run: cargo test -p e3-ciphernode-builder (the test-helpers feature enables the test overrides)", "unverified": [ "Behaviour inside the extension crates (e3-keyshare, e3-aggregator, e3-request, e3-sync) was not read; only how this crate wires them." ] @@ -575,7 +575,7 @@ "id": "e3-daemon-server", "documentation": [{ "title": "CLI control port", "path": "docs/pages/reference/cli.mdx" }], "kind": "crate", - "path": "crates/daemon-server", + "path": "crates/ciphernode/daemon-server", "one_line": "Loopback control channel: a small HTTP server inside a running node that runs forwarded CLI commands, plus the client that sends them.", "actors": [], "consumes": [], @@ -585,21 +585,21 @@ { "name": "ServerInfo", "what": "the control port of a running node, as found by connect_daemon", - "ref": "crates/daemon-server/src/lib.rs@21@pub struct ServerInfo {" + "ref": "crates/ciphernode/daemon-server/src/lib.rs@21@pub struct ServerInfo {" } ], "read_first": [ { "why": "the probe that decides whether a node is running", - "ref": "crates/daemon-server/src/lib.rs@25@pub async fn connect_daemon(maybe_config: Option<&AppConfig>)" + "ref": "crates/ciphernode/daemon-server/src/lib.rs@25@pub async fn connect_daemon(maybe_config: Option<&AppConfig>)" }, { "why": "the server side: one task per connection, one command per request", - "ref": "crates/daemon-server/src/lib.rs@59@pub async fn start_daemon_server(tcp_port: u16, handler: F)" + "ref": "crates/ciphernode/daemon-server/src/lib.rs@59@pub async fn start_daemon_server(tcp_port: u16, handler: F)" }, { "why": "the client side: post the command, print the reply lines", - "ref": "crates/daemon-server/src/lib.rs@38@pub async fn run_on_daemon(" + "ref": "crates/ciphernode/daemon-server/src/lib.rs@38@pub async fn run_on_daemon(" }, { "why": "where a node starts its control server and runs forwarded commands", @@ -610,22 +610,22 @@ { "pattern": "generic-where", "note": "the handler is a generic Fn(String) returning a future, bounded to 'static", - "ref": "crates/daemon-server/src/lib.rs@61@F: Fn(String) -> Fut + 'static," + "ref": "crates/ciphernode/daemon-server/src/lib.rs@61@F: Fn(String) -> Fut + 'static," }, { "pattern": "result-question-mark", "note": "request parsing propagates read errors with ?", - "ref": "crates/daemon-server/src/lib.rs@104@buf_reader.read_line(&mut line).await?;" + "ref": "crates/ciphernode/daemon-server/src/lib.rs@104@buf_reader.read_line(&mut line).await?;" }, { "pattern": "arc-shared", "note": "the handler is wrapped in an Arc so every connection task can use it", - "ref": "crates/daemon-server/src/lib.rs@72@let handler = Arc::new(handler);" + "ref": "crates/ciphernode/daemon-server/src/lib.rs@72@let handler = Arc::new(handler);" }, { "pattern": "async-await", "note": "the client call is async and awaits the HTTP post", - "ref": "crates/daemon-server/src/lib.rs@38@pub async fn run_on_daemon(" + "ref": "crates/ciphernode/daemon-server/src/lib.rs@38@pub async fn run_on_daemon(" } ], "depends_on": ["e3-console", "e3-config"], diff --git a/scripts/blueprint/facts/02-clients-compute.json b/scripts/blueprint/facts/02-clients-compute.json index 2436bd8457..2164e511a2 100644 --- a/scripts/blueprint/facts/02-clients-compute.json +++ b/scripts/blueprint/facts/02-clients-compute.json @@ -774,57 +774,57 @@ "id": "e3-multithread", "documentation": [{ "title": "Compute effects and recovery", "path": "docs/architecture/persistence-and-replay.md" }], "kind": "crate", - "path": "crates/multithread", + "path": "crates/ciphernode/multithread", "one_line": "Ciphernode worker actor that runs TrBFV and ZK compute requests on a Rayon pool and publishes results or errors back to the event bus.", "actors": [ { "name": "Multithread", "role": "runs compute requests off the event path and publishes their responses", - "ref": "crates/multithread/src/multithread.rs@50@pub struct Multithread {" + "ref": "crates/ciphernode/multithread/src/multithread.rs@50@pub struct Multithread {" }, { "name": "ComputeEffectGate", "role": "holds requests until EffectsEnabled and replays or deduplicates outcomes by request key", - "ref": "crates/multithread/src/effect_gate.rs@100@pub(crate) struct ComputeEffectGate {" + "ref": "crates/ciphernode/multithread/src/effect_gate.rs@100@pub(crate) struct ComputeEffectGate {" }, { "name": "MultithreadReport", "role": "records how long each operation took, for the report", - "ref": "crates/multithread/src/report.rs@30@pub struct MultithreadReport {" + "ref": "crates/ciphernode/multithread/src/report.rs@30@pub struct MultithreadReport {" } ], "consumes": [ { "name": "ComputeRequest (a TrBFV or ZK job)", "by": "ComputeEffectGate", - "ref": "crates/multithread/src/effect_gate.rs@491@InterfoldEventData::ComputeRequest(_) if self.enabled => {" + "ref": "crates/ciphernode/multithread/src/effect_gate.rs@491@InterfoldEventData::ComputeRequest(_) if self.enabled => {" }, { "name": "EffectsEnabled, which releases the queued requests", "by": "ComputeEffectGate", - "ref": "crates/multithread/src/effect_gate.rs@498@InterfoldEventData::EffectsEnabled(_) => self.enable()," + "ref": "crates/ciphernode/multithread/src/effect_gate.rs@498@InterfoldEventData::EffectsEnabled(_) => self.enable()," }, { "name": "E3Failed, E3StageChanged and E3RequestComplete, which cancel the E3's task groups", "by": "Multithread", - "ref": "crates/multithread/src/multithread.rs@176@EventType::E3Failed," + "ref": "crates/ciphernode/multithread/src/multithread.rs@176@EventType::E3Failed," } ], "emits": [ { "name": "ComputeResponse", "by": "Multithread", - "ref": "crates/multithread/src/multithread.rs@666@bus.publish(value, ctx)?;" + "ref": "crates/ciphernode/multithread/src/multithread.rs@666@bus.publish(value, ctx)?;" }, { "name": "ComputeRequestError, for failures that are not retried", "by": "Multithread", - "ref": "crates/multithread/src/multithread.rs@646@bus.publish(ComputeRequestError::new(error_kind, request_snapshot), ctx)?;" + "ref": "crates/ciphernode/multithread/src/multithread.rs@646@bus.publish(ComputeRequestError::new(error_kind, request_snapshot), ctx)?;" }, { "name": "stored outcomes sent to the other request IDs waiting on the same work", "by": "ComputeEffectGate", - "ref": "crates/multithread/src/effect_gate.rs@386@ComputeOutcome::Response(response) => bus.publish(" + "ref": "crates/ciphernode/multithread/src/effect_gate.rs@386@ComputeOutcome::Response(response) => bus.publish(" } ], "state": [ @@ -836,12 +836,12 @@ { "name": "requests the worker is running, counted per correlation ID", "where": "memory", - "ref": "crates/multithread/src/effect_gate.rs@49@pub(crate) struct RunningJobs(Arc>>);" + "ref": "crates/ciphernode/multithread/src/effect_gate.rs@49@pub(crate) struct RunningJobs(Arc>>);" }, { "name": "pending, forwarded and replayed-outcome maps in the gate", "where": "memory", - "ref": "crates/multithread/src/effect_gate.rs@104@pending: HashMap," + "ref": "crates/ciphernode/multithread/src/effect_gate.rs@104@pending: HashMap," } ], "key_types": [ @@ -858,26 +858,26 @@ { "name": "ComputeCapacity", "what": "job limit after the CPU and memory caps (13 GiB per prover job, 4 GiB reserved for the node)", - "ref": "crates/multithread/src/memory.rs@26@pub struct ComputeCapacity {" + "ref": "crates/ciphernode/multithread/src/memory.rs@26@pub struct ComputeCapacity {" }, { "name": "ComputeOutcome", "what": "a response or an error that the gate keeps for requests waiting on the same work", - "ref": "crates/multithread/src/effect_gate.rs@25@enum ComputeOutcome {" + "ref": "crates/ciphernode/multithread/src/effect_gate.rs@25@enum ComputeOutcome {" } ], "read_first": [ { "why": "wiring: attach creates the actor, subscribes it to the bus, and starts the gate", - "ref": "crates/multithread/src/multithread.rs@101@pub fn attach(" + "ref": "crates/ciphernode/multithread/src/multithread.rs@101@pub fn attach(" }, { "why": "the gate: when a request goes to the worker, and when a stored result is reused", - "ref": "crates/multithread/src/effect_gate.rs@250@fn forward(&mut self, event: InterfoldEvent) -> bool {" + "ref": "crates/ciphernode/multithread/src/effect_gate.rs@250@fn forward(&mut self, event: InterfoldEvent) -> bool {" }, { "why": "the actor's request handler and its retry loop", - "ref": "crates/multithread/src/multithread.rs@550@async fn handle_compute_request_event(" + "ref": "crates/ciphernode/multithread/src/multithread.rs@550@async fn handle_compute_request_event(" }, { "why": "the pool: semaphore wait, Rayon spawn, and the oneshot result", @@ -885,24 +885,24 @@ }, { "why": "the worker function that dispatches TrBFV and ZK requests", - "ref": "crates/multithread/src/multithread.rs@856@fn handle_compute_request(" + "ref": "crates/ciphernode/multithread/src/multithread.rs@856@fn handle_compute_request(" } ], "rust_patterns": [ { "pattern": "actix-actor", "note": "Multithread implements Actor and sets its mailbox capacity from MAILBOX_LIMIT on start", - "ref": "crates/multithread/src/multithread.rs@505@impl Actor for Multithread {" + "ref": "crates/ciphernode/multithread/src/multithread.rs@505@impl Actor for Multithread {" }, { "pattern": "actix-handler", "note": "the actor handles bus events by queuing compute requests to itself as typed messages", - "ref": "crates/multithread/src/multithread.rs@512@impl Handler for Multithread {" + "ref": "crates/ciphernode/multithread/src/multithread.rs@512@impl Handler for Multithread {" }, { "pattern": "actix-recipient", "note": "the gate receives the actor as a Recipient, so it sends events without naming the actor type", - "ref": "crates/multithread/src/multithread.rs@125@addr.clone().recipient()," + "ref": "crates/ciphernode/multithread/src/multithread.rs@125@addr.clone().recipient()," }, { "pattern": "channel", @@ -925,7 +925,7 @@ "unverified": [ "The ZK prover (ZkProver) lives in crates/zk/prover and was not read; the proof side is described only from the dispatch in multithread.rs.", "The memory constants (memory.rs:19 and memory.rs:22) are values in code; their effect on a real host was not measured.", - "The thread counts and job limits are set in crates/ciphernode-builder/src/builder/mod.rs (with_multithread_config); the builder was checked only at the call sites." + "The thread counts and job limits are set in crates/ciphernode/builder/src/lib.rs (with_multithread_config); the builder was checked only at the call sites." ] }, { @@ -941,7 +941,7 @@ "consumes": [ { "name": "TrBFVRequest variants: generate, sum, share and combine", - "by": "handle_trbfv_request in crates/multithread", + "by": "handle_trbfv_request in crates/ciphernode/multithread", "ref": "crates/trbfv/src/trbfv_request.rs@27@pub enum TrBFVRequest {" }, { diff --git a/scripts/blueprint/facts/03-request-sortition-slashing.json b/scripts/blueprint/facts/03-request-sortition-slashing.json index 6574044e27..3ca8a33d0d 100644 --- a/scripts/blueprint/facts/03-request-sortition-slashing.json +++ b/scripts/blueprint/facts/03-request-sortition-slashing.json @@ -139,7 +139,7 @@ "read_first": [ { "why": "Wiring: the node builds E3Router and installs the router extensions", - "ref": "crates/ciphernode-builder/src/builder/extensions.rs@240@Ok(E3Router::builder(bus, storage.store.clone())" + "ref": "crates/ciphernode/builder/src/extensions.rs@240@Ok(E3Router::builder(bus, storage.store.clone())" }, { "why": "The router actor and what it holds per E3", "ref": "crates/request/src/routing/actor.rs@95@pub struct E3Router {" }, { diff --git a/scripts/blueprint/facts/05-zk.json b/scripts/blueprint/facts/05-zk.json index 1f9b58cd69..28fd790f80 100644 --- a/scripts/blueprint/facts/05-zk.json +++ b/scripts/blueprint/facts/05-zk.json @@ -355,7 +355,7 @@ "versions.json circuits_checksums lists only 0.18.0 while required_circuits_version is 0.19.0; the 0.19.0 digest is inserted at build time from E3_CIRCUITS_ARCHIVE_SHA256 (config.rs:80-85). I did not check how release builds set that variable.", "NodeProofAggregator persists through e3-data Repositories (node_proof_aggregation/actor.rs:45); whether that store is sled-backed was not traced (crates/data/src/lib.rs:18 declares sled_db).", "The commitment_links/*.rs consistency rules and the ECDSA checks in share_verification/transitions/ecdsa.rs were not read beyond their names.", - "The TaskPool, retry and memory logic in crates/multithread was not read beyond the dispatch path." + "The TaskPool, retry and memory logic in crates/ciphernode/multithread was not read beyond the dispatch path." ] }, { diff --git a/scripts/blueprint/facts/07-net-sync.json b/scripts/blueprint/facts/07-net-sync.json index 14660ff103..fe55879c27 100644 --- a/scripts/blueprint/facts/07-net-sync.json +++ b/scripts/blueprint/facts/07-net-sync.json @@ -392,7 +392,7 @@ }, { "why": "The production caller: NetReady is armed before networking starts, then sync runs.", - "ref": "crates/ciphernode-builder/src/builder/startup.rs@161@sync_with_net_ready(" + "ref": "crates/ciphernode/builder/src/startup.rs@161@sync_with_net_ready(" }, { "why": "The schema check that runs before any state is written.", diff --git a/scripts/blueprint/lib/inventory.mjs b/scripts/blueprint/lib/inventory.mjs index d180ae1b62..282f924ff6 100644 --- a/scripts/blueprint/lib/inventory.mjs +++ b/scripts/blueprint/lib/inventory.mjs @@ -43,7 +43,18 @@ const lines = (p) => readFileSync(p, 'utf8').split('\n') // Hand-maintained primary responsibilities for the blueprint, not the full Cargo dependency graph. export const LAYERS = { - entry: ['cli', 'entrypoint', 'ciphernode-builder', 'dashboard', 'daemon-server', 'console', 'init', 'fs', 'zk/build', 'zk/benchmarks'], + entry: [ + 'cli', + 'entrypoint', + 'ciphernode/builder', + 'dashboard', + 'ciphernode/daemon-server', + 'console', + 'init', + 'fs', + 'zk/build', + 'zk/benchmarks', + ], clients: [ 'program-server', 'program-runner', @@ -56,7 +67,18 @@ export const LAYERS = { 'openvm-types', 'openvm-prover', ], - workflows: ['request', 'sortition', 'keyshare', 'aggregator', 'slashing', 'zk/prover', 'fhe', 'multithread', 'trbfv', 'bfv-client'], + workflows: [ + 'request', + 'sortition', + 'keyshare', + 'aggregator', + 'slashing', + 'zk/prover', + 'fhe', + 'ciphernode/multithread', + 'trbfv', + 'bfv-client', + ], adapters: ['evm/runtime', 'net', 'sync', 'event-system', 'data', 'data-availability', 'logger'], vocabulary: ['events', 'config', 'fhe-params', 'zk/config', 'zk/witness', 'committee', 'committee-hash', 'evm/contracts'], foundations: ['crypto', 'polynomial', 'polynomial/fhe-adapter', 'parity-matrix', 'safe', 'hamt', 'utils', 'utils-derive', 'task-pool'], diff --git a/scripts/blueprint/refs/B-ciphernode.json b/scripts/blueprint/refs/B-ciphernode.json index e9bafe6978..08363e36d1 100644 --- a/scripts/blueprint/refs/B-ciphernode.json +++ b/scripts/blueprint/refs/B-ciphernode.json @@ -160,9 +160,9 @@ "id": "B14", "supported": true, "refs": [ - "crates/multithread/src/multithread.rs@526@impl Handler> for Multithread {", - "crates/multithread/src/multithread.rs@856@fn handle_compute_request(", - "crates/multithread/src/multithread.rs@666@bus.publish(value, ctx)?;" + "crates/ciphernode/multithread/src/multithread.rs@526@impl Handler> for Multithread {", + "crates/ciphernode/multithread/src/multithread.rs@856@fn handle_compute_request(", + "crates/ciphernode/multithread/src/multithread.rs@666@bus.publish(value, ctx)?;" ], "line_text": [ "impl Handler> for Multithread {", @@ -267,10 +267,10 @@ "id": "B21", "supported": true, "refs": [ - "crates/ciphernode-builder/src/builder/startup.rs@97@pub async fn build(self) -> anyhow::Result {", - "crates/ciphernode-builder/src/builder/startup.rs@102@async fn build_inner(mut self) -> anyhow::Result {", - "crates/ciphernode-builder/src/builder/startup.rs@419@E3LifecycleCoordinator::attach(bus, storage.store.clone()).await?;", - "crates/ciphernode-builder/src/builder/sortition.rs@48@let ciphernode_selector = CiphernodeSelector::attach(" + "crates/ciphernode/builder/src/startup.rs@97@pub async fn build(self) -> anyhow::Result {", + "crates/ciphernode/builder/src/startup.rs@102@async fn build_inner(mut self) -> anyhow::Result {", + "crates/ciphernode/builder/src/startup.rs@419@E3LifecycleCoordinator::attach(bus, storage.store.clone()).await?;", + "crates/ciphernode/builder/src/sortition.rs@48@let ciphernode_selector = CiphernodeSelector::attach(" ], "line_text": [ "pub async fn build(self) -> anyhow::Result {",