Repository navigation
Description
Summary
#2912 retires cdn/probe/v1 and rate-manipulation slashing. Keep that. The open it adds carries too many states, windows and special cases. This issue tracks the cuts that bring the stream open down to five rules. Design discussion: #2912 review and follow-up comment.
None of this touches the contracts. Every step is node, client and wire only. The steps are mostly deletions.
The five rules
- A
StreamRequestis a free, signed quote. Before the first voucher, a node does a store lookup and at most one memoised{H}.sizeproofread. For a requester that is not an active staker, it also does a DHT lookup and sends unpaid opens to upstream nodes. It holds no pin, checks no pool and reads no chain. There is nopull_throughflag. A node runs its network miss path only for a requester that is not an active staker. This stops proxy chains and the partial-holder pull loop. Serving from a node's own origin backend is not a miss path. - The first voucher starts everything: admission, the pin and any fill.
- The client decides each answer as it arrives. If the answer is verified and consistent, quotes at or under the lane's rate limit, comes from an operator the fetch does not already use, covers useful blocks, and a lane is free, the client uses it as a lane and pays at once. Otherwise the client cancels it at once. There is no upfront planning. The ADR 039 tail-stealing moves work to the faster lanes.
- An unpaid stream dies within seconds. The first voucher has its own deadline of about 2 s. The proof wait during a stream stays at 10 s and keeps watching transport progress (client: a leg that faults mid-pull is logged nowhere and its range waits for a busy lane (serial tail) #2230). A node closes a connection that has never received a voucher a few seconds after its last unpaid stream ends.
- Origins publish
{H},{H}.obao4and{H}.sizeproof. All three are required.decdn origin importwrites all three. A missing or broken object is an ordinary origin fault: aStreamErrorbefore anyChunkData.
Steps
Do the steps in this order. Each step is one PR, and each leaves the protocol working.
- 1. Make the outboard required at origins (rule 5). (feat!: origins publish all three objects; delete the whole-blob origin fallback #2922) Delete
origin_outboard_publishedand its memo,origin_probe_presence(the data-objectHEAD, theContent-Lengthread and theContent-Encodingcase),origin_range_serviceable, the "no outboard" memo and its degrade path, and the fallback that pulls the whole blob from the origin and imports it. ADR 037 § Origin-tier pull-through loses "Fallback is always correct". First, check whethercommit_buffered_bytesanddefault_buffered_max_bytesalso serve the buffered whole-blob pull from another node (ADR 037, near line 126). If they do, that path stays. - 2. Remove the pin before payment and add the short first-voucher deadline (rules 2 and 4). Delete the unadmitted pin,
MAX_UNADMITTED_PINS, the logic that drops the pin on a miss and takes it again on a fill,MAX_UNADMITTED_STREAMS_PER_CONNECTION, the client's matching limit, and the "8 of 10 for discovery" split. The node takes the pin at admission. Give the first voucher its own deadline, separate fromVOUCHER_READ_TIMEOUT. Close a connection that has never received a voucher soon after its last unpaid stream ends. - 3. Answer whatever pool the request names (rule 1). Delete the pool
Declinedrefusal,declines_pool, the "retry once on a listed contract" rule, and "a node that refuses the pool is a serve target with unknown coverage". The node answers the blob status for any requested pool and listspayment_pools. The pool check moves to admission. The client uses the winner's stream as its first lane only when that stream named the chosen contract. - 4. Remove
pull_throughand add the staker rule (rule 1). DeleteStreamRequestExt.pull_through, the second admission timing, and the cold tail (append_cold_tail,OpenSet.cold). The staker rule also replacesrefuses_whole_blob. A proxy that does not hold the blob answers with its upstream's verified size proof and fills only after the first voucher. A proxy can keep its upstream discovery stream open and use it as its paid upstream lane. - 5. Decide each answer on arrival (rule 3). Delete the
DIRECT_PATH_GRACEwait before an answer counts (record RTT into the peer store after the lane runs),OpenRound::Settle,cold_grace,SETTLE_AFTER_HOLDER, theOpenRoundenum, the path that cancels late holders and opens a new lane to each, and the upfront ranking (RTT bands, then quote, then coverage). Ranking decides only who keeps a lane when the lanes are full. The node's pull path follows the same rule, and its ADR 001 score decides only that choice.
ADR end state
The discovery section of ADR 005 has four parts: the answer, coverage, the rule on who gets a miss path, and the payer's price protection. The Deferred admission, Open-stream pin, Pull-through and Discovery on several contracts subsections go away. ADR 022, 037, 039 and 040 change to match.
Open question
When the lanes are full, should a cheaper late holder replace the most expensive running lane? Without that, nodes win by answering fast, not by being cheap.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsBacklog
Activity
feat!: origins publish all three objects; delete the whole-blob origi…