Skip to content

Fix DHT GetRecord query wedge on untrusted peer responses#3716

Merged
jsdanielh merged 1 commit intoalbatrossfrom
viquezcl/untrusted_peer
Apr 22, 2026
Merged

Fix DHT GetRecord query wedge on untrusted peer responses#3716
jsdanielh merged 1 commit intoalbatrossfrom
viquezcl/untrusted_peer

Conversation

@jsdanielh
Copy link
Copy Markdown
Member

An untrusted peer could respond to a DHT GetRecord query in ways that left the query in an inconsistent state, preventing it from ever completing and wedging the requester.

This change:

  • Adds DhtGetInconsistentState, DhtGetVerificationFailed, and DhtGetTimeout error variants.
  • Introduces abort_dht_get() which finishes the query, clears intermediate state, and surfaces the failure to the waiting channel.
  • Aborts the query on verification failure, inconsistent state, and timeout, instead of silently dropping progress events.
  • Ignores stale progress events for queries that are no longer tracked.

Depends on #3707 (Fix for DHT query poisoning) — this builds on the store_dht_record / query-state refactor introduced there.

Pull request checklist

  • All tests pass. The project builds and runs.
  • I have resolved any merge conflicts.
  • I have resolved all clippy and rustfmt warnings.

Base automatically changed from viquezcl/dht to albatross April 22, 2026 00:30
@jsdanielh jsdanielh force-pushed the viquezcl/untrusted_peer branch from a7bf076 to 01cc6db Compare April 22, 2026 00:39
@jsdanielh jsdanielh merged commit 01cc6db into albatross Apr 22, 2026
7 checks passed
@jsdanielh jsdanielh deleted the viquezcl/untrusted_peer branch April 22, 2026 00:39
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