Skip to content

Commit e09c007

Browse files
authored
uses the wincode feature from the solana-hash crate (#10683)
use the wincode feature in solana-hash
1 parent fb1582b commit e09c007

File tree

8 files changed

+9
-22
lines changed

8 files changed

+9
-22
lines changed

dev-bins/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

entry/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ serde = { workspace = true }
3232
solana-address = { workspace = true }
3333
solana-bls-signatures = { workspace = true }
3434
solana-clock = { workspace = true }
35-
solana-hash = { workspace = true }
35+
solana-hash = { workspace = true, features = ["wincode"] }
3636
solana-measure = { workspace = true }
3737
solana-merkle-tree = { workspace = true }
3838
solana-message = { workspace = true }

entry/src/block_component.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ pub enum BlockComponentError {
204204
/// Block production metadata. User agent is capped at 255 bytes.
205205
#[derive(Clone, PartialEq, Eq, Debug, SchemaWrite, SchemaRead)]
206206
pub struct BlockFooterV1 {
207-
#[wincode(with = "Pod<Hash>")]
208207
pub bank_hash: Hash,
209208
pub block_producer_time_nanos: u64,
210209
#[wincode(with = "WincodeVec<u8, FixIntLen<u8>>")]
@@ -217,22 +216,19 @@ pub struct BlockFooterV1 {
217216
#[derive(Clone, PartialEq, Eq, Debug, SchemaWrite, SchemaRead)]
218217
pub struct BlockHeaderV1 {
219218
pub parent_slot: Slot,
220-
#[wincode(with = "Pod<Hash>")]
221219
pub parent_block_id: Hash,
222220
}
223221

224222
#[derive(Clone, PartialEq, Eq, Debug, SchemaWrite, SchemaRead)]
225223
pub struct UpdateParentV1 {
226224
pub new_parent_slot: Slot,
227-
#[wincode(with = "Pod<Hash>")]
228225
pub new_parent_block_id: Hash,
229226
}
230227

231228
/// Attests to genesis block finalization with a BLS aggregate signature.
232229
#[derive(Clone, PartialEq, Eq, Debug, SchemaWrite, SchemaRead)]
233230
pub struct GenesisCertificate {
234231
pub slot: Slot,
235-
#[wincode(with = "Pod<Hash>")]
236232
pub block_id: Hash,
237233
#[wincode(with = "Pod<BLSSignature>")]
238234
pub bls_signature: BLSSignature,
@@ -281,7 +277,6 @@ impl From<GenesisCertificate> for Certificate {
281277
#[derive(Clone, PartialEq, Eq, Debug, SchemaWrite, SchemaRead)]
282278
pub struct FinalCertificate {
283279
pub slot: Slot,
284-
#[wincode(with = "Pod<Hash>")]
285280
pub block_id: Hash,
286281
pub final_aggregate: VotesAggregate,
287282
pub notar_aggregate: Option<VotesAggregate>,

entry/src/entry.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ use {
2222
sync::{Arc, Once, OnceLock},
2323
time::Instant,
2424
},
25-
wincode::{
26-
containers::{Pod, Vec as WincodeVec},
27-
len::BincodeLen,
28-
SchemaRead, SchemaWrite,
29-
},
25+
wincode::{containers::Vec as WincodeVec, len::BincodeLen, SchemaRead, SchemaWrite},
3026
};
3127

3228
pub type EntrySender = Sender<Vec<Entry>>;
@@ -119,7 +115,6 @@ pub struct Entry {
119115
pub num_hashes: u64,
120116

121117
/// The SHA-256 hash `num_hashes` after the previous Entry ID.
122-
#[wincode(with = "Pod<Hash>")]
123118
pub hash: Hash,
124119

125120
/// An unordered list of transactions that were observed before the Entry ID was

votor-messages/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ solana-frozen-abi = { workspace = true, optional = true, features = [
3939
solana-frozen-abi-macro = { workspace = true, optional = true, features = [
4040
"frozen-abi",
4141
] }
42-
solana-hash = { workspace = true, features = ["serde", "copy", "decode"] }
42+
solana-hash = { workspace = true, features = ["serde", "copy", "decode", "wincode"] }
4343
solana-pubkey = { workspace = true }
4444
solana-signer-store = { workspace = true }
4545
thiserror = { workspace = true }

votor-messages/src/consensus_message.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ pub enum CertificateType {
5454
/// Finalize certificate
5555
Finalize(Slot),
5656
/// Fast finalize certificate
57-
FinalizeFast(Slot, #[wincode(with = "Pod<Hash>")] Hash),
57+
FinalizeFast(Slot, Hash),
5858
/// Notarize certificate
59-
Notarize(Slot, #[wincode(with = "Pod<Hash>")] Hash),
59+
Notarize(Slot, Hash),
6060
/// Notarize fallback certificate
61-
NotarizeFallback(Slot, #[wincode(with = "Pod<Hash>")] Hash),
61+
NotarizeFallback(Slot, Hash),
6262
/// Skip certificate
6363
Skip(Slot),
6464
/// Genesis certificate
65-
Genesis(Slot, #[wincode(with = "Pod<Hash>")] Hash),
65+
Genesis(Slot, Hash),
6666
}
6767

6868
impl CertificateType {

votor-messages/src/reward_certificate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ pub struct NotarRewardCertificate {
7575
/// The slot the certificate is for.
7676
pub slot: Slot,
7777
/// The block id the certificate is for.
78-
#[wincode(with = "Pod<Hash>")]
7978
pub block_id: Hash,
8079
/// The signature.
8180
#[wincode(with = "Pod<BLSSignatureCompressed>")]

votor-messages/src/vote.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use {
33
serde::{Deserialize, Serialize},
44
solana_clock::Slot,
55
solana_hash::Hash,
6-
wincode::{containers::Pod, SchemaRead, SchemaWrite},
6+
wincode::{SchemaRead, SchemaWrite},
77
};
88

99
/// Enum that clients can use to parse and create the vote
@@ -208,7 +208,6 @@ pub struct NotarizationVote {
208208
/// The slot this vote is cast for.
209209
pub slot: Slot,
210210
/// The block id this vote is for.
211-
#[wincode(with = "Pod<Hash>")]
212211
pub block_id: Hash,
213212
}
214213

@@ -285,7 +284,6 @@ pub struct NotarizationFallbackVote {
285284
/// The slot this vote is cast for.
286285
pub slot: Slot,
287286
/// The block id this vote is for.
288-
#[wincode(with = "Pod<Hash>")]
289287
pub block_id: Hash,
290288
}
291289

@@ -336,6 +334,5 @@ pub struct GenesisVote {
336334
/// The slot this vote is cast for.
337335
pub slot: Slot,
338336
/// The block id this vote is for.
339-
#[wincode(with = "Pod<Hash>")]
340337
pub block_id: Hash,
341338
}

0 commit comments

Comments
 (0)