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
//! `SignedBlockHeader` + `ProposerSlashing` — proposer-side evidence types.
//!
//! Traces to: [SPEC.md §3.4](../../docs/resources/SPEC.md), catalogue rows
//! [DSL-009](../../docs/requirements/domains/evidence/specs/DSL-009.md) +
//! [DSL-013](../../docs/requirements/domains/evidence/specs/DSL-013.md).
//!
//! # Role
//!
//! Carries `dig_block::L2BlockHeader` (the canonical L2 block header) +
//! its 96-byte BLS G2 signature. Consumed by:
//!
//! - `ProposerSlashing` (DSL-013) — equivocation requires TWO `SignedBlockHeader`s
//! at the same slot with matching proposer but different messages.
//! - `InvalidBlockProof` (DSL-018) — invalid-block evidence carries ONE.
//!
//! # Scope
//!
//! Passive wire carrier. This file is `serde` + `PartialEq` only — NO
//! cryptographic verification. Signature-width enforcement, BLS verify,
//! and message re-derivation all live DOWNSTREAM in the verifiers:
//!
//! - `verify_proposer_slashing` (DSL-013) runs `chia_bls::Signature::from_bytes`
//! which rejects widths != `BLS_SIGNATURE_SIZE`.
//! - `verify_invalid_block` (DSL-018) runs the same check.
//!
//! Keeping the type passive lets construct/serde work uniformly across
//! valid AND structurally-malformed inputs — critical for fuzzers and
//! property-based tests (`proptest`).
//!
//! # Wire layout
//!
//! - `message`: `dig_block::L2BlockHeader` — NOT redefined here. Full
//! type identity with `dig-block` so cross-crate consumers (validator,
//! mempool) round-trip the same bytes.
//! - `signature`: `Vec<u8>` annotated `#[serde(with = "serde_bytes")]`.
//! JSON emits a byte-string (not a 96-element integer array), keeping
//! REMARK payloads (DSL-102, DSL-110) compact.
use L2BlockHeader;
use ;
/// Block header + BLS signature pair.
///
/// Per [SPEC §3.4](../../docs/resources/SPEC.md). Length of `signature`
/// is NOT enforced here — see module docs for the rationale + the
/// downstream enforcement points.
/// Proposer-equivocation evidence: two signed headers at the same slot
/// from the same proposer with distinct content.
///
/// Per [SPEC §3.4](../../docs/resources/SPEC.md). Carried as
/// `SlashingEvidencePayload::Proposer` in the envelope (DSL-002 / DSL-010).
///
/// # Scope
///
/// Passive wire carrier. The semantic equivocation predicate —
/// `same_slot && same_proposer && signed_header_a != signed_header_b` —
/// is enforced DOWNSTREAM by `verify_proposer_slashing` (DSL-013). This
/// type will serde-roundtrip ANY pair of `SignedBlockHeader` values,
/// including identical ones, empty signatures, or mismatched proposers.