Skip to content
Open
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
23 changes: 23 additions & 0 deletions crates/app/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,16 @@ async fn run(config: AppConfig, ct: CancellationToken) -> Result<(), AppError> {
let peers = lock.peers()?;
pluto_p2p::peer::verify_p2p_key(&peers, &key)?;

// Tracker view of the cluster, captured before `peers` moves into the P2P
// wiring. Share indices are 1-indexed, matching partial-signature share ids.
let tracker_peers: Vec<pluto_core::tracker::PeerInfo> = peers
.iter()
.map(|peer| pluto_core::tracker::PeerInfo {
name: peer.name.clone(),
share_idx: usize::try_from(peer.index.saturating_add(1)).unwrap_or(usize::MAX),
})
.collect();

// Cluster size + quorum for the health-checker metadata, captured before
// `peers` is moved into the P2P wiring.
let num_peers = i64::try_from(peers.len()).unwrap_or(i64::MAX);
Expand Down Expand Up @@ -547,6 +557,8 @@ async fn run(config: AppConfig, ct: CancellationToken) -> Result<(), AppError> {
fetch_only_comm_idx0,
seen_pubkeys: Some(seen_pubkeys_observer),
slot_tick: vmock.clone().map(|v| simnet_slot_tick(v, ct.clone())),
peers: tracker_peers,
feature_set: Arc::clone(&feature_set),
},
ct.clone(),
)
Expand Down Expand Up @@ -683,6 +695,7 @@ async fn run_lifecycle(
parsigdb_deadliner_rx,
aggsigdb: _aggsigdb,
fetcher: _fetcher,
inclusion_checker,
validator_api_router,
} = wired;

Expand Down Expand Up @@ -716,6 +729,16 @@ async fn run_lifecycle(
});
}

// Networked inclusion checker: polls the beacon node once per due slot and
// resolves each tracked duty's on-chain inclusion step.
{
let ct = ct.clone();
tasks.spawn(async move {
inclusion_checker.run(ct).await;
Ok(())
});
}

// Private-key lock maintenance loop. Only spawn `run` when locking is
// enabled — `Service::close()` blocks forever unless `run` was called, so
// spawn and close are guarded by the same `Option`.
Expand Down
Loading