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
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Full-stack integration test infrastructure and coordination repo for the Source

## Hot path: ACP Light Client (#18)

The primary workstream is building a shared proof-validated ACP cache consumed by both DefraDB (query gate) and Orbis (signing gate). This is the critical path to making `tests/full_stack.rs` pass end-to-end with hub.rs as the SourceHub backend.
The primary workstream is building a shared proof-validated ACP cache consumed by both DefraDB (query gate) and Orbis (signing gate). This is the critical path to making `tests/full_stack.rs` pass end-to-end with hub.rs as the Vera backend.

### Trust chain (every document write is cryptographically verified)

Expand Down Expand Up @@ -46,7 +46,7 @@ See `docs/architecture.md` for the full security architecture.
backbone/
├── crates/
│ ├── test-infra/ # Shared primitives (ManagedProcess, ports, log tracking, run dirs)
│ ├── sourcehub-harness/ # Go sourcehubd manager (legacy, being replaced by hub-harness)
│ ├── vera-harness/ # Go verad manager (legacy, being replaced by hub-harness)
│ ├── defra-harness/ # DefraDB node manager + CLI client + test fixtures
│ ├── hub-harness/ # Hub.rs node manager + cluster builder + observability
│ └── orbis-harness/ # Orbis ring builder + DKG fixtures + event subscriptions
Expand Down Expand Up @@ -84,7 +84,7 @@ cargo fmt --all # Format
## Running the canonical test

```bash
# Requires sourcehubd, defra, and orbis-node binaries on PATH
# Requires verad, defra, and orbis-node binaries on PATH
cargo test --test full_stack -- --ignored --nocapture
```

Expand Down
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ publish = false
resolver = "2"
members = [
"crates/test-infra",
"crates/sourcehub-harness",
"crates/vera-harness",
"crates/defra-harness",
"crates/hub-harness",
"crates/orbis-harness",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Everything needed to start and observe Hub.rs validator clusters:
Everything needed to orchestrate Orbis DKG rings:

- `OrbisRingBuilder` — multi-node ring setup with threshold configuration
- `DkgFixture` — complete SourceHub + Orbis ring with DKG ceremony
- `DkgFixture` — complete Vera + Orbis ring with DKG ceremony
- Event-based synchronization — WebSocket subscriptions for DKG completion

## How Component Repos Use Backbone
Expand Down
2 changes: 1 addition & 1 deletion crates/defra-harness/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license.workspace = true

[dependencies]
test-infra = { path = "../test-infra" }
sourcehub-harness = { path = "../sourcehub-harness" }
vera-harness = { path = "../vera-harness" }
tokio.workspace = true
reqwest.workspace = true
serde.workspace = true
Expand Down
38 changes: 19 additions & 19 deletions crates/defra-harness/src/cluster/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::node::{
start_node, BinarySource, GoNode, KeyringBackend, NodeConfig, PortConflict, RustNode,
};
use crate::ports::allocate_node_ports;
use sourcehub_harness::{allocate_source_hub_ports, SourceHubConfig, SourceHubNode};
use vera_harness::{allocate_vera_ports, VeraConfig, VeraNode};

use super::health::health_check_all;
use super::runtime::TestCluster;
Expand Down Expand Up @@ -57,7 +57,7 @@ pub struct TestClusterBuilder {
encryption_enabled: bool,
signing_enabled: bool,
nac_enabled: bool,
source_hub_enabled: bool,
vera_enabled: bool,
development: bool,
store: Option<String>,
query_timeout: Option<u64>,
Expand Down Expand Up @@ -95,7 +95,7 @@ impl TestClusterBuilder {
encryption_enabled: false,
signing_enabled: false,
nac_enabled: false,
source_hub_enabled: false,
vera_enabled: false,
development: false,
store: None,
query_timeout: None,
Expand Down Expand Up @@ -232,9 +232,9 @@ impl TestClusterBuilder {
self
}

pub fn with_source_hub(mut self) -> Self {
self.source_hub_enabled = true;
self.acp_document_type = Some("source-hub".to_string());
pub fn with_vera(mut self) -> Self {
self.vera_enabled = true;
self.acp_document_type = Some("vera".to_string());
self
}

Expand Down Expand Up @@ -369,8 +369,8 @@ impl TestClusterBuilder {
None
};

// Source Hub or NAC requires an identity at startup.
if (self.nac_enabled || self.source_hub_enabled) && self.node_identity.is_none() {
// Vera or NAC requires an identity at startup.
if (self.nac_enabled || self.vera_enabled) && self.node_identity.is_none() {
let binary = if let Some(ref p) = go_binary_path {
p.clone()
} else if let Some(ref p) = rust_binary_path {
Expand All @@ -379,7 +379,7 @@ impl TestClusterBuilder {
eyre::bail!("no binary available for identity generation");
};
let id = crate::identity::generate_identity(&binary)
.wrap_err("auto-generating identity for NAC/SourceHub")?;
.wrap_err("auto-generating identity for NAC/Vera")?;
self.node_identity = Some(id.private_key_hex);
}

Expand All @@ -398,32 +398,32 @@ impl TestClusterBuilder {
"DEFRA_E2E_KEEP",
)?;

// Start Source Hub if enabled
let source_hub = if self.source_hub_enabled {
let sh_ports = allocate_source_hub_ports().wrap_err("allocating source hub ports")?;
// Start Vera if enabled
let vera = if self.vera_enabled {
let sh_ports = allocate_vera_ports().wrap_err("allocating Vera ports")?;

let sh_home = run_dir.node_dir("sourcehub")?;
let sh_home = run_dir.node_dir("vera")?;
let sh_log_dir = sh_home.join("logs");
std::fs::create_dir_all(&sh_log_dir)?;

let identity_keys: Vec<String> = self.node_identity.iter().cloned().collect();

let sh_node = SourceHubNode::start(
let sh_node = VeraNode::start(
sh_home,
sh_log_dir,
&sh_ports,
&identity_keys,
Duration::from_secs(60),
)
.await
.wrap_err("failed to start source hub node")?;
.wrap_err("failed to start Vera node")?;

Some(sh_node)
} else {
None
};

let sh_config: Option<SourceHubConfig> = source_hub.as_ref().map(SourceHubConfig::from);
let sh_config: Option<VeraConfig> = vera.as_ref().map(VeraConfig::from);

let mut nodes = Vec::with_capacity(total);

Expand Down Expand Up @@ -468,7 +468,7 @@ impl TestClusterBuilder {
encryption_enabled: self.encryption_enabled,
signing_enabled: self.signing_enabled,
nac_enabled: self.nac_enabled,
source_hub: sh_config.clone(),
vera: sh_config.clone(),
hub_rs_address: None,
orbis_signer: None,
keyring,
Expand Down Expand Up @@ -568,7 +568,7 @@ impl TestClusterBuilder {
encryption_enabled: self.encryption_enabled,
signing_enabled: self.signing_enabled,
nac_enabled: self.nac_enabled,
source_hub: sh_config.clone(),
vera: sh_config.clone(),
hub_rs_address: None,
orbis_signer: None,
keyring,
Expand Down Expand Up @@ -649,7 +649,7 @@ impl TestClusterBuilder {
run_dir,
self.node_identity,
effective_identities,
source_hub,
vera,
))
}
}
Expand Down
22 changes: 11 additions & 11 deletions crates/defra-harness/src/cluster/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::divergences::NodeKind;
use crate::node::{start_node, DefraNode, NodeConfig, PortConflict, RunningNode, RustNode};
use crate::observe::LogTracker;
use crate::ports::{multiaddr_ports, reserve_ports, ReservedPorts};
use sourcehub_harness::SourceHubNode;
use vera_harness::VeraNode;

use super::health::health_check;

Expand Down Expand Up @@ -94,11 +94,11 @@ async fn reserve_until_free(

/// A cluster of running DefraDB nodes.
///
/// Field order matters: `nodes` and `source_hub` are dropped before `run_dir`,
/// Field order matters: `nodes` and `vera` are dropped before `run_dir`,
/// ensuring processes are killed before their data directories are removed.
pub struct TestCluster {
pub nodes: Vec<RunningNode>,
source_hub: Option<SourceHubNode>,
vera: Option<VeraNode>,
#[allow(dead_code)]
run_dir: test_infra::TestRunDir,
startup_identity: Option<String>,
Expand All @@ -111,11 +111,11 @@ impl TestCluster {
run_dir: test_infra::TestRunDir,
startup_identity: Option<String>,
node_identities: Vec<Option<String>>,
source_hub: Option<SourceHubNode>,
vera: Option<VeraNode>,
) -> Self {
Self {
nodes,
source_hub,
vera,
run_dir,
startup_identity,
node_identities,
Expand Down Expand Up @@ -157,16 +157,16 @@ impl TestCluster {
self.nodes.is_empty()
}

pub fn source_hub(&self) -> Option<&SourceHubNode> {
self.source_hub.as_ref()
pub fn vera(&self) -> Option<&VeraNode> {
self.vera.as_ref()
}

/// Stop the SourceHub process. Drops the node, sending SIGTERM.
pub fn stop_source_hub(&mut self) -> Result<()> {
if self.source_hub.take().is_some() {
/// Stop the Vera process. Drops the node, sending SIGTERM.
pub fn stop_vera(&mut self) -> Result<()> {
if self.vera.take().is_some() {
Ok(())
} else {
eyre::bail!("no SourceHub node to stop")
eyre::bail!("no Vera node to stop")
}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/defra-harness/src/divergences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ pub fn p2p_listening_pattern(_kind: NodeKind) -> &'static str {
r"Created LibP2P host"
}

// -- SourceHub support --
// -- Vera support --

/// Whether the node supports `--source-hub-*` start flags.
/// Whether the node supports `--vera-*` start flags.
/// Rust: yes, Go: not yet
pub fn supports_source_hub_flags(kind: NodeKind) -> bool {
pub fn supports_vera_flags(kind: NodeKind) -> bool {
match kind {
NodeKind::Rust => true,
NodeKind::Go => false,
Expand Down
13 changes: 9 additions & 4 deletions crates/defra-harness/src/node/go_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,21 @@ impl DefraNode for GoNode {

if let Some(ref acp_type) = config.acp_document_type {
args.push("--document-acp-type".to_string());
args.push(acp_type.clone());
// Go still exposes the legacy selector.
args.push(if acp_type == "vera" {
"source-hub".to_string()
} else {
acp_type.clone()
});
}

if config.nac_enabled {
args.push("--node-acp-enable".to_string());
}

// DIVERGENCE: Go does not support --source-hub-* flags
if config.source_hub.is_some() && divergences::supports_source_hub_flags(NodeKind::Go) {
unreachable!("Go node does not support SourceHub flags");
// DIVERGENCE: Go does not support --vera-* flags
if config.vera.is_some() && divergences::supports_vera_flags(NodeKind::Go) {
unreachable!("Go node does not support Vera flags");
}

if config.development {
Expand Down
4 changes: 2 additions & 2 deletions crates/defra-harness/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ pub struct NodeConfig {
pub encryption_enabled: bool,
pub signing_enabled: bool,
pub nac_enabled: bool,
pub source_hub: Option<sourcehub_harness::SourceHubConfig>,
pub vera: Option<vera_harness::VeraConfig>,
pub hub_rs_address: Option<String>,
pub orbis_signer: Option<OrbisSignerConfig>,
pub keyring: KeyringBackend,
Expand Down Expand Up @@ -244,7 +244,7 @@ impl NodeConfig {
encryption_enabled: false,
signing_enabled: false,
nac_enabled: false,
source_hub: None,
vera: None,
hub_rs_address: None,
orbis_signer: None,
keyring: KeyringBackend::None,
Expand Down
Loading
Loading