Skip to content

Commit

Permalink
adds frozen_abi annotations to repair service enums/structs (solana-l…
Browse files Browse the repository at this point in the history
…abs#29820)

... in order to keep types backward compatible.
  • Loading branch information
behzadnouri authored Jan 23, 2023
1 parent 206a1c7 commit bd9b311
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions core/src/serve_repair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ impl AncestorHashesRepairType {
}
}

#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, AbiEnumVisitor, AbiExample, Deserialize, Serialize)]
#[frozen_abi(digest = "AKpurCovzn6rsji4aQrP3hUdEHxjtXUfT7AatZXN7Rpz")]
pub enum AncestorHashesResponse {
Hashes(Vec<SlotHash>),
Ping(Ping),
Expand Down Expand Up @@ -182,7 +183,7 @@ struct ServeRepairStats {
err_id_mismatch: usize,
}

#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, AbiExample, Deserialize, Serialize)]
pub struct RepairRequestHeader {
signature: Signature,
sender: Pubkey,
Expand All @@ -206,7 +207,8 @@ impl RepairRequestHeader {
pub(crate) type Ping = ping_pong::Ping<[u8; REPAIR_PING_TOKEN_SIZE]>;

/// Window protocol messages
#[derive(Serialize, Deserialize, Debug)]
#[derive(Debug, AbiEnumVisitor, AbiExample, Deserialize, Serialize)]
#[frozen_abi(digest = "3bgE3sYHRqetvpo4fcDL6PTV3z2LMAtY6H8BoLFSjCwf")]
pub enum RepairProtocol {
LegacyWindowIndex(LegacyContactInfo, Slot, u64),
LegacyHighestWindowIndex(LegacyContactInfo, Slot, u64),
Expand Down Expand Up @@ -236,7 +238,8 @@ pub enum RepairProtocol {
},
}

#[derive(Serialize, Deserialize, Debug)]
#[derive(Debug, AbiEnumVisitor, AbiExample, Deserialize, Serialize)]
#[frozen_abi(digest = "CkffjyMPCwuJgk9NiCMELXLCecAnTPZqpKEnUCb3VyVf")]
pub(crate) enum RepairResponse {
Ping(Ping),
}
Expand Down

0 comments on commit bd9b311

Please sign in to comment.