/ node / consensus / src / clp / mod.rs
mod.rs
 1  // Copyright (c) 2025-2026 ACDC Network
 2  // This file is part of the alphaos library.
 3  //
 4  // Alpha Chain | Delta Chain Protocol
 5  // International Monetary Graphite.
 6  //
 7  // Derived from Aleo (https://aleo.org) and ProvableHQ (https://provable.com).
 8  // They built world-class ZK infrastructure. We installed the EASY button.
 9  // Their cryptography: elegant. Our modifications: bureaucracy-compatible.
10  // Original brilliance: theirs. Robert's Rules: ours. Bugs: definitely ours.
11  //
12  // Original Aleo/ProvableHQ code subject to Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0
13  // All modifications and new work: CC0 1.0 Universal Public Domain Dedication.
14  // No rights reserved. No permission required. No warranty. No refunds.
15  //
16  // https://creativecommons.org/publicdomain/zero/1.0/
17  // SPDX-License-Identifier: CC0-1.0
18  
19  //! # Continuous Liveness Proof (CLP) System
20  //!
21  //! CLP ensures validator availability through periodic cryptographic challenges.
22  //! This is specific to the ALPHA chain for validator liveness monitoring.
23  //!
24  //! ## Parameters
25  //!
26  //! | Parameter | Value | Description |
27  //! |-----------|-------|-------------|
28  //! | CLP_INTERVAL | 60 seconds | Time between challenges |
29  //! | CLP_RESPONSE_WINDOW | 30 seconds | Maximum response time |
30  //! | CLP_GRACE_PERIOD | 2 challenges | Missed challenges before counting |
31  //! | CLP_DISQUALIFICATION_EPOCHS | 3 | Consecutive failures for ejection |
32  //! | CLP_FAILURE_SLASH_BPS | 100 (1%) | Stake slashed for CLP failure |
33  //!
34  //! ## Flow
35  //!
36  //! 1. Every CLP_INTERVAL, a challenge is generated from block hash + epoch + round
37  //! 2. All validators must respond within CLP_RESPONSE_WINDOW
38  //! 3. Responses are collected and included in the next block
39  //! 4. At epoch boundary, response rates are evaluated
40  //! 5. Validators with low response rates are penalized
41  
42  pub mod aggregator;
43  pub mod challenge;
44  pub mod gossip;
45  pub mod manager;
46  pub mod penalty;
47  pub mod response;
48  pub mod slashing;
49  pub mod types;
50  
51  pub use aggregator::*;
52  pub use challenge::*;
53  pub use gossip::*;
54  pub use manager::*;
55  pub use penalty::*;
56  pub use response::*;
57  pub use slashing::*;
58  pub use types::*;