Skip to main content

COST_MICROS_MAX

Constant COST_MICROS_MAX 

Source
pub const COST_MICROS_MAX: u64 = _; // 9_000_000_000_000_000u64
Expand description

Upper bound for cumulative cost_usd_micros counters, aligned with av_atif::validate::MAX_COST_USD (9e9 USD). Introduced in R69 to close R64 F3: the recovery folds in av-harness/src/worker.rs gated cost_usd_micros on av_core::error::JCS_SAFE_MAX (2^53 = ~$9.007e9 micro-scaled), while the strict ATIF validator refuses any total_cost_usd > 9e9. The $7.2M gap between the two ceilings (JCS_SAFE_MAX / USD_MICROS_PER_DOLLAR = 9,007,199 USD past 9e9) meant a hostile / drift-authenticated journal replay whose summed costs landed in the window would fold cleanly through recovery (fold says “safe”), then the very next av_atif::write_atomic call would strict-refuse the trajectory — the session became un-writable across every reconciler tick. Tightening the fold cost cap to 9e9 * USD_MICROS_PER_DOLLAR = 9e15 micros (still safely below JCS_SAFE_MAX = 9.007e15) means any cost that passes the fold also passes ATIF strict validation.