1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! `ParticipationFlags` — 3-bit Ethereum-Altair-parity attestation
//! flag bitmask.
//!
//! Traces to: [SPEC §3.10, §2.9](../../../docs/resources/SPEC.md),
//! catalogue row
//! [DSL-074](../../../docs/requirements/domains/participation/specs/DSL-074.md).
//!
//! # Bit layout
//!
//! | Bit | Flag | Set iff |
//! |-----|---------------------|---------|
//! | 0 | `TIMELY_SOURCE` | attestation's source matches the finalised checkpoint AND inclusion within `SLOTS_PER_EPOCH` of the target |
//! | 1 | `TIMELY_TARGET` | attestation's target matches the expected target root AND inclusion within `SLOTS_PER_EPOCH * SLOTS_PER_EPOCH` |
//! | 2 | `TIMELY_HEAD` | inclusion delay == 1 |
//!
//! Bits 3–7 are RESERVED — consumers MUST NOT assume they are
//! zero across serialisation roundtrips (serde preserves the
//! full `u8`).
use ;
use crate;
/// Per-validator attestation-participation bitmask.
///
/// Implements [DSL-074](../../../docs/requirements/domains/participation/specs/DSL-074.md).
/// Traces to SPEC §3.10.
///
/// # Operations
///
/// - `set(flag_index)` — additive OR; idempotent.
/// - `has(flag_index)` — read.
/// - `is_source_timely` / `is_target_timely` / `is_head_timely`
/// — named accessors mirroring Ethereum Altair nomenclature
/// (spec §2.9).
///
/// # Design rationale
///
/// Using a single `u8` keeps the state tracker's per-validator
/// storage at 1 byte — critical for the `ParticipationTracker`
/// (DSL-078) which holds two epochs' worth of flags for every
/// validator in the active set (millions of entries at scale).
///
/// # Default
///
/// `ParticipationFlags::default()` → all bits zero. Matches a
/// validator that has not yet been credited with any flag in the
/// current epoch.
;