Skip to content

cleanup unchained continuation#8079

Merged
steviez merged 13 commits intoanza-xyz:masterfrom
puhtaytow:chained-cleanup-continuation-0
Sep 23, 2025
Merged

cleanup unchained continuation#8079
steviez merged 13 commits intoanza-xyz:masterfrom
puhtaytow:chained-cleanup-continuation-0

Conversation

@puhtaytow
Copy link
Copy Markdown

@puhtaytow puhtaytow commented Sep 17, 2025

Problem

There is still remaining parts of code that allows for unchained shreds. The unchained shreds are nomore in production.
Cleaning it all at once would result in hard to review PR, that is why taking iterative approach seem to be the way.

This PR is one of many, towards the unchained shreds removal.

Summary of Changes

  • Removed option from chained_merkle_root param:

    • blockstore/setup_erasure_shreds_with_index_and_chained_merkle
    • blockstore/setup_erasure_shreds_with_index_and_chained_merkle_and_last_in_slot
    • ledger/benches/make_shreds_from_entries
    • ledger/shredder/entries_to_merkle_shreds_for_tests
    • ledger/shredder/make_merkle_shreds_from_entries
    • ledger/shredder/make_shreds_from_data_slice
  • Removed chained switch param in:

    • ledger/sigverify_shreds/make_shreds
    • ledger/shred/make_merkle_shreds_for_tests
    • ledger/tests
  • Removed last part of test test_check_last_fec_set in blockstore as suggested

@puhtaytow puhtaytow marked this pull request as draft September 17, 2025 14:54
@mergify mergify Bot requested a review from a team September 17, 2025 14:55
@puhtaytow
Copy link
Copy Markdown
Author

puhtaytow commented Sep 17, 2025

im not sure what to do with this test https://github.com/puhtaytow/agave/blob/25bbb89f961e5289b273af7180924728bab68d0b/ledger/src/blockstore.rs#L11747 it explicitly says that None variant has to be used, tagging @AshwinSekar as you added the comment there 🙏

can we just remove the test last part*? its blocking me from removing Option at setup_erasure_shreds_with_index_and_chained_merkle_and_last_in_slot, which is blocking further at entries_to_merkle_shreds_for_tests

@puhtaytow puhtaytow marked this pull request as ready for review September 17, 2025 15:49
@puhtaytow puhtaytow changed the title wip: prepare for removing unchained in, local-cluster and blockstore tests prepare for removing unchained in; local-cluster and blockstore tests Sep 17, 2025
@puhtaytow puhtaytow changed the title prepare for removing unchained in; local-cluster and blockstore tests cleanup unchained continuation Sep 17, 2025
@puhtaytow puhtaytow changed the title cleanup unchained continuation ledger, local-cluster: cleanup unchained continuation Sep 17, 2025
@puhtaytow
Copy link
Copy Markdown
Author

@alexpyattaev @steviez could you have a look when you find a moment? 🙏

@alexpyattaev
Copy link
Copy Markdown

im not sure what to do with this test https://github.com/puhtaytow/agave/blob/25bbb89f961e5289b273af7180924728bab68d0b/ledger/src/blockstore.rs#L11747 it explicitly says that None variant has to be used, tagging @AshwinSekar as you added the comment there 🙏

can we just remove the test last part*? its blocking me from removing Option at setup_erasure_shreds_with_index_and_chained_merkle_and_last_in_slot, which is blocking further at entries_to_merkle_shreds_for_tests

I would kill that part of the test.

Copy link
Copy Markdown

@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.

The changes from this PR aren't too crazy, I think we can remove Option from this function and update all callers at least:

chained_merkle_root: Option<Hash>,

I haven't dug through the functions beneath that, but I'm inclined to think that removing Option throughout shouldn't be too bad

@puhtaytow puhtaytow requested a review from a team as a code owner September 18, 2025 07:52
@puhtaytow
Copy link
Copy Markdown
Author

Took your suggestions and now its cleaned up till shredder/make_merkle_shreds_from_entries, which already result in changes across 22 files.

Please have a look when you find a moment 🙏 if you think it should be splitted then let me know.

Copy link
Copy Markdown

@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.

Wanna update this one too ?

agave/ledger/src/shred.rs

Lines 1014 to 1020 in f9294b1

pub(super) fn make_merkle_shreds_for_tests<R: Rng>(
rng: &mut R,
slot: Slot,
data_size: usize,
chained: bool,
is_last_in_slot: bool,
) -> Result<Vec<merkle::Shred>, Error> {

Took your suggestions and now its cleaned up till shredder/make_merkle_shreds_from_entries, which already result in changes across 22 files.

Yep, we have touched a handful of files. However, all of the changes are of the same type / pretty easy to follow. So, I don't mind lumping them all into a PR like this.

On the other hand, the logic below shred::merkle::make_shreds_from_data() is deserving of more scrutiny. So, getting all of the mechanical changes in this PR should allow for a pretty small diff in the subsequent PR

Comment thread ledger-tool/src/bigtable.rs
Comment thread ledger/src/blockstore.rs
0,
10,
0,
Hash::default(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

note to other reviewers - there are other instances where we use Hash::default() so changing None to that here shouldn't be an issue.

No code changes being requested, just calling this out

Comment thread ledger/src/blockstore.rs
Comment thread ledger/src/shred.rs
Comment thread ledger/src/shredder.rs Outdated
Comment thread ledger/src/shred.rs
@alexpyattaev alexpyattaev added the CI Pull Request is ready to enter CI label Sep 18, 2025
@anza-team anza-team removed the CI Pull Request is ready to enter CI label Sep 18, 2025
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 18, 2025

Codecov Report

❌ Patch coverage is 94.44444% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.9%. Comparing base (25bbb89) to head (e3d4e4f).
⚠️ Report is 54 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #8079     +/-   ##
=========================================
- Coverage    82.9%    82.9%   -0.1%     
=========================================
  Files         823      823             
  Lines      360421   360393     -28     
=========================================
- Hits       299016   298949     -67     
- Misses      61405    61444     +39     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@puhtaytow
Copy link
Copy Markdown
Author

puhtaytow commented Sep 18, 2025

Wanna update this one too ?

Good point. Fixed.

the logic below shred::merkle::make_shreds_from_data() is deserving of more scrutiny. So, getting all of the mechanical changes in this PR should allow for a pretty small diff in the subsequent PR

Makes sense.


I fixed stuff that you addressed, lets wait what Ashwin would say about the last part of test. To my understanding we omitt this way testing not-retransmitted full one, but unchained shreds aren't real now, so it could only be a negative test? and question would be if its needed and if it is needed, then that might be good thing to address in the #8048

@puhtaytow puhtaytow changed the title ledger, local-cluster: cleanup unchained continuation cleanup unchained continuation Sep 18, 2025
Copy link
Copy Markdown

@alexpyattaev alexpyattaev left a comment

Choose a reason for hiding this comment

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

LGTM

@alexpyattaev alexpyattaev added the CI Pull Request is ready to enter CI label Sep 19, 2025
@anza-team anza-team removed the CI Pull Request is ready to enter CI label Sep 19, 2025
@steviez steviez merged commit b6c922c into anza-xyz:master Sep 23, 2025
45 checks passed
@puhtaytow
Copy link
Copy Markdown
Author

Thank you guys 🥇

@puhtaytow puhtaytow deleted the chained-cleanup-continuation-0 branch September 24, 2025 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants