Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moves repair nonce verification from window-service to shred-fetch-stage #4641

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

behzadnouri
Copy link

@behzadnouri behzadnouri commented Jan 26, 2025

Problem

Because repair nonce is a randomly generated u32 for each repair request, it can be verified before sigverify so that shreds with invalid repair nonce do not waste sigverify resources.

Summary of Changes

The commit moves repair nonce verification from window-service to shred-fetch-stage.
This bypasses sigverify and a full deserialization for shreds with invalid repair nonce.

@behzadnouri behzadnouri force-pushed the shred-fetch-verify-nonce branch 8 times, most recently from f6d26f3 to ea70ad2 Compare January 27, 2025 14:49
@behzadnouri behzadnouri force-pushed the shred-fetch-verify-nonce branch from ea70ad2 to 6355743 Compare January 29, 2025 02:37
Because repair nonce is a randomly generated u32 for each repair
request, it can be verified before sigverify so that shreds with invalid
repair nonce do not waste sigverify resources.
@behzadnouri behzadnouri force-pushed the shred-fetch-verify-nonce branch from 6355743 to 3abc306 Compare January 29, 2025 22:51
Copy link

@steviez steviez left a comment

Choose a reason for hiding this comment

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

One question / one comment, but LGTM

core/src/window_service.rs Show resolved Hide resolved
core/src/window_service.rs Show resolved Hide resolved
@behzadnouri behzadnouri merged commit 844effe into anza-xyz:master Jan 30, 2025
47 checks passed
@behzadnouri behzadnouri deleted the shred-fetch-verify-nonce branch January 30, 2025 18:34
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Feb 5, 2025
prune_shreds_elapsed_us and num_shreds_pruned_invalid_repair are
leftovers of: anza-xyz#4641
and are no longer measuring anything.

Separately, num_repairs can be atomically updated inside the thread-pool
during the first iteration, and does not need an additional iteration
over the packets.
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Feb 5, 2025
prune_shreds_elapsed_us and num_shreds_pruned_invalid_repair are
leftovers of: anza-xyz#4641
and are no longer measuring anything.

Separately, num_repairs can be atomically updated inside the thread-pool
during the first iteration, and does not need an additional iteration
over the packets.
behzadnouri added a commit that referenced this pull request Feb 5, 2025
prune_shreds_elapsed_us and num_shreds_pruned_invalid_repair are
leftovers of: #4641
and are no longer measuring anything.

Separately, num_repairs can be atomically updated inside the thread-pool
during the first iteration, and does not need an additional iteration
over the packets.
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