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
8 changes: 8 additions & 0 deletions contracts/claims-processor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2366,6 +2366,14 @@ impl ClaimsProcessor {
);
}

/// Retrieve original claim context preserved during escalation (#691).
pub fn get_escalated_claim_context(env: Env, claim_id: u128) -> Claim {
env.storage()
.persistent()
.get(&StorageKey::Claim(claim_id))
.unwrap_or_else(|| panic_with_error!(&env, Error::ClaimNotFound))
}

/// Claim IDs that are Pending and past the escalation threshold.
///
/// Lets a monitoring job find stuck claims in one call rather than probing
Expand Down
12 changes: 12 additions & 0 deletions contracts/governance-dao/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1913,6 +1913,18 @@ impl GovernanceDao {
Self::participation_history(&env)
}

/// Cap participation history and evict old entries to prevent unbounded storage growth (#690).
pub fn prune_participation_history(env: Env, max_entries: u32) {
let mut history = Self::participation_history(&env);
let cap = max_entries.min(MAX_PARTICIPATION_WINDOW);
while history.recent_bps.len() > cap {
history.recent_bps.pop_front();
}
env.storage()
.instance()
.set(&StorageKey::Participation, &history);
}

/// The quorum that would be applied to a proposal finalized right now,
/// and the participation figure behind it.
///
Expand Down
5 changes: 5 additions & 0 deletions contracts/oracle-verifier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2604,6 +2604,11 @@ impl OracleVerifier {
.unwrap_or_else(|| Vec::new(&env))
}

/// Resolve conflicting oracle readings for the same key using consensus/median (#689).
pub fn resolve_conflicting_readings(env: Env, data_type: Symbol, key: Symbol) -> i128 {
Self::get_median_value(&env, &data_type, &key)
}

// ── Verification ─────────────────────────────────────────────────────────

/// Evaluate whether the aggregated oracle value satisfies a trigger condition.
Expand Down
4 changes: 4 additions & 0 deletions contracts/risk-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,10 @@ impl RiskPool {
if base_fee_bps > 10000 || max_fee_bps > 10000 || min_fee_bps > 10000 {
panic_with_error!(&env, Error::InvalidParameter);
}
// Enforce minimum fee floor and reject zero fee config (#688)
if min_fee_bps == 0 || base_fee_bps == 0 {
panic_with_error!(&env, Error::InvalidParameter);
}
if min_fee_bps > base_fee_bps || base_fee_bps > max_fee_bps {
panic_with_error!(&env, Error::InvalidParameter);
}
Expand Down
Loading