Skip to content

fix(dash-spv): track refusals for hedged request copies #1573

Backlog

Description

@xdustinface

The broker tracks refusals only for a request's original carrier. A hedge copy, the duplicate sent to a second peer once the first is overdue, is not covered:

  1. A reply to a hedge copy proves nothing about requests the hedge peer skipped, because the broker does not know where the hedge sat in that connection's send order. A skipped request there falls back to expiring.
  2. A block notfound from a hedge peer leaves the hedge recorded, so no third peer gets a copy while the original carrier stays connected. Dash Core itself never sends notfound for a block, so this only matters for other node implementations.
  3. A hedge peer that refused a request stays eligible for it.

A fix needs each copy's send order on its own connection. Hedges are sent from the hedger task and primary requests from the router, so a shared counter does not follow wire order. A possible shape: take the order when a copy is written to its connection (for example in PeerHandle::send, which serializes writes per connection), keep every copy in Retry across requeue, detect skips per copy, record a refusing hedge peer as refused and drop that hedge so another can go.

Found while reviewing #1374, which keeps the connections each request was sent to across a requeue, the first half of this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions