Add Extension 0x0003: Dynamic Coinbase Outputs - #195
Conversation
|
Is it not simpler to eat the round-trip? Have an extension that allows the client to make arbitrary "what outputs would you want in a coinbase transaction paying the pool X?". You never know what kind of dust pruning policy the pool might want and trying to capture arbitrary payout construction rules sounds like it should get crazy complicated. The roundtrip sucks but if we lean on next block prediction it should be tolerable. |
Static weights at AllocateMiningJobToken.Success cannot express amount-dependent pool policy (dust thresholds, pending-balance rerouting) and freeze the distribution for the token's lifetime while a real PPLNS share window changes continuously. Replace with three new messages: RequestCoinbaseOutputs (JDC->JDS, carrying prev_hash and pool_revenue) and RequestCoinbaseOutputs. Success/Error responses. JDS returns the consensus-serialized output list computed at request time from current pool state. Per design discussion with TheBlueMatt on PR stratum-mining#195.
336a238 to
69dcc08
Compare
|
Thanks @TheBlueMatt — you're right, and on reflection the static-weights model has a structural problem In a PPLNS pool the share weights drift continuously as new shares enter the window and the oldest fall out, so a vector frozen at Just force-pushed a refactor along the lines you described. Three new messages — PR body updated to reflect the new design. Round-trip cost is discussed in §5.2 — I think predictive prefetch handles it for the common case, but if you see operational scenarios where it doesn't, I'd appreciate the push-back. |
Static weights at AllocateMiningJobToken.Success cannot express amount-dependent pool policy (dust thresholds, pending-balance rerouting) and freeze the distribution for the token's lifetime while a real PPLNS share window changes continuously. Replace with three new messages: RequestCoinbaseOutputs (JDC->JDS, carrying prev_hash and pool_revenue) and RequestCoinbaseOutputs. Success/Error responses. JDS returns the consensus-serialized output list computed at request time from current pool state. Per design discussion with TheBlueMatt on PR stratum-mining#195.
69dcc08 to
c723820
Compare
|
Pushed a revision that reworks how the per-job output size is bounded, after implementing an experimental JDS side and finding the original draft leaned on a coinbase-size field that does not actually exist on the wire. What changed
Net effect: the extension adds no coinbase-size-negotiation surface and is implementable against a JDC that follows the existing §7.1 reservation behavior. |
|
closing in favor of #203 |
Summary
Adds a draft extension
0x0003 — Dynamic Coinbase Outputsthat lets a Job Declaration Client (JDC) request, per declared job, the exact list of pool-defined coinbase outputs from the Job Declaration Server (JDS). Three new messages:RequestCoinbaseOutputs(JDC → JDS) andRequestCoinbaseOutputs.Success/.Errorresponses. The JDC sends its current template'sprev_hashand the amount of revenue it is contributing to the pool (pool_revenue); the JDS replies with the consensus-serialized output list computed at request time from current pool state.This continues the conversation from:
Why this replaces an earlier static-weights draft
An earlier revision of this PR proposed a static
SEQ0_64K[U32]weight vector appended as a TLV toAllocateMiningJobToken.Success. Per @TheBlueMatt's review (https://github.com/stratum-mining/sv2-spec/pull/195#issuecomment-…) the static-weights design has a structural problem that defeats the use case it was meant to serve:The current design moves the output-set decision from token allocation to declared-job time. The JDS computes the output list using its current internal state and the JDC-reported revenue. Dust thresholds, pending-balance rerouting, per-miner output caps, payout consolidation — all of these fall out as operator policy on the JDS side without further wire-format surface.
Design choices
extension_type = 0x0003, following the pattern of extension 0x0001 (which also introduces new request/response messages). Not a TLV on an existing message because the exchange is per-job and request/response.prev_hashit MAY re-use the last response. On aprev_hashtransition the JDC MUST refresh, because the prior PPLNS-window state is now associated with the block that just resolved. Section 3.1 of the new doc spells the refresh rules out.prev_hashin the request. Carries the template's chain tip so the JDS can refuse stale requests withstale-prev-hash. Protects against the race where a different block is found between the request and the declaration.pool_revenue, nottemplate_revenue. The JDC reports the amount it is contributing to the pool's output set, after subtracting any non-zero self-outputs it intends to add per §6.4.3. The pool's emitted distribution sums to ≤pool_revenue. This preserves §6.4.3's existing freedom for the JDC to allocate part oftemplate_revenueto its own outputs.AllocateMiningJobToken.Success.coinbase_tx_outputs. The JDS MUST accept §6.4.3-compliant declarations even when this extension is negotiated. Keeps availability under transient disruption.prev_hashtransitions: the JDC pre-emptively requests for the predicted nextprev_hashbefore its own TP observes the new tip.Explicitly out of scope
AllocateMiningJobToken.Success.coinbase_tx_outputs).Open to feedback
prev_hashtransitions and is naturally addressed by predictive prefetch. If the maintainers see operational scenarios where this is still too costly, please raise them — moving to a hybrid model (static fallback + dynamic refresh) is possible.RequestCoinbaseOutputs.Error. The current set (invalid-mining-job-token/stale-prev-hash/revenue-too-large/coinbase-size-budget-exceeded/internal) is what I think we need; happy to extend or trim.0x0003is held over from the prior revision; happy to use whatever the registry should allocate.Files changed
extensions/0x0003-dynamic-coinbase-outputs.md— new extension doc.09-Extensions.md— registry entry updated.