Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
pr feedback u64::from
  • Loading branch information
AshwinSekar committed Nov 30, 2023
commit 2461df42a722c8799e393e42dffcdc8a74d3c45f
4 changes: 2 additions & 2 deletions ledger/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ impl Blockstore {

fn erasure_meta(&self, erasure_set: ErasureSetId) -> Result<Option<ErasureMeta>> {
let (slot, fec_set_index) = erasure_set.store_key();
self.erasure_meta_cf.get((slot, fec_set_index as u64))
self.erasure_meta_cf.get((slot, u64::from(fec_set_index)))
}

fn merkle_root_meta(&self, erasure_set: ErasureSetId) -> Result<Option<MerkleRootMeta>> {
Expand Down Expand Up @@ -1020,7 +1020,7 @@ impl Blockstore {

for (erasure_set, erasure_meta) in erasure_metas {
let (slot, fec_set_index) = erasure_set.store_key();
write_batch.put::<cf::ErasureMeta>((slot, fec_set_index as u64), &erasure_meta)?;
write_batch.put::<cf::ErasureMeta>((slot, u64::from(fec_set_index)), &erasure_meta)?;
}

for (erasure_set, merkle_root_meta) in merkle_root_metas {
Expand Down
1 change: 1 addition & 0 deletions ledger/src/shred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ impl ErasureSetId {
}

// Storage key for ErasureMeta and MerkleRootMeta in blockstore db.
// Note: ErasureMeta column uses u64 so this will need to be typecast
pub(crate) fn store_key(&self) -> (Slot, /*fec_set_index:*/ u32) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a comment here that ErasureMeta uses u64 for fec_set_index?

(self.0, self.1)
}
Expand Down