Skip to main content

hotmint_types/
evidence.rs

1use serde::{Deserialize, Serialize};
2
3use crate::block::BlockHash;
4use crate::crypto::Signature;
5use crate::validator::ValidatorId;
6use crate::view::ViewNumber;
7use crate::vote::VoteType;
8
9/// Proof that a validator voted for two different blocks in the same (view, vote_type).
10#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct EquivocationProof {
12    pub validator: ValidatorId,
13    pub view: ViewNumber,
14    pub vote_type: VoteType,
15    /// Epoch in which the equivocation occurred. Required for cross-epoch
16    /// evidence verification (the signing_bytes include epoch).
17    #[serde(default)]
18    pub epoch: crate::epoch::EpochNumber,
19    pub block_hash_a: BlockHash,
20    pub signature_a: Signature,
21    pub block_hash_b: BlockHash,
22    pub signature_b: Signature,
23}