Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
aa864ef
chore: merge all local branches
hmzakhalid Jan 12, 2026
e7202e2
chore: remove deplicate tests
hmzakhalid Jan 12, 2026
1f09752
chore: prettier lint
hmzakhalid Jan 12, 2026
cbd5dbb
chore: reduce code complexity lint errors
hmzakhalid Jan 13, 2026
92e74fc
chore: remove E3Lifecycle contract
hmzakhalid Jan 16, 2026
df358e9
chore: update refund manager
hmzakhalid Jan 16, 2026
cda69e6
chore: move lifcycle to enclave interface and update refund manager c…
hmzakhalid Jan 16, 2026
051f011
feat: merge lifecycle with enclave
hmzakhalid Jan 16, 2026
d4889c0
feat: update lifecycle deployment with enclave
hmzakhalid Jan 18, 2026
2f768d7
feat: update all tests
hmzakhalid Jan 19, 2026
0041cb3
feat: update all tests
hmzakhalid Jan 19, 2026
eb8f096
feat: update all tests
hmzakhalid Jan 19, 2026
755303a
fix: type error for committeeDeadline
hmzakhalid Jan 20, 2026
e7cf1ce
fix: apply review fixes
hmzakhalid Jan 20, 2026
79f12a9
fix: remove bool return from setters
hmzakhalid Jan 20, 2026
c6282f9
fix: prttier
hmzakhalid Jan 20, 2026
4aeac59
fix: ciphernode threshold
hmzakhalid Jan 20, 2026
33992ff
feat: add active ciphernodes check to e3Request
hmzakhalid Jan 20, 2026
0d1f539
fix: apply review suggestion
hmzakhalid Jan 20, 2026
1a858d5
fix: update contract address
hmzakhalid Jan 22, 2026
aab74c1
fix: update contract address
hmzakhalid Jan 22, 2026
bb08ce5
fix: update integration duration
hmzakhalid Jan 22, 2026
5a2789b
refactor: move publishInput to e3program [skip-line-limit] (#1181)
ctrlc03 Jan 28, 2026
ebe540a
refactor: remove activate step [skip-line-limit] (#1257)
ctrlc03 Feb 5, 2026
ffc4b9a
chore: conflicts
ctrlc03 Feb 9, 2026
b6e5f18
feat: add e3 stage tracking to ciphernode
hmzakhalid Feb 9, 2026
4b6c892
feat: decrement e3 job
hmzakhalid Feb 9, 2026
ba31795
fix: review comments
hmzakhalid Feb 10, 2026
82349cd
fix: add grace period
hmzakhalid Feb 10, 2026
b36e2ed
Merge branch 'main' into feature/e3-refund-timeout-mechanism
hmzakhalid Feb 10, 2026
b7dbfcb
chore: add publish input task for program
ctrlc03 Feb 10, 2026
77b21d4
chore: add license
ctrlc03 Feb 10, 2026
569ca7e
fix: imports
ctrlc03 Feb 10, 2026
11394d8
fix: emit e3 failed
hmzakhalid Feb 10, 2026
bbf14c6
Merge branch 'main' into feature/e3-refund-timeout-mechanism
hmzakhalid Feb 10, 2026
fea80b5
Merge branch 'main' into feature/e3-refund-timeout-mechanism
hmzakhalid Feb 10, 2026
2375717
Merge branch 'main' into feature/e3-refund-timeout-mechanism
hmzakhalid Feb 10, 2026
c606a2a
Merge branch 'main' into feature/e3-refund-timeout-mechanism
hmzakhalid Feb 10, 2026
a7bd215
fix: increase time duration
hmzakhalid Feb 10, 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
10 changes: 5 additions & 5 deletions crates/aggregator/src/committee_finalizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Handler<CommitteeRequested> for CommitteeFinalizer {

fn handle(&mut self, msg: CommitteeRequested, ctx: &mut Self::Context) -> Self::Result {
let e3_id = msg.e3_id.clone();
let submission_deadline = msg.submission_deadline;
let committee_deadline = msg.committee_deadline;

const FINALIZATION_BUFFER_SECONDS: u64 = 1;

Expand All @@ -85,12 +85,12 @@ impl Handler<CommitteeRequested> for CommitteeFinalizer {
fut.into_actor(self)
.then(move |current_timestamp, act, ctx| {
if let Some(current_timestamp) = current_timestamp {
let seconds_until_deadline = if submission_deadline > current_timestamp {
(submission_deadline - current_timestamp) + FINALIZATION_BUFFER_SECONDS
let seconds_until_deadline = if committee_deadline > current_timestamp {
(committee_deadline - current_timestamp) + FINALIZATION_BUFFER_SECONDS
} else {
info!(
e3_id = %e3_id_for_async,
submission_deadline = submission_deadline,
committee_deadline = committee_deadline,
current_timestamp = current_timestamp,
"Submission deadline already passed, finalizing with buffer"
);
Expand All @@ -99,7 +99,7 @@ impl Handler<CommitteeRequested> for CommitteeFinalizer {

info!(
e3_id = %e3_id_for_async,
submission_deadline = submission_deadline,
committee_deadline = committee_deadline,
current_timestamp = current_timestamp,
seconds_to_wait = seconds_until_deadline,
"Scheduling committee finalization"
Expand Down
6 changes: 3 additions & 3 deletions crates/events/src/enclave_event/committee_requested.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ pub struct CommitteeRequested {
pub seed: Seed,
pub threshold: [usize; 2],
pub request_block: u64,
pub submission_deadline: u64,
pub committee_deadline: u64,
pub chain_id: u64,
}

impl Display for CommitteeRequested {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"e3_id: {}, seed: {:?}, threshold: [{}, {}], request_block: {}, submission_deadline: {}, chain_id: {}",
self.e3_id, self.seed, self.threshold[0], self.threshold[1], self.request_block, self.submission_deadline, self.chain_id
"e3_id: {}, seed: {:?}, threshold: [{}, {}], request_block: {}, committee_deadline: {}, chain_id: {}",
self.e3_id, self.seed, self.threshold[0], self.threshold[1], self.request_block, self.committee_deadline, self.chain_id
)
}
}
58 changes: 58 additions & 0 deletions crates/events/src/enclave_event/e3_failed.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// 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.

use crate::E3id;
use actix::Message;
use serde::{Deserialize, Serialize};
use std::fmt::{self, Display};

/// Reason why an E3 failed
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum FailureReason {
None,
CommitteeFormationTimeout,
InsufficientCommitteeMembers,
DKGTimeout,
DKGInvalidShares,
NoInputsReceived,
ComputeTimeout,
ComputeProviderExpired,
ComputeProviderFailed,
RequesterCancelled,
DecryptionTimeout,
DecryptionInvalidShares,
VerificationFailed,
}

/// E3 lifecycle stage
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum E3Stage {
None,
Requested,
CommitteeFinalized,
KeyPublished,
CiphertextReady,
Complete,
Failed,
}

#[derive(Message, Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[rtype(result = "()")]
pub struct E3Failed {
pub e3_id: E3id,
pub failed_at_stage: E3Stage,
pub reason: FailureReason,
}

impl Display for E3Failed {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"E3Failed {{ e3_id: {}, stage: {:?}, reason: {:?} }}",
self.e3_id, self.failed_at_stage, self.reason
)
}
}
31 changes: 31 additions & 0 deletions crates/events/src/enclave_event/e3_stage_changed.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// 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.

use crate::E3id;
use actix::Message;
use serde::{Deserialize, Serialize};
use std::fmt::{self, Display};

// Re-export E3Stage from e3_failed to avoid duplication
pub use super::e3_failed::E3Stage;

#[derive(Message, Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[rtype(result = "()")]
pub struct E3StageChanged {
pub e3_id: E3id,
pub previous_stage: E3Stage,
pub new_stage: E3Stage,
}

impl Display for E3StageChanged {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"E3StageChanged {{ e3_id: {}, {:?} -> {:?} }}",
self.e3_id, self.previous_stage, self.new_stage
)
}
}
10 changes: 10 additions & 0 deletions crates/events/src/enclave_event/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ mod compute_request;
mod configuration_updated;
mod decryptionshare_created;
mod die;
mod e3_failed;
mod e3_request_complete;
mod e3_requested;
mod e3_stage_changed;
mod enclave_error;
mod encryption_key_collection_failed;
mod encryption_key_created;
Expand Down Expand Up @@ -57,8 +59,10 @@ pub use compute_request::*;
pub use configuration_updated::*;
pub use decryptionshare_created::*;
pub use die::*;
pub use e3_failed::*;
pub use e3_request_complete::*;
pub use e3_requested::*;
pub use e3_stage_changed::*;
use e3_utils::{colorize, Color};
pub use enclave_error::*;
pub use encryption_key_collection_failed::*;
Expand Down Expand Up @@ -206,6 +210,8 @@ pub enum EnclaveEventData {
PlaintextOutputPublished(PlaintextOutputPublished),
EnclaveError(EnclaveError),
E3RequestComplete(E3RequestComplete),
E3Failed(E3Failed),
E3StageChanged(E3StageChanged),
Shutdown(Shutdown),
DocumentReceived(DocumentReceived),
ThresholdShareCreated(ThresholdShareCreated),
Expand Down Expand Up @@ -432,6 +438,8 @@ impl EnclaveEventData {
EnclaveEventData::TicketSubmitted(ref data) => Some(data.e3_id.clone()),
EnclaveEventData::EncryptionKeyCreated(ref data) => Some(data.e3_id.clone()),
EnclaveEventData::ComputeResponse(ref data) => Some(data.e3_id.clone()),
EnclaveEventData::E3Failed(ref data) => Some(data.e3_id.clone()),
EnclaveEventData::E3StageChanged(ref data) => Some(data.e3_id.clone()),
_ => None,
}
}
Expand Down Expand Up @@ -469,6 +477,8 @@ impl_event_types!(
PlaintextAggregated,
PublishDocumentRequested,
E3RequestComplete,
E3Failed,
E3StageChanged,
CiphernodeSelected,
CiphernodeAdded,
CiphernodeRemoved,
Expand Down
Loading
Loading