Skip to content

fix(download): persist bad-descriptor reputation through CapturingStateStore - #134

Merged
MichaelTaylor3d merged 1 commit into
mainfrom
fix/1629-reputation-delegation
Aug 2, 2026
Merged

fix(download): persist bad-descriptor reputation through CapturingStateStore#134
MichaelTaylor3d merged 1 commit into
mainfrom
fix/1629-reputation-delegation

Conversation

@MichaelTaylor3d

Copy link
Copy Markdown
Contributor

What changed

CapturingStateStore (the StateStore wrapper the node hands dig-download) delegated only load/save/clear and silently inherited the trait's no-op defaults for the bad-descriptor reputation methods. So a holder demoted for serving a lying descriptor (#1611) was forgotten the moment the wrapper's inner FileStateStore never saw the record — the node persisted no reputation, and every fresh call/process re-asked the same liars from scratch.

This forwards both reputation methods to the inner FileStateStore, which persists them to disk:

  • record_bad_descriptor(target_key, peer_id)self.inner.record_bad_descriptor(...)
  • bad_descriptor_peers(target_key)self.inner.bad_descriptor_peers(...)

The wrapper's only job is commitment capture (chunk_lens/root/proof); reputation is now delegated verbatim.

Note on the ticket's method names

Issue #1629 was filed against dig-download 0.9.0, which named the API record_holder_reputation/load_holder_reputation. By the pinned dig-download 0.13.0 the API is record_bad_descriptor/bad_descriptor_peers (same feature, evolved names). The fix targets the current 0.13 contract; the defect — the wrapper dropping the delegation — is identical.

Verification

  • Regression test capturing_state_store_persists_bad_descriptor_reputation_across_restart: records a verdict through one wrapper, reads it back through a fresh wrapper over the same on-disk store (simulated restart). RED before the fix (left: []), GREEN after.
  • cargo fmt --all -- --check clean · cargo clippy -p dig-node-core --all-targets --all-features -D warnings clean · full dig-node-core --lib suite green.

Version

fix: → patch bump of the released binary version [workspace.package].version 0.72.4 → 0.72.5.

Closes #1629.


Generated by Claude Code

…teStore

CapturingStateStore delegated only load/save/clear and inherited the
StateStore trait's no-op reputation defaults, so a holder demoted for a
lying descriptor (#1611) was never written to the inner FileStateStore —
the node persisted no reputation and re-asked the same liars every call
and after every restart. Forward record_bad_descriptor + bad_descriptor_peers
to the inner store so a demotion survives a restart.

The ticket was filed against dig-download 0.9.0's holder-reputation names;
the pinned 0.13.0 API is record_bad_descriptor/bad_descriptor_peers (same
feature, evolved names) — the delegation gap is identical.

Regression test records a verdict through one wrapper and reads it back
through a fresh wrapper over the same on-disk store (simulated restart).

Closes #1629

Co-Authored-By: Claude <noreply@anthropic.com>
@MichaelTaylor3d
MichaelTaylor3d marked this pull request as ready for review August 2, 2026 04:29
@MichaelTaylor3d
MichaelTaylor3d merged commit adabc3d into main Aug 2, 2026
15 checks passed
@MichaelTaylor3d
MichaelTaylor3d deleted the fix/1629-reputation-delegation branch August 2, 2026 04:53
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.

2 participants