feat(v2:shred): receiver primitives for shred harness #1632
Codecov Report
:x: Patch coverage is
67.74194% with 10 lines in your changes missing coverage. Please review.| Files with missing lines | Patch % | Lines |
|---|---|---|
| v2/lib/shred/receiver.zig | 66.66% | 9 Missing :warning: |
| v2/lib/shred.zig | 0.00% | 1 Missing :warning: |
:x: Your patch check has failed because the patch coverage (67.74%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| v2/lib/collections/pool.zig | 81.50% <100.00%> (+0.38%) | :arrow_up: |
| v2/lib/shred.zig | 16.11% <0.00%> (-0.10%) | :arrow_down: |
| v2/lib/shred/receiver.zig | 45.38% <66.66%> (+2.19%) | :arrow_up: |
<details><summary> :rocket: New features to boost your workflow: </summary>
</details>
this seems the same
pub fn reset(self: *PoolSelf) void {
const buf = self.buf[0..self.len];
self.* = init(buf);
}
Looks great, I've got one comment, resolve it if you feel like it
17d8772bd9c7d77feee045cd3318c8e4555f580c
Approved these changes.
Approved these changes.
Looks good! commits are unsigned for some reason
hamza-syndica
yewman
Four independent primitives the
sol_compat_shred_parse_v1conformance harness needs out ofReceiver. Each is self-contained — review per commit.No behavioural change to existing callers: new feature gates default to inactive,
Receiver.reset()is opt-in, and the hoisted parse-time bound was already enforced one stage later.Commits
1.
feat(v2:shred): split debug-skip flags into sig-verify and version-check— replaces the single-Ddebug-skip-shred-checksmeta-flag with two orthogonal options (-Ddebug-skip-shred-sig-verify,-Ddebug-skip-shred-version-check). The harness needs to skip sig verify (synthetic shreds, no known leader) but keep version-check on.2.
feat(v2:shred): add Receiver.reset() for state-free reuse— in-place reset ofReceiver,InProgressSets,DoneSets, and a newPool.reset()that rebuilds the free list without touching the backing buffer. Lets the harness reuse a singleReceiveracross fixtures (a fresh one per call is too expensive — the ctx pool alone holds 4096 in-flight sets).3.
feat(v2:shred): reject shred-indices past max_shreds_per_slot— hoists theslot_idx < 32768bound intoShred.fromPacketCheckedso the parse-level verdict (reportShredParseResult) matches Agave/FD. Previously the bound was enforced one frame too late — after the harness had already observedparses_as_chained = true. The32768literal is promoted to a single namedpub const max_shreds_per_slot. Closes the last shred-fixture mismatch intest-vectors/shred/fixtures(1001/1001).4.
feat(v2:shred): discard unexpected data-complete shreds under feature gate— addsReceiver.Featureswith thediscard_unexpected_data_complete_shredsactivation slot (defaultmaxInt(Slot)= inactive). When active for a slot, a data shred withDATA_COMPLETEset is only accepted whenslot_idx == fec_set_idx + FEC_SHRED_COUNT - 1. Enforced inprocessPacketInnerbecause it needs the runtime activation slot. Mirrors agave'sledger/src/shred/filter.rs.