Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
86a00e3
fix(node): keep attestation tasks alive after submission retry timeout
pbeza Aug 20, 2026
6dbab9d
fix(node): skip missed attestation ticks, raise failure log levels, a…
pbeza Aug 20, 2026
dd49712
Merge remote-tracking branch 'origin/main' into 2287-attestation-task…
pbeza Aug 20, 2026
a2dfb8a
refactor(node): express attestation monitor tests via TestSetup helpers
pbeza Aug 20, 2026
0822d84
refactor(node): dedupe attestation submission round into a shared method
pbeza Aug 20, 2026
3dc627a
Merge remote-tracking branch 'origin/main' into 2287-attestation-task…
pbeza Aug 21, 2026
0a02ec9
fix(node): keep removal monitor armed after a failed resubmission
pbeza Aug 21, 2026
e54301b
Merge remote-tracking branch 'origin/main' into 2287-attestation-task…
pbeza Aug 24, 2026
4ce0150
fix(node): retry a failed attestation resubmission on a fixed delay
pbeza Aug 24, 2026
ce9a6f2
Merge remote-tracking branch 'origin/main' into 2287-attestation-task…
pbeza Aug 24, 2026
d125fa1
Merge remote-tracking branch 'origin/main' into 2287-attestation-task…
pbeza Aug 25, 2026
98bb45b
feat(node): count TEE attestation submissions by outcome
pbeza Aug 25, 2026
1fd78b4
Merge remote-tracking branch 'origin/main' into 2287-attestation-task…
pbeza Aug 26, 2026
0c00f7b
refactor(node): flatten the attestation removal monitor loop
pbeza Aug 26, 2026
38e27a2
Merge remote-tracking branch 'origin/main' into 2287-attestation-task…
pbeza Aug 26, 2026
827ac94
refactor(node): import the names remote_attestation spells out in full
pbeza Aug 27, 2026
e64d945
refactor(node): drop the doc comment on the attestation submissions c…
pbeza Aug 27, 2026
71e4834
docs: keep the backup service resubmission cadence at 7 days
pbeza Aug 27, 2026
c82903f
refactor(node): own the attestation resubmission interval in the tee …
pbeza Aug 27, 2026
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
12 changes: 12 additions & 0 deletions crates/node/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,5 +477,17 @@ pub static MPC_TEE_ATTESTATION_ATTEMPTS_TOTAL: LazyLock<prometheus::IntCounterVe
.unwrap()
});

/// A node that cannot get its attestation onto the contract retries forever rather than giving
/// up, so this counter is the only signal an operator has that the node is failing to attest.
pub static MPC_TEE_ATTESTATION_SUBMISSIONS_TOTAL: LazyLock<prometheus::IntCounterVec> =
Comment thread
pbeza marked this conversation as resolved.
Outdated
LazyLock::new(|| {
prometheus::register_int_counter_vec!(
"mpc_tee_attestation_submissions_total",
"Total number of TEE attestation submissions to the MPC contract",
&["outcome"],
)
.unwrap()
});

pub const MPC_TEE_ATTESTATION_OUTCOME_SUCCESS: &str = "success";
pub const MPC_TEE_ATTESTATION_OUTCOME_FAILURE: &str = "failure";
50 changes: 13 additions & 37 deletions crates/node/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,33 +358,6 @@ where
}),
};

// Spawn periodic attestation submission task
let submitter = AttestationSubmitter {
tee_authority: tee_authority.clone(),
tx_sender: indexer_api.txn_sender.clone(),
tls_public_key: tls_public_key.clone(),
account_public_key: account_public_key.clone(),
allowed_image_hashes: indexer_api.allowed_docker_images_receiver.clone(),
allowed_launcher_compose_hashes: indexer_api.allowed_launcher_compose_receiver.clone(),
attestation_reader: indexer_api.attestation_reader.clone(),
};
tokio::spawn(async move {
if let Err(e) = periodic_attestation_submission(
submitter,
tokio::time::interval(ATTESTATION_RESUBMISSION_INTERVAL),
)
.await
{
tracing::error!(
error = ?e,
"periodic attestation submission task failed"
);
}
});

// Spawn TEE attestation monitoring task
let tee_accounts_receiver = indexer_api.attested_nodes_receiver.clone();
let account_id_clone = config.my_near_account_id.clone();
let submitter = AttestationSubmitter {
tee_authority,
tx_sender: indexer_api.txn_sender.clone(),
Expand All @@ -394,16 +367,19 @@ where
allowed_launcher_compose_hashes: indexer_api.allowed_launcher_compose_receiver.clone(),
attestation_reader: indexer_api.attestation_reader.clone(),
};
tokio::spawn(async move {
if let Err(e) =
monitor_attestation_removal(submitter, account_id_clone, tee_accounts_receiver).await
{
tracing::error!(
error = ?e,
"attestation removal monitoring task failed"
);
}
});
let mut attestation_interval = tokio::time::interval(ATTESTATION_RESUBMISSION_INTERVAL);
// A failed submission can retry internally for longer than the interval; skip the missed
// ticks instead of bursting stale submissions afterwards
attestation_interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip);
tokio::spawn(periodic_attestation_submission(
submitter.clone(),
attestation_interval,
));
Comment thread
pbeza marked this conversation as resolved.
Outdated
tokio::spawn(monitor_attestation_removal(
submitter,
config.my_near_account_id.clone(),
indexer_api.attested_nodes_receiver.clone(),
));

let keyshare_storage: Arc<RwLock<KeyshareStorage>> =
RwLock::new(key_storage_config.create().await?).into();
Expand Down
Loading