Skip to content

Conversation

@ksn6
Copy link
Contributor

@ksn6 ksn6 commented Sep 11, 2025

Problem

To get fast leader handover rolling (#293), we need to send out ParentReadyUpdate messages. These are of type BlockComponent::VersionedBlockMarker, which are currently entirely discarded.

Summary of Changes

  • Rather than discarding block markers by turning shreds into a flattened Vec<Entry>, we turn shreds into a Vec<BlockComponent> vector
  • For now, we preserve the remainder of Agave code. In the next PR, we'll:
    • Store special block marker types in blocks
    • Split logic between processing Vec<Entry> and Vec<BlockComponent> when necessary

@ksn6 ksn6 marked this pull request as ready for review September 11, 2025 10:17
@ksn6 ksn6 changed the title feat: don't discard BlockComponent::VersionedBlockMarker's feat: don't discard BlockComponent::VersionedBlockMarkers Sep 11, 2025
@ksn6 ksn6 enabled auto-merge (squash) September 11, 2025 10:36
@bw-solana
Copy link
Contributor

Any reason not to develop this in the upstream (Agave) repo?

@ksn6 ksn6 force-pushed the get-blockstore-to-store-block-components branch from cdfdd1b to 03dc5a4 Compare September 12, 2025 02:45
@ksn6
Copy link
Contributor Author

ksn6 commented Sep 12, 2025

Any reason not to develop this in the upstream (Agave) repo?

Discussed offline, updating the thread here - prior to developing this in agave, we'll want to:

(0) wait for solana-foundation/solana-improvement-documents#337 to pass
(1) upstream BlockComponent to agave; in particular, with the ParentReadyUpdate special marker

@ksn6 ksn6 force-pushed the get-blockstore-to-store-block-components branch from 03dc5a4 to 590db03 Compare October 3, 2025 03:53
Comment on lines +4167 to +4174
pub fn get_components_in_data_block(
&self,
slot: Slot,
range: Range<u32>,
slot_meta: Option<&SlotMeta>,
) -> Result<Vec<BlockComponent>> {
self.get_slot_components_in_block(slot, vec![range], slot_meta)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

does this just wrap range in a vec? Could we just do this inside get_entries_in_data_block?

.into_iter()
.filter_map(|component| component.into_entries())
.flatten()
.collect()
Copy link
Contributor

Choose a reason for hiding this comment

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

oof. The double alloc is pain. But I think we already do this upstream

Comment on lines +3926 to +3933
pub fn get_slot_components(
&self,
slot: Slot,
shred_start_index: u64,
) -> Result<Vec<BlockComponent>> {
self.get_slot_components_with_shred_info(slot, shred_start_index, false)
.map(|x| x.0)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could probably live without this shim layer as well, but I guess it's fine

@ksn6
Copy link
Contributor Author

ksn6 commented Oct 8, 2025

Will resume this once I have code working that's able to successfully disseminate block markers around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants