mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 21:38:31 +00:00
Update slashing protection interchange to v5 (#1816)
## Proposed Changes Update the slashing protection interchange format to v5 in preparation for finalisation as part of an EIP. Also, add some more tests and update the commit hash for https://github.com/eth2-clients/slashing-protection-interchange-tests to include the new generated tests.
This commit is contained in:
@@ -3,16 +3,9 @@ use std::collections::HashSet;
|
||||
use std::iter::FromIterator;
|
||||
use types::{Epoch, Hash256, PublicKey, Slot};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum InterchangeFormat {
|
||||
Complete,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct InterchangeMetadata {
|
||||
pub interchange_format: InterchangeFormat,
|
||||
#[serde(with = "serde_utils::quoted_u64::require_quotes")]
|
||||
pub interchange_format_version: u64,
|
||||
pub genesis_validators_root: Hash256,
|
||||
@@ -20,7 +13,7 @@ pub struct InterchangeMetadata {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct CompleteInterchangeData {
|
||||
pub struct InterchangeData {
|
||||
pub pubkey: PublicKey,
|
||||
pub signed_blocks: Vec<SignedBlock>,
|
||||
pub signed_attestations: Vec<SignedAttestation>,
|
||||
@@ -49,7 +42,7 @@ pub struct SignedAttestation {
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
||||
pub struct Interchange {
|
||||
pub metadata: InterchangeMetadata,
|
||||
pub data: Vec<CompleteInterchangeData>,
|
||||
pub data: Vec<InterchangeData>,
|
||||
}
|
||||
|
||||
impl Interchange {
|
||||
|
||||
Reference in New Issue
Block a user