Skip to content

SIMD-0366: Enforce DATA_COMPLETE_SHRED Placement only on Last Data Shreds in FEC Sets#366

Closed
ksn6 wants to merge 5 commits into
solana-foundation:mainfrom
ksn6:0364-enforce-data-complete-shred-placement
Closed

SIMD-0366: Enforce DATA_COMPLETE_SHRED Placement only on Last Data Shreds in FEC Sets#366
ksn6 wants to merge 5 commits into
solana-foundation:mainfrom
ksn6:0364-enforce-data-complete-shred-placement

Conversation

@ksn6
Copy link
Copy Markdown
Contributor

@ksn6 ksn6 commented Sep 21, 2025

Summary

This SIMD enforces that the DATA_COMPLETE_SHRED flag can only be set on the final data shred within an FEC (Forward Error Correction) set. One key use-case for this SIMD: this restriction enables efficient detection of soon-to-be-introduced BlockComponents at shred ingestion time, providing performance improvements for critical consensus operations. The alternative to this SIMD would be to detect BlockComponents during replay, which would be substantially slower. One key example is UpdateParent detection in Alpenglow's fast leader handover; detection during replay would not be ideal, as malicious leaders could intentionally misplace DATA_COMPLETE_SHRED flags to force validators into expensive search operations, creating DoS attack vectors and delaying block repairs.

Motivation

Currently, the DATA_COMPLETE_SHRED flag can theoretically be set on any data shred within an FEC set, though in practice it marks FEC set boundaries. This ambiguity creates significant performance challenges:

  1. Expensive BlockComponent Detection: Without guaranteed placement, detecting BlockComponents requires expensive searches across multiple shreds and FEC sets.

  2. Performance Impact: alternative BlockComponent methods require either complex inference algorithms or expensive replay operations.

  3. Security Vulnerabilities: Malicious leaders could intentionally misplace DATA_COMPLETE_SHRED flags to force validators into expensive search operations, creating DoS attack vectors; for certain proposed BlockComponents (specifically, UpdateParent), malicious leaders could delay block repairs for following leaders.

By enforcing DATA_COMPLETE_SHRED placement only on the last data shred in each FEC set, validators can efficiently detect BlockComponent boundaries during online shred ingestion.

@ksn6 ksn6 changed the title SIMD-0364: Enforce DATA_COMPLETE_SHRED Placement only on Last Data Shreds in FEC Sets SIMD-0366: Enforce DATA_COMPLETE_SHRED Placement only on Last Data Shreds in FEC Sets Sep 21, 2025
Comment thread proposals/0366-enforce-data-complete-shred-placement.md
3. **Invalid Placement Handling**: If a validator detects
`DATA_COMPLETE_SHRED` as `true` on any data shred other than the last
one in an FEC set:
- The validator MUST mark the entire slot as dead
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it's easier to just drop the shred, we don't need to explicitly mark the block as dead - it will fail to replay anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

True, although - wouldn't enforcing this condition allow us to skip a block with this specific type of bad shred faster?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah that's fair, just harder to wire up in the implementation

@ksn6
Copy link
Copy Markdown
Contributor Author

ksn6 commented Sep 28, 2025

Closing this PR, whose contents are largely moving to #337.

@ksn6 ksn6 closed this Sep 28, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants