Repository navigation
feat(spec): add Decred chain spec - #186
Conversation
|
🤖 Spec pipeline started on PR open — running Phase 8 → 11. Results post here as comments. View run |
Manual smart-router run — Decred mainnet through a keyed provider (2026-10-06)Booted Results (mainnet; the live run and
|
| Surface | Result | Evidence (via router) |
|---|---|---|
| Boot / chain-id | ✅ PASS | [+] verified successfully … verification=chain-id rawData=298e5cc3d985bfe7f81dc135f360abe089edd4396b86d2de66b0cef42b21d980 (getblockhash [0] = mainnet genesis). ChainTracker initialization complete chainID=DCR failed=0 success=1. |
| GET_BLOCKNUM / GET_BLOCK_BY_NUM | ✅ PASS | getblockcount → 1121278. getblockhash [1121258] → ccfd43bd…6dbd. The tracker polled getblockcount all session. |
| Node answered (23 methods) | ✅ PASS | getblockcount, getblockhash, getblock (verbose: hash + powhash, tx/stx trees; raw hex with verbose=false), getblockheader, getbestblockhash, getblockchaininfo (chain: "mainnet"), getchaintips, getdifficulty, getnetworkinfo (version 2010600, subversion "2.1.6"), getconnectioncount, getnetworkhashps, getmininginfo, getrawtransaction [txid, 1], gettxout [txid, 0, 0, true], getrawmempool, getmempoolinfo, gettxoutsetinfo, validateaddress, verifymessage, decodescript, createrawtransaction, estimatefee, estimatesmartfee ({"feerate": 0.00039125, "blocks": 6}). |
| Node-originated errors on junk input (2 methods) | ✅ PASS (existence) | decoderawtransaction ["00"] and sendrawtransaction ["00", false] → -22 "Could not decode Tx: unexpected EOF" from dcrd. Nothing was broadcast. |
| Gateway-whitelisted (31 methods) | NOWNodes answers HTTP 405 Method Not Allowed for getbestblock, getblocksubsidy, getcfilterv2, getheaders, getcoinsupply, getcurrentnet, getinfo, getnettotals, getpeerinfo, version, existsmempooltxs, existsaddress(es), createrawsstx, createrawssrtx, estimatestakediff, getstakedifficulty, getstakeversions, getstakeversioninfo, getvoteinfo, livetickets, existsliveticket, ticketsforaddress, getticketpoolvalue, ticketvwap, ticketfeeinfo, txfeeinfo, gettreasurybalance, gettreasuryspendvotes, getmixmessage, getmixpairrequests. A deliberately nonexistent method gets the same 405, so this is the gateway's allow-list and says nothing about dcrd. All are registered in dcrd (rpc/jsonrpc/types/chainsvrcmds.go). Not a spec defect; do not disable. |
|
| Gateway-whitelisted writes (2 methods) | submitblock and sendrawmixmessage → 405 (same allow-list). |
|
| Rate limit (1 method) | existslivetickets → HTTP 429 "retry after 1m0s" from the free tier during the burst. |
|
| Method binding | ✅ PASS | All 59 methods report their own function= label on :metrics. Only the deliberate nonexistent probe fell to Default-*. |
| DCRT (testnet3) inheritance | ✅ inheritance validated / |
No testnet endpoint exists (public testnet services are down, and NOWNodes has no Decred testnet). An expected-fail scratch boot pointed DCRT at the mainnet origin: verify failed expected and received are different … Method=getblockhash Verification=chain-id rawParsedBlock=298e5cc3…d980 verification.Value=a649dce53918caf422e9c711c858837e08d626ecfcd198969b24f7b634a49bac. So DCRT resolves the chain-id check through imports and applies its own testnet genesis. The testnet value itself remains source-verified only. |
Run notes (operational, not spec issues)
- Flags:
--chain-tracker-poll-divisor 0.25 --set-relay-retry-limit 0 --min-relay-timeout 15s(free tier, about 100k requests/month and a burst limit). One provider block, base leg only: the spec declares no add-ons or extensions. healthexit 0,ok: true, legDCR dcr-mainnet http OK latestBlock 1121279 chain-id=true. It mirrors the live boot.- Residual log noise is the expected startup set (
invalid adaptive … bounds, using defaults,provider data not found, using default). - For providers: NOWNodes' shared tier exposes about half of dcrd's RPC surface. A dedicated dcrd (or a provider without an allow-list) is needed to serve the stake, treasury, mix and address methods.
🤖 Generated with Claude Code
|
Phase 8 — smart-router boot + method probe (resumable run, Phases 8–11)
Method Probe Report — dcrGenerated: 2026-10-06T12:46:36Z Endpoint availability — Phase 8 ran in SPEC-LOAD-ONLY modeDecred has no reachable public dcrd JSON-RPC endpoint on either mainnet or testnet. This was established independently twice — once across Phases 1–7, and again this run by a dedicated endpoint-discovery agent that probed and re-probed the full source ladder immediately before this phase started:
This is an endpoint gap, not a spec defect. Per the orchestrator's explicit instruction for this run, no further endpoint search was performed (that work is done and redoing it wastes budget), no endpoint was invented/guessed/constructed, and the dcrdata explorer REST API was never substituted for the Because there is no upstream, the only thing Phase 8 can still exercise is the router's static spec-graph resolution — loading Each Router spec-load checkMechanically confirmed inputs:
SPEC_LOAD (mainnet, chain-id
|
| chain-id | index | expected_value (genesis block-0 hash via getblockhash(0)) |
|---|---|---|
| DCR (mainnet) | DCR | 298e5cc3d985bfe7f81dc135f360abe089edd4396b86d2de66b0cef42b21d980 |
| DCRT (testnet3) | DCRT | a649dce53918caf422e9c711c858837e08d626ecfcd198969b24f7b634a49bac |
Both values are well-formed (64 hex chars, verified mechanically). Neither could be verified against a live node in this run — see VERIFY below — the testnet3 value in particular is source-derived and has never been live-confirmed by any phase of this pipeline.
Parse-directive & verification runtime check (Step 3.5)
| Check | Verdict | Evidence |
|---|---|---|
| GET_BLOCKNUM (router latest_block) | NOT_TESTABLE | tracker never started a successful cycle — zero smartrouter_latest_block/lava_rpcsmartrouter_latest_block metric samples on either :7779 or :7879; no upstream ever answered |
| GET_BLOCK_BY_NUM (log hash-reads ∥ fetch_block counters) | NOT_TESTABLE | zero Chain Tracker Updated block hashes / Chain Tracker read a block Hash lines on either container |
| Parse-signature log lines | none | grep for failed to parse response|failed formatResponseForParsing|failed ParseBlockHashFromReplyAndDecode|failed CraftChainMessage|... → 0 hits on both containers |
| Verification | Verdict | Providers OK/failed | Notes |
|---|---|---|---|
| chain-id (DCR) | NOT_TESTABLE | 0/1 | compiled and attempted (getblockhash(0)), but failed only on dial tcp 127.0.0.1:1: connect: connection refused against the placeholder — never reached a real node, so the expected_value itself was never exercised |
| chain-id (DCRT) | NOT_TESTABLE | 0/1 | same — compiled, attempted, connection-refused only |
PARSE: NOT_TESTABLE and VERIFY: NOT_TESTABLE per the orchestrator's explicit instruction — the chain tracker never ran and the chain-id genesis-hash check never reached a real node on either network. This is distinct from FAIL: nothing in the spec's directive/verification definitions was shown to be wrong; the test apparatus simply had no live chain to check it against.
Addon & extension coverage (Step 1c)
ADDONS: none declared. Mechanically confirmed:
jq -r '[.. | objects | .add_on? // empty] | map(select(. != "")) | unique[]' dcr.json # → empty
jq -r '[.. | objects | .extension? // empty] | map(select(. != null and . != "")) | unique[]' dcr.json # → empty
No addon/extension table applies to this spec.
Per-method probe table (Step 4) — NOT_TESTABLE, no upstream
The router could not route any request to a real dcrd node on either network, so none of DCR's 59 apis could be functionally probed through the router. No per-method probes were fabricated and no third-party service was probed directly in place of the router. All 59 methods are classified NOT_TESTABLE with reason no reachable dcrd JSON-RPC upstream, except the 3 category.stateful: 1 methods, which keep the endpoint-independent SKIP (stateful) classification per the reference.
| Method | Classification | Notes |
|---|---|---|
| createrawssrtx | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| createrawsstx | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| createrawtransaction | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| decoderawtransaction | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| decodescript | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| estimatefee | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| estimatesmartfee | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| estimatestakediff | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| existsaddress | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream — watch-list: needs a fully-permissioned node to re-test |
| existsaddresses | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| existsliveticket | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| existslivetickets | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| existsmempooltxs | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getbestblock | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream — watch-list |
| getbestblockhash | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getblock | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getblockchaininfo | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getblockcount | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getblockhash | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream — this is the chain-id verification's own method |
| getblockheader | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getblocksubsidy | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getcfilterv2 | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getchaintips | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getcoinsupply | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getconnectioncount | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getcurrentnet | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream — watch-list |
| getdifficulty | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getheaders | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getinfo | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getmempoolinfo | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getmininginfo | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getmixmessage | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getmixpairrequests | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getnettotals | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getnetworkhashps | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getnetworkinfo | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getpeerinfo | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getrawmempool | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getrawtransaction | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getstakedifficulty | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream — watch-list |
| getstakeversioninfo | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getstakeversions | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getticketpoolvalue | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| gettreasurybalance | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| gettreasuryspendvotes | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| gettxout | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| gettxoutsetinfo | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| getvoteinfo | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| livetickets | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| sendrawmixmessage | SKIP (stateful) | would broadcast a mix message |
| sendrawtransaction | SKIP (stateful) | would broadcast a transaction |
| submitblock | SKIP (stateful) | would submit a block |
| ticketfeeinfo | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| ticketsforaddress | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| ticketvwap | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| txfeeinfo | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| validateaddress | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| verifymessage | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream |
| version | NOT_TESTABLE | no reachable dcrd JSON-RPC upstream — watch-list |
59 total methods: 3 SKIP (stateful), 56 NOT_TESTABLE.
Log-scan findings (probe window)
No probe window — Step 4 did not run (no upstream to route to). The entire boot-window log for both containers was reviewed instead (above); the only non-benign warn/error lines are the expected class-B connection-refused / failed-verification / excluded-provider lines against the deliberate placeholder http://127.0.0.1:1/. No fatal/panic appeared on either container.
| Level | Associated method | error excerpt |
|---|---|---|
| — | — | (clean — only expected placeholder-dial errors, documented above) |
Testnet verification pass (Step 7)
TESTNET_VERIFY: SKIPPED (no testnet inputs — no reachable testnet dcrd RPC; testnet.dcrdata.org and testnet.decred.org both 503 on 2026-10-06)
The boot in "SPEC_LOAD_TESTNET" above is a stand-in that confirms the DCRT import closure resolves inside the router, but it is explicitly not a substitute for Step 7's live expected_value check — no testnet node ever answered the chain-id verification.
| Verification | Verdict | Providers OK/failed | Notes |
|---|---|---|---|
| chain-id (DCRT) | NOT_TESTABLE | 0/1 | never reached a live node; expected_value unverified |
Empirical block time (Step 8)
BLOCK_TIME: mainnet=skipped testnet=skipped — no RPC available on either network, so no live measurement was taken, and none was synthesized from the dcrdata explorer to avoid misrepresenting it as a probe measurement.
Inherited evidence (from Phases 1–7, NOT a measurement taken in this phase): the dcrdata explorer's lifetime mean block interval was previously recorded as 299.96 s/block, against the spec's mainnet average_block_time of 300000ms (300s) — a ~0.01% difference, i.e. consistent, but this is explorer corroboration carried forward, not a Phase 8 probe result.
| Network | RPC | Empirical (ms) | Spec effective (ms) | Drift | Verdict |
|---|---|---|---|---|---|
| mainnet | — (none reachable) | skipped | 300000 | — | skipped |
| testnet | — (none reachable) | skipped | 120000 | — | skipped |
What a maintainer must do to close this gap
- Supply one keyed dcrd mainnet JSON-RPC endpoint (and ideally a testnet3 one too) — e.g. a self-hosted
dcrd --rpcuser=... --rpcpass=...reachable over HTTPS, or a paid-tier provider that actually onboards Decred (none of NOWNodes/GetBlock/BlockDaemon/Tatum/Ankr currently do on a free tier). - Re-run
/rerun-probe mainnet=<url> testnet=<url>to redo Phase 8 for real: router boot,chain-idverification against both genesis hashes, the chain-tracker'sGET_BLOCKNUM/GET_BLOCK_BY_NUMdirectives, and the full 59-method probe loop. - On the mainnet probe, pay particular attention to this watch-list of methods that need a fully-permissioned (non-rate-limited, non-pruned) node to validate properly:
version,getbestblock,getstakedifficulty,existsaddress,getcurrentnet. - On the testnet probe, live-confirm the testnet3 genesis hash currently in the spec as DCRT's
chain-idexpected_value:This value is source-derived (from Decred's published testnet3 parameters) and has never been live-confirmed by any phase of this pipeline — it should be the very first thing checked once a testnet3 RPC exists, viaa649dce53918caf422e9c711c858837e08d626ecfcd198969b24f7b634a49bacgetblockhash(0).
|
Phase 9 — parallel reviewers (3 independent fresh-context reviews) Three reviewers ran
What all three agreed was correct
Merged findingsMEDIUM-1 — MINOR-1 — MINOR-2 — Note on scopeNo reviewer raised a finding about the missing live probe data; all three correctly treated the Phase 8 endpoint gap as infrastructure, not a spec defect. Zero methods are disabled anywhere in the file, so there were no disable justifications to verify. |
|
Phase 10 — synthesize gaps + fix pass, and Phase 10b — smoke re-probe ConsolidationThree review reports plus the Phase 8 probe report were consolidated into a deduplicated fix list (
Fix applied — 1 line
dcrd's Guards after the fix
No new disabled APIs, so the Disabled-API Justifications ledger stays empty and needs no entry. Phase 10b — smoke re-probe:
|
| Check | Phase 8 baseline | Phase 10b | Verdict |
|---|---|---|---|
SPEC_LOAD (DCR) |
OK | OK — chainID:DCR, jsonrpc, spec_count:298, averageBlockTime:5m0s, chain-id verification compiles, listener ready |
no change |
SPEC_LOAD_TESTNET (DCRT) |
OK | OK — resolves through imports: ["DCR"], averageBlockTime:2m0s override correct vs DCR's 5m |
no change |
| Class-A spec-defect log signatures | none | none (both containers, full boot log) | no change |
PARSE / VERIFY |
NOT_TESTABLE | NOT_TESTABLE (carried forward) | not a regression — same known endpoint gap |
ADDONS |
none declared | none declared (re-confirmed mechanically) | no change |
| 7-item minimal probe set | n/a | 7/7 NOT_TESTABLE (no reachable upstream) |
per reference Step 3, an item with no data is never a regression |
Teardown clean, both containers removed. The smoke pass ran image tag :latest (digest 0b4c806…) where Phase 8 ran :main (digest 2149de6…), per the reference's preference for :latest when pullable; every checked signal behaved identically across the two tags, so the comparison holds.
The Phase 10 edit is left uncommitted in the working tree for the workflow's commit step.
|
Phase 11 — final reviewer verdict: The final reviewer confirmed the Phase 10 fix is correct and complete, re-verified every earlier PASS, and found one new CRITICAL defect that Phase 9's three reviewers all missed: I independently confirmed the finding against the file before reporting it: Two structurally identical dcrd RPCs, same CU tier, opposite determinism flags. dcrd's Required fix (one line): This was not applied. Phase 11 is the verdict phase and this run's span ends here; the skill forbids looping back into another fix pass, so the defect is reported rather than silently patched. Retry with Full final review report (
|
| API | dcrd param shape | Spec block_parsing |
Verdict |
|---|---|---|---|
getblock |
Hash string @0 |
PARSE_BY_ARG @0, BLOCK_HASH |
correct |
getblockhash |
Index int64 @0 |
PARSE_BY_ARG @0, BLOCK_LATEST |
correct (height, not hash — matches btc.json's identical convention) |
getblockheader |
Hash string @0 |
PARSE_BY_ARG @0, BLOCK_HASH |
correct |
getblocksubsidy |
Height int64 @0, Voters uint16 @1 |
PARSE_BY_ARG @0, BLOCK_LATEST |
correct |
getcfilterv2 |
BlockHash string @0 |
PARSE_BY_ARG @0, BLOCK_HASH |
correct |
getstakeversions |
Hash string @0, Count int32 @1 |
PARSE_BY_ARG @0, BLOCK_HASH |
correct |
gettreasurybalance |
Hash *string @0 (optional) |
PARSE_BY_ARG @0, BLOCK_HASH |
correct |
gettreasuryspendvotes |
Block *string @0 (optional) |
PARSE_BY_ARG @0, BLOCK_HASH |
correct |
getrawtransaction |
Txid string, Verbose *int — max 2 params, no blockhash arg (dcrd diverges from bitcoind's 3-param form) |
DEFAULT/latest |
correct — the spec does not copy bitcoind's PARSE_BY_ARG @2 pattern (seen in btc.json), which would be out-of-bounds for dcrd. This is the one case the review brief flagged as a likely divergence trap, and the spec gets it right. |
gettxout |
Txid string, Vout uint32, Tree int8 (required), IncludeMempool *bool |
DEFAULT/latest |
correct — none of dcrd's params are a block reference, Tree is a UTXO-tree selector, not a height/hash |
sendrawtransaction |
HexTx string, AllowHighFees *bool |
DEFAULT, stateful:1, hanging_api:true, timeout_ms:10000 |
correct |
getrawmempool |
Verbose *bool, TxType *string |
DEFAULT |
correct — no block ref |
All other apis (struct-less *Cmd{} commands, or commands whose params are never block references — e.g. getvoteinfo(Version), existsaddress(Address), getnetworkhashps(Blocks,Height)) correctly use DEFAULT/latest.
Verdict: PASS — no parameter-shape defects found; the known dcrd/bitcoind divergence points are handled correctly.
Parse directives
GET_BLOCKNUM (getblockcount → PARSE_BY_ARG[0]) and GET_BLOCK_BY_NUM (getblockhash(%d) → PARSE_BY_ARG[0]) are byte-for-byte identical to the established btc.json pattern for the same dcrd/bitcoind-family RPC shape. No SUBSCRIBE/UNSUBSCRIBE directives exist and none are needed (no WS commands in the base collection, confirmed above).
Verdict: PASS.
Verifications
- Mainnet
chain-id(DCR, line 1005):expected_value = 298e5cc3d985bfe7f81dc135f360abe089edd4396b86d2de66b0cef42b21d980. Independently corroborated live againsthttps://dcrdata.decred.org/api/block/0(reachable explorer REST API, used here only for read-only corroboration, never as a smart-router upstream): returns"hash":"298e5cc3d985bfe7f81dc135f360abe089edd4396b86d2de66b0cef42b21d980"for block 0 — exact match. - Testnet3
chain-id(DCRT, line 1043):expected_value = a649dce53918caf422e9c711c858837e08d626ecfcd198969b24f7b634a49bac.testnet.dcrdata.org,testnet.decred.org, anddcrdata.decred.org/testnet/...are all unreachable (503/404) as of this run, consistent with the probe report — this is the same pre-documented endpoint gap, not re-raised here as a new finding. - Both verification pin on
getblockhash(0)(genesis hash) rather thangetblockchaininfo.chain— per settled decision (d), this is correct for dcrd (whosechainfield semantics mirror btcd's generic"mainnet"string, same reasoning already accepted for BTC-family specs in this repo).
Verdict: PASS (mainnet live-confirmed; testnet unverifiable due to endpoint gap, not a spec defect).
Network parameters
Checked against chaincfg/mainnetparams.go / testnetparams.go:
| Param | Mainnet spec | dcrd source | Testnet spec | dcrd source | Verdict |
|---|---|---|---|---|---|
average_block_time |
300000ms | TargetTimePerBlock: 5*time.Minute |
120000ms | TargetTimePerBlock: 2*time.Minute |
correct both |
block_distance_for_finalized_data |
6 | — (PoW, within guide's 6–12 range) | 6 | same | correct |
blocks_in_finalization_proof |
3 | — (probabilistic finality) | 3 | same | correct |
allowed_block_lag_for_qos_sync |
1 | 10000/300000=0.03→min 1 |
1 | 10000/120000=0.08→min 1 |
correct both |
Verdict: PASS.
CU + category flags
jqconfirms exactly 3 apis withcategory.stateful == 1:sendrawtransaction,submitblock,sendrawmixmessage— each hascategory.hanging_api: trueand an explicittimeout_ms: 10000. No read method is marked stateful.jqconfirms 0 apis/collections withenabled: falseanywhere in the file, andcheck_disabled_count.shreports0 distinct method(s)— matches the empty Disabled-API Justifications ledger exactly. This check passes trivially, confirmed mechanically rather than assumed.- CU values spot-checked against
btc.json's equivalents for the shared bitcoind-family RPCs (getblock=20,getblockhash=10,getblockheader=20,gettxout=10,getrawmempool=20,gettxoutsetinfo=500/timeout_ms=180000) — all identical, consistent with the repo-wide convention.
Verdict: PASS.
Phase 10 fix verification
git diff -- dcr.json
shows exactly one hunk, at the version api:
- "deterministic": true,
+ "deterministic": false,Nothing else in the 1053-line file changed. version's dcrd handler (handleVersion) returns a static map of the node's own build/semver info — not chain state — so deterministic: false is correct, consistent with 11/12 comparable specs in this repo. The Phase 10 fix is correct and complete; no further edits are needed or were made to verify it.
New finding
CRITICAL — txfeeinfo incorrectly marked deterministic: true (dcr.json:825-838)
txfeeinfo's category block (line 834-836) sets "deterministic": true. Comparing dcrd's own handleTxFeeInfo against its structural twin handleTicketFeeInfo (which the spec correctly marks deterministic: false, lines 810-823):
// handleTxFeeInfo (rpcserver.go)
func handleTxFeeInfo(...) (any, error) {
...
// Memory pool first.
feeInfoMempool := feeInfoForMempool(s, stake.TxTypeRegular) // ALWAYS included, unconditionally
...
if c.RangeStart == nil {
// defaults to a window ending at the CURRENT chain tip (bestHeight)
...
}
return &types.TxFeeInfoResult{
FeeInfoMempool: *feeInfoMempool, // live mempool snapshot embedded in every response
FeeInfoBlocks: feeInfoBlocks,
FeeInfoRange: feeInfoRange,
}, nil
}Every single txfeeinfo response unconditionally embeds FeeInfoMempool, a live snapshot of the current mempool's fee distribution — there is no parameter combination that removes it. ticketfeeinfo has the identical structural pattern (feeInfoForMempool embedded unconditionally in TicketFeeInfoResult) and is correctly marked deterministic: false. txfeeinfo should be too.
Failure scenario: two honest providers answer the same txfeeinfo request one second apart (or with a slightly different mempool state due to normal propagation jitter). Because the api is flagged deterministic, Lava's cross-provider data-reliability check will treat the differing FeeInfoMempool sub-objects as a fraud/mismatch signal, incorrectly penalizing one or both honest providers. This is the exact same bug class the Phase 10 fix corrected for version (a response field that reflects live/local state, not reproducible chain state, flagged as if it were).
Fix: change dcr.json:835 from "deterministic": true to "deterministic": false, matching ticketfeeinfo's category block.
Summary
- Endpoints/methods reviewed: 59 (all of
DCR's base collection;DCRTinherits all 59 viaimportsand adds none of its own). - Gaps found: 1 CRITICAL, 0 MEDIUM, 0 MINOR.
- Cleanup findings (Phase 0 removed-field guard): none —
check_unused_fields.shexits 0 clean. - Disabled-API justification audit: 0 disabled apis/collections found (
jq+check_disabled_count.sh), matching the ledger's "none" entry exactly — passes trivially, confirmed not assumed. - Phase 10 fix: confirmed correct and complete via
git diff(single-lineversiondeterminism flip, nothing else touched). - Readiness: the spec is deployment-ready for mainnet
DCRandDCRTmodulo the one newtxfeeinfodeterminism fix above, which should be applied before merge to avoid spurious cross-provider reliability penalties. The mainnetchain-idgenesis hash is independently live-confirmed correct; the testnet3chain-idvalue remains unverified only due to the pre-documented endpoint-availability gap (not a spec defect) and should be the first thing checked once any testnet3 RPC becomes reachable.
|
Phase 12 — closing summary checklist (resumable run, Phases 8–11) Final verdict: CHANGES REQUESTED — 1 CRITICAL ( Auto-decisions taken this run (no human was available)
Governance-field complianceThe Phase 10 fix pass introduced none of the 15 fields smart-router removed in #218. Verified post-fix by What a maintainer must do to close the real gapSupply one keyed dcrd mainnet RPC (and ideally a testnet3 one) and re-run Run stats — this pipeline run only (Phases 8–11)These figures cover only Phases 8–11 in this workflow run. The Phases 1–7 time and tokens live in the separate |
Auto-committed by spec_pipeline.yml after the Phase-10 fix pass. Run: https://github.com/Magma-Devs/lava-specs/actions/runs/37464394195
|
📦 Committed pipeline fixes to |
dcrd's handleTxFeeInfo always embeds the live mempool fee distribution (FeeInfoMempool), so two providers can answer the same call differently, exactly like ticketfeeinfo, which is already deterministic: false. Clears the Phase 11 CRITICAL on #186. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
/rerun-final Final review of 5e48b29:
Pass |
|
🤖 Command acknowledged — running Phase 11 only. Progress and results post here as comments. View run |
|
Phase 11 — final reviewer verdict: Resumable run, Phase 11 only ( The two landed fixes are both confirmed present AND correctThe reviewer re-derived both from dcrd source rather than taking them on trust:
So the round-1 CRITICAL is genuinely closed. The verdict is CHANGES REQUESTED because the deeper audit this pass performed — a full source-level re-check of CRITICAL-1 —
|
| Area | Result |
|---|---|
Removed-field guard (check_unused_fields.sh) |
RESULT: PASS (no removed fields), exit 0 — none of the forbidden 15 |
Internal-path guard (check_internal_paths.sh) |
RESULT: PASS (0 warning(s), no errors); the only internal_path in the file is "" |
| Canonical envelope | { "proposal": { "specs": [ … ] } } exactly; no title/description/deposit, no governance fields — correct per the settled shape, not reported as missing |
| Other mechanical guards | check_network_params / check_verifications / check_directive_presence / check_extensions / check_archive_value / check_disabled_count / check_method_schema / check_node_admin_rpcs — all PASS, 0 FAIL |
| Disabled-API ledger audit | 0 enabled: false apis and 0 disabled collections; ledger is (none — no disabled APIs) — matches exactly, no unjustified disable. The body's <!-- disabled-count: 0 --> marker is still true against the file; no correction needed |
| Network params | Source-confirmed both networks: TargetTimePerBlock 5m (DCR) / 2m (DCRT testnet3) → 300000/120000; block_distance_for_finalized_data: 6 and blocks_in_finalization_proof: 3 correct for probabilistic PoW/PoS finality; allowed_block_lag_for_qos_sync: 1 on both per the formula floor |
| Parse directives | Both live-proven — getblockcount → 1121278 with failed=0 success=1 on the tracker; getblockhash [1121258] → ccfd43bd…6dbd. GET_EARLIEST_BLOCK correctly absent (dcrd has no pruning, so no archive extension applies) |
| Chain-ids | DCR live-verified (rawData=298e5cc3…b21d980). DCRT newly cross-corroborated against two client sources outside dcrd — decred/tinydecred nets/testnet.py and trezor/trezor-common decred_testnet.json, both a649dce5…49bac |
| DCRT inheritance | Correct — overrides only the chain-id expected_value (and average_block_time); apis/headers/parse_directives merge via CombineUnique(), so all 59 apis come through. Proven in-router by the expected-fail boot |
| Method coverage | 0 phantom methods — all 59 are registered dcrd handlers. 18 dcrd methods correctly excluded as node-admin/mining/debug (stop, addnode, generate, getwork, invalidateblock, …). No public read method missing |
| Block parsing | All 59 index-checked against each *Cmd struct. Notably: dcrd's getrawtransaction has no third blockhash param unlike Bitcoin Core, so btc.json's PARSE_BY_ARG ["2"] is correctly not copied here |
deterministic: false on the other 38 |
All correct, and stricter than btc.json — this spec marks estimatesmartfee, getblockcount, getblockchaininfo, getconnectioncount and getchaintips false where btc.json marks them true. That is the right call |
| Stateful writes | sendrawtransaction / submitblock / sendrawmixmessage: stateful: 1, hanging_api: true, 10 CU, timeout_ms: 10000 — matches the guide's tx-submission pattern |
| 405/429 handling | Nothing disabled over gateway gating. All 33 HTTP-405 methods and the HTTP-429 existslivetickets re-confirmed as registered dcrd handlers; none reported as unverified or as a disable candidate |
Accepted limitations (documented, not findings): DCRT's genesis hash has never been live-confirmed because no Decred testnet RPC exists anywhere (now corroborated against two independent client sources); CI Phase 8 could only run spec-load-only, as no public dcrd JSON-RPC endpoint exists; 34 methods were untestable through the one keyed provider owing to its allow-list and rate limit.
Required action
This run's span was Phase 11 only, so no fix pass ran and dcr.json is untouched — the working tree is clean at 5e48b29. The three edits below are all one-liners and none of them is a disable:
gettreasuryspendvotes→category.deterministic: false(CRITICAL — blocks deployment)getmixmessage→category.deterministic: falselivetickets→compute_units: 500+timeout_ms: 180000(the spec's owngettxoutsetinfoprecedent)
To apply them through the pipeline and get a fresh verdict on top, comment:
/rerun-from 10
That runs the Phase 10 fix pass (+ 10b smoke re-probe) and then Phase 11 again. Full report: docs/dcr/SPEC_REVIEW_GAPS_final.md.
TALLY: CRITICAL=1 MEDIUM=2 MINOR=2
🤖 Generated with Claude Code
|
Phase 12 — closing summary checklist (resumable run, Phases 11–11 only) Final verdict:
Governance / removed-field compliance
Auto-decisions taken at STOP-and-ask gates (unattended run)
Run stats — this pipeline run (Phase 11 only)These numbers cover Phase 11 only — they are not a 1–11 grand total. Phases 1–7 ran in the original 🤖 Generated with Claude Code |
…-2961) - gettreasuryspendvotes: deterministic false. Called without tspends, handleGetTreasurySpendVotes reads the live mempool's tspend set. - getmixmessage: deterministic false. It reads only the node-local mixpool, like getmixpairrequests. - livetickets: 500 CU and a 180 s timeout. It serialises the whole live ticket pool (about 41k hashes, about 2.7 MB), like gettxoutsetinfo. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
/rerun-final Final review of 81404f9, which applies exactly the three edits the previous Phase 11 verdict listed under "Required action" and nothing else:
The two MINORs were informational, with no change required, and stay as is. Everything the previous pass re-verified clean is unchanged. Live evidence remains the manual smart-router run comment above. Pass |
|
🤖 Command acknowledged — running Phase 11 only. Progress and results post here as comments. View run |
|
Phase 11 — final reviewer verdict: Resumable run, Phase 11 only ( All three required edits landed, and all three are correctThe reviewer re-derived each one from dcrd source (
Collateral change: none. Why the verdict is still CHANGES REQUESTEDThe independent re-sweep of the four defect classes across all 59 apis — run precisely because each of the last two passes found a fresh instance — turned up two more methods in the same class the MEDIUM-1 —
|
| Area | Result |
|---|---|
category.deterministic, all 19 true apis |
Each re-derived against its handler: either pure computation (validateaddress, verifymessage, decoderawtransaction, decodescript, createrawtransaction, createrawsstx, getcurrentnet) or block-keyed committed state (getblock, getblockhash, getblockheader, getblocksubsidy, getcfilterv2, getheaders, getstakeversions, gettreasurybalance, gettxoutsetinfo, ticketvwap, createrawssrtx). No true api reads the mempool or mixpool. getrawtransaction noted explicitly: it is mempool-first, but btc.json sets the identical flag at the same 10 CU for Core's identically mempool-first handler — a cross-chain policy question, not a dcr.json defect |
deterministic: false on the other 40 |
All correct and stricter than btc.json, which marks getblockcount/getbestblockhash/getblockchaininfo/getchaintips/getdifficulty true |
Missing timeout_ms sweep |
MEDIUM-1/-2 are the only remaining instances. gettxoutsetinfo + livetickets covered; the three stateful: 1 broadcasts each carry timeout_ms: 10000. Four range-taking methods (ticketfeeinfo, txfeeinfo, getstakeversions, ticketvwap) deliberately not flagged — their default invocation is cheap, so they are consumer-bounded. dcrd has no long-polling read method (no getblocktemplate in its handler map at all), so nothing needs hanging_api: true and lacks it |
block_parsing |
All 8 PARSE_BY_ARG apis checked field-by-field against their *Cmd structs — every one resolves to argument 0 with a matching parse_type. The 51 DEFAULT apis swept for a missed block arg: only getnetworkhashps has one (height at index 1, defaults -1), and btc.json sets DEFAULT/latest for the identical method. getheaders takes an array of locators, which PARSE_BY_ARG cannot address |
stateful |
stateful: 1 + hanging_api: true + timeout_ms: 10000 on exactly the three broadcasts (sendrawtransaction, submitblock, sendrawmixmessage); cross-checked against the full dcrd handler map — nothing else mutates state |
| Method coverage | 0 phantom methods — all 59 names present in dcrd's rpcHandlersBeforeInit. The 18 omissions are all admin/mining/node-control (stop, addnode, generate, getwork, invalidateblock, verifychain, …). No public read method missing |
| Network params | Re-derived by compiling chaincfg/v3 this pass: target=5m0s (DCR) / 2m0s (DCRT testnet3) → 300000/120000 exact; block_distance_for_finalized_data: 6 (dcrd itself hardcodes 6 as max reorg depth), blocks_in_finalization_proof: 3 for probabilistic PoW/PoS, allowed_block_lag_for_qos_sync: 1 per the formula floor on both. Corroborated empirically at 299.96 s/block |
| Chain-ids | DCR source + live + router-verified (chaincfg → 298e5cc3…b21d980, matched by dcrdata/api/block/0 and the router's rawData). DCRT newly source-verified by executing chaincfg.TestNet3Params().GenesisHash → a649dce5…4a49bac, upgrading it past the prior two-client-source corroboration; still not live-confirmed (testnet3 RPC + testnet.dcrdata.org + testnet.decred.org all re-probed this pass → HTTP 503) |
| DCRT inheritance | Correct — CollectionData matches on all four fields, apis/headers/parse_directives/extensions all [] so they inherit via CombineUnique rather than zeroing out, and the chain-id verification carries no parse_directive, adopting DCR's and overriding only expected_value. Proven in-router: DCRT booted with its own averageBlockTime: 2m0s, and the deliberate expected-fail boot showed the testnet value being applied |
| Parse directives | GET_BLOCKNUM/GET_BLOCK_BY_NUM (dcr.json:967–988) byte-for-byte btc.json's shape; both live-proven (getblockcount → 1121278, getblockhash [1121258] → ccfd43bd…6dbd, tracker polling all session). GET_EARLIEST_BLOCK correctly absent — extensions: [], no archive extension, so no pruning verification applies |
| Headers | headers: [] correct for native JSON-RPC/POST — the NOWNodes key travels in the URL path (provider endpoint config, not spec content) and all 59 methods are application/json |
| Removed-field + internal-path guards | check_unused_fields.sh → RESULT: PASS (no removed fields), exit 0 — none of the forbidden 15; no extra_compute_units, category.local or category.subscription. Canonical envelope { "proposal": { "specs": [ … ] } } exactly. The only internal_path in the file is "", so the internal-path guard's four findings cannot arise |
| Disabled-API ledger audit | 0 enabled: false apis and 0 disabled collections; ledger is (none — no disabled APIs) — matches exactly, no unjustified disable. check_disabled_count.sh → 0 distinct method(s), RESULT: PASS. The body's <!-- disabled-count: 0 --> marker is still true; no correction needed |
| 405/429 handling | Nothing disabled over gateway gating. All 33 HTTP-405 methods and the HTTP-429 existslivetickets re-confirmed as registered dcrd handlers; a deliberately nonexistent method got the identical 405, so 405 is NOWNodes' allow-list, not dcrd capability. None reported as unverified or as a disable candidate |
Accepted limitations (documented, not findings): DCRT's genesis hash has never been live-confirmed because no Decred testnet RPC exists anywhere (now source-verified by executing dcrd's own chaincfg); CI Phase 8 could only run spec-load-only, as no public dcrd JSON-RPC endpoint exists; 34 methods were untestable through the one keyed provider owing to its allow-list and rate limit.
Required action
This run's span was Phase 11 only, so no fix pass ran and dcr.json is untouched — the working tree is clean at 81404f9. Two one-line edits remain, neither of them a disable, both the same pattern this commit already applied to livetickets:
dcr.json:788—getticketpoolvalue:"compute_units": 20→500, add"timeout_ms": 180000dcr.json:773—ticketsforaddress:"compute_units": 20→500, add"timeout_ms": 180000
To apply them through the pipeline and get a fresh verdict on top, comment:
/rerun-from 10
That runs the Phase 10 fix pass (+ 10b smoke re-probe) and then Phase 11 again. Full report: docs/dcr/SPEC_REVIEW_GAPS_final.md.
Not deployment-blocking — zero CRITICAL, zero disabled apis, and no defect that breaks routing, parsing or verification. Both MEDIUMs are economic/QoS: a provider absorbs an uncompensated ~41,000-read scan priced at 20 CU, and the default relay timeout can abort a correctly-functioning provider mid-scan and score it as a failure.
TALLY: CRITICAL=0 MEDIUM=2 MINOR=2
🤖 Generated with Claude Code
|
Phase 12 — closing summary checklist (resumable run, Phases 11–11 only) Reviewed Annotations: Phases run this invocation
Open items
Both are the same full-live-ticket-pool-scan pattern this commit already applied to The two MINORs (optional-parameter Run stats — this pipeline run only (Phases 11–11)These figures cover only this run (Phase 11). They are not a Phases 1–11 grand total: the Phases 1–7 time and tokens live in the original 🤖 Generated with Claude Code |
…961) getticketpoolvalue and ticketsforaddress both walk the whole live ticket pool (about 41k entries, one utxo read each). Give them 500 CU and a 180 s timeout, matching livetickets and gettxoutsetinfo. These were the two remaining MEDIUMs from the Phase 11 review on #186. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
/rerun-final Final review of the latest commit, which applies exactly the two fixes the previous Phase 11 verdict listed and nothing else:
Both now match Pass |
|
🤖 Command acknowledged — running Phase 11 only. Progress and results post here as comments. View run |
|
Phase 11 — final reviewer verdict: ✅ APPROVED ( Resumable run, Phase 11 only ( Both required edits landed, and both are correctThe reviewer re-derived each from dcrd source rather than taking the previous verdict's reasoning on trust:
The values were checked too, not just their presence: pool size re-derived from Collateral change: none. The missing-
|
| Method | Scan | CU | timeout_ms |
|---|---|---|---|
livetickets |
full live-ticket treap | 500 | ✅ 180000 |
ticketsforaddress |
full pool + 1 UTXO read/ticket | 500 | ✅ 180000 (this commit) |
getticketpoolvalue |
full pool + 1 UTXO read/ticket | 500 | ✅ 180000 (this commit) |
gettxoutsetinfo |
full UTXO set (FetchUtxoStats) |
500 | ✅ 180000 |
Five range-taking methods were checked and deliberately not flagged, with the reasoning recorded: txfeeinfo (default range = last WorkDiffWindowSize = 144 blocks), ticketfeeinfo (default = mempool only, blocks/windows default 0), ticketvwap (default 20 × 144 = 2880 headers, served from the in-memory block index), getstakeversions/getstakeversioninfo (same in-memory index), getheaders (hard-bounded at 2000 by wire.MaxBlockHeadersPerMsg), existsaddresses/existslivetickets (bounded by the caller's own list). All are consumer-bounded at their default invocation, and argument-widened range scans priced in the default band are established in-repo precedent — btc.json prices the structurally identical getchaintxstats at 10 CU with no timeout, so dcr.json at 20 is already the more conservative of the two.
Everything else re-derived from scratch this pass
Explicitly not carried over on the strength of an earlier PASS:
| Area | Result |
|---|---|
category.deterministic, all 59 apis |
Every handler body extracted and grepped for node-local state (TxMempooler, MixPooler, ConnMgr, SyncMgr, AddrManager, CPUMiner, NetTotals, BestSnapshot), then each hit read in context. Every handler touching mempool, mixpool or peer/gossip state is false, with no exception — 8 mempool, 2 mixpool, 6 peer/connmgr, 2 fee-estimator, 2 node-local-index, 17 tip-pinned. All 19 true apis individually justified: pure computation, or state keyed by the block in the argument. The two earlier fixes confirmed still in place (txfeeinfo at 5e48b29, gettreasuryspendvotes/getmixmessage at 81404f9) |
| Method coverage | rpcHandlersBeforeInit registers 77 methods. 0 phantom — all 59 spec names resolve to a real handler. The 18 omissions are all admin/mining/profiling/meta (stop, addnode, generate, getwork, invalidateblock, verifychain, help, …). Cross-checked against dcrd's own rpcLimited read-only allow-list: its only absent members beyond help live in rpcwebsocket.go, not the JSON-RPC handler map, so they cannot belong to a jsonrpc/POST collection. The 7 spec methods outside rpcLimited are all read-only and merely full-auth-gated; 3 of them answered live |
block_parsing |
All 8 PARSE_BY_ARG apis re-checked field-by-field against their *Cmd structs in chainsvrcmds.go — every one resolves to argument 0 with a matching type. The 51 DEFAULT apis take no block reference. No api needs EMPTY, PARSE_CANONICAL or PARSE_DICTIONARY_OR_ORDERED |
stateful / hanging_api |
stateful: 1 + hanging_api: true + 10 CU + timeout_ms: 10000 on exactly the three broadcasts (sendrawtransaction, submitblock, sendrawmixmessage) — the only three handlers in the spec that call a broadcast path. No read method carries either flag; the createraw* family builds hex locally and is correctly stateful: 0 |
| Network params | Re-derived from chaincfg TargetTimePerBlock: 5m0s (DCR) / 2m0s (DCRT testnet3) → 300000/120000 exact. 6 sits in the PoW band and matches dcrd's own max-reorg-depth guard; 3 per the probabilistic-finality rule; 1 is the formula floor on both. Corroborated at 299.96 s/block lifetime mean (≈0.01% drift) |
| Chain-ids | Both expected_values recomputed by executing chaincfg at dcrd HEAD: DCR → 298e5cc3…b21d980, DCRT → a649dce5…4a49bac. Both match the spec. DCR additionally live-confirmed by the manual router run's verified successfully … rawData=298e5cc3…d980 |
| DCRT inheritance | Textbook Scenario-B override — CollectionData matches on all four fields; apis/headers/inheritance_apis/parse_directives/extensions all [] so the 59 parent apis and both directives merge through via CombineUnique; the chain-id verification carries no parse_directive, adopting DCR's and replacing only expected_value. All four network params set explicitly rather than inherited. Empirically confirmed twice: CI Phase 8 loaded DCRT with its own averageBlockTime 2m0s, and the deliberate expected-fail boot showed the testnet genesis being applied |
| Parse directives | GET_BLOCKNUM/GET_BLOCK_BY_NUM byte-for-byte btc.json's shape, both referencing apis that exist in the collection; both live-proven (getblockcount → 1121278, getblockhash [1121258] → ccfd43bd…6dbd, tracker polling all session). GET_EARLIEST_BLOCK correctly absent — no archive extension anywhere, so no pruning verification applies |
| Headers | headers: [] correct for a native JSON-RPC POST spec — no auth header to pass_send (the NOWNodes key travels in the URL path, which is provider endpoint config, not spec content) and no content-type to pass_override |
| Removed-field + internal-path guards | check_unused_fields.sh → RESULT: PASS (no removed fields), exit 0 — none of the forbidden 15, no extra_compute_units / category.local / category.subscription. Canonical envelope { "proposal": { "specs": [ … ] } } exactly. The only internal_path in the file is "", so the four internal-path findings cannot arise |
| Disabled-API ledger audit | 0 enabled: false apis and 0 disabled collections — matches the empty ledger exactly, so no unjustified disable. check_disabled_count.sh → 0 distinct method(s), RESULT: PASS. The body's <!-- disabled-count: 0 --> marker is still true; no correction needed |
| 405/429 handling | Nothing disabled over gateway gating. All 33 HTTP-405 methods and the HTTP-429 existslivetickets re-confirmed as registered dcrd handlers; a deliberately nonexistent method returns the identical 405, so 405 is NOWNodes' allow-list, not dcrd capability. None reported as unverified or as a disable candidate |
The three MINORs are informational — no edit recommended on any
- MINOR-1 (carried forward, re-verified) —
PARSE_BY_ARG ["0"]ongettreasurybalance(dcr.json:848) andgettreasuryspendvotes(dcr.json:869) targets an optional*string. Re-read of both handlers confirms they fall back toChain.BestSnapshot()when the argument is omitted, so on a no-arg call the parser yields no block, Lava treats the request as latest, and that is exactly what the handler does — correct in both branches. In-repo precedent:btc.jsongetchaintxstats. - MINOR-2 (carried forward, re-verified) — no SUBSCRIBE coverage.
rpcwebsocket.go:83–98exposesnotify*/stopnotify*per topic, but those handlers take no parameters and return no subscription handle (handleNotifyBlocks→nil, nil;stopnotifyblocksis addressed by connection, not by id). Lava has no%shandle to template anUNSUBSCRIBEon — router-side mapping, not a spec edit. Mechanically re-confirmed: zeroFUNCTION_TAG_SUBSCRIBEdirectives and nothing inherited, so this run's hard ws-endpoint requirement does not apply. - MINOR-3 (new this pass, informational) — determinism asymmetry inside the tip-pinned full-scan family:
gettxoutsetinfoistrue(dcr.json:469) whilelivetickets/ticketsforaddress/getticketpoolvaluearefalse(:731,:777,:793), despite all four being structurally identical (no block argument,DEFAULT ["latest"], result read off whatever tip the serving node is at). Both readings are defensible, and no edit is recommended in either direction:gettxoutsetinfo: trueis a verbatimbtc.jsonmatch, andfalseon the three ticket methods is the safe direction — it only forgoes a cross-provider reliability check, whereas the reverse error would manufacture spurious reliability failures. Recorded for the record, not for action.
Accepted limitations (documented, not findings)
- No public dcrd JSON-RPC endpoint exists on any network, so CI's Phase 8 could only run spec-load-only. The live evidence for this chain is the human-supplied manual smart-router v1.5.8 run (keyed NOWNodes mainnet, key withheld): boot, chain-id, both parse directives, per-method
function=binding for all 59 methods, and 25 methods answering end-to-end (23 with data + 2 proved existent via node-originated-22). - 34 methods were untestable through that one keyed provider (33 × 405 allow-list, 1 × 429 rate limit) — provider artefacts, not dcrd gaps.
- DCRT has never been live-confirmed, because no Decred testnet RPC exists anywhere (testnet3 RPC,
testnet.dcrdata.org,testnet.decred.org→ HTTP 503 on every prior probe). Its genesis hash is now source-confirmed by executing dcrd's ownchaincfg; a livegetblockhash(0)would be purely corroborative.
Required action
None. dcr.json at 0d4a613 is approved as-is. This run's span was Phase 11 only, so no fix pass ran and the working tree is clean — nothing uncommitted was left behind.
Deployment readiness: READY — zero CRITICAL, zero MEDIUM, zero disabled apis, and no defect affecting routing, parsing or verification. The one unverified value on the whole spec (DCRT's genesis hash) is blocked on Decred testnet infrastructure that does not exist, not on anything in this spec.
Full report: docs/dcr/SPEC_REVIEW_GAPS_final.md.
TALLY: CRITICAL=0 MEDIUM=0 MINOR=3
🤖 Generated with Claude Code
|
Phase 12 — closing summary checklist (resumable run, Phases 11–11 only) Reviewed Annotations: Phases run this invocation
Open itemsNone blocking. Both MEDIUMs from the previous verdict are closed, and the missing- Three MINORs are informational and recommend no edit: the optional-parameter Two accepted limitations remain outside this spec's control: no public dcrd JSON-RPC endpoint exists on any network, so CI can never functionally probe this chain (the human-supplied manual router run is the live evidence); and DCRT cannot be live-confirmed because no Decred testnet RPC exists anywhere — its genesis hash is source-confirmed against dcrd's own Run stats — this pipeline run only (Phases 11–11)These figures cover only this run (Phase 11). They are not a Phases 1–11 grand total: the Phases 1–7 time and tokens live in the original 🤖 Generated with Claude Code |
avitenzer
left a comment
There was a problem hiding this comment.
Tested at 0d4a6131 with smart-router built from main against a keyed NOWNodes mainnet endpoint (key withheld). Not approving yet. The spec boots and routes correctly, but a few classifications and the body need another pass.
What passed
- Boot: spec loads, and the chain tracker fetched a live tip with
getblockcount. chain-id(genesis hash298e5cc3…b21d980) passes insmartrouter health.- I called 57 of the 59 methods both through the router and directly on the node. The router matched the node on all 57. 24 answered, or returned the node's own expected error: param errors, and
sendrawtransactionrejecting junk hex with -22, which shows writes reach the node. - The other 33 got HTTP 405 from NOWNodes. The body says the gateway blocks only 5 methods (
version,getbestblock,getstakedifficulty,existsaddress,getcurrentnet), but it actually blocks 33, including all the ticket-pool methods0d4a613re-priced. Those have no live answer.
Spec changes requested
1. deterministic: true on results that move with the tip. In smart-router this flag gates cross-validation mismatch alerting, so a wrong true reports a false outlier whenever two providers are at different heights.
ticketvwap: with no args dcrd usesend = bestHeightandstart = tip − 2880, and the spec parses no block (DEFAULT).getheaders: with an emptyhashStop,LocateHeadersreturns headers up to the tip.gettreasurybalancewith no argument readsBestSnapshot().
The Phase 11 approval says all 19 true apis are "pure computation, or state keyed by the block in the argument"; the first two have no block argument in the spec. Suggest false. gettxoutsetinfo has the same issue (its result carries height/bestblock), but it mirrors btc.json, so I'd fix both specs together or neither.
2. gettreasurybalance / gettreasuryspendvotes without an argument parse as NOT_APPLICABLE, not latest. parseByArg returns ValueNotSetError, and ParseRawBlock (protocol/parser/parser.go:107-125) falls back only when the spec sets default_value. These two don't, so a no-arg call is never cached or consistency-checked. That contradicts Phase 11's MINOR-1 reasoning ("Lava treats the request as latest"). Suggest adding "default_value": "latest" to both block_parsing objects.
PR body is out of date
- "CU histogram across the 59 apis: 40×10, 18×20, 1×500": the file is 40×10, 15×20, 4×500 (
gettxoutsetinfo,livetickets,ticketsforaddress,getticketpoolvalue, each withtimeout_ms: 180000). - Auto-decision 10 ("Three CU deviations…") still lists the three ticket scans as rated 20.
c6a1592and0d4a613changed them. - The "Method Not Allowed for 5 methods" line, per above.
Router follow-up (not this PR's diff, but it blocks running this spec with the cache on)
protocol/rpcsmartrouter/node_bound_methods.go is the router's list of node-specific methods it refuses to cache. It has getrawmempool, getmempoolinfo and getconnectioncount, but none of the Decred node-local reads: existsmempooltxs, getmixpairrequests, getmixmessage, getpeerinfo, getnettotals, getnetworkinfo, getinfo, version. They are all DEFAULT ["latest"], so they are cached under the current tip, and the unfinalized TTL is averageBlockTime/8, which is 37.5 s at Decred's 300 s blocks. For example, a wallet polling existsmempooltxs after a send would read a stale "not present" for up to 37.5 s. This needs a smart-router ticket before Decred goes live behind a cache. I can open it.
Known gaps (not defects)
- DCRT has never run live: no testnet RPC exists, and the genesis hash is checked against source only.
- MAG-2961 asks for mainnet only and is still in Blocked status.
…lt treasury parsing to latest (MAG-2961) - ticketvwap, getheaders, gettreasurybalance -> deterministic: false. With no arguments each reads the tip (bestHeight, LocateHeaders to the tip with an empty hashStop, BestSnapshot()), so providers at different heights would be reported as cross-validation outliers. - gettreasurybalance, gettreasuryspendvotes: block_parsing default_value "latest". Without it a no-argument call parses as NOT_APPLICABLE (smart-router ParseRawBlock), so it is never cached or consistency-checked. gettxoutsetinfo stays deterministic to match btc.json. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
/rerun-final Final review of ce03338, which applies the changes requested in the 2026-10-07 human review and nothing else:
Pass |
|
🤖 Command acknowledged — running Phase 11 only. Progress and results post here as comments. View run |
|
Phase 11 — final reviewer verdict: Resumable run, Phases 11–11 only ( The two requested changes are in and both are correct. The reviewer re-read the dcrd handlers and confirms all five edits in Why the verdict is still CHANGES REQUESTED. Zero CRITICAL and the reviewer's own readiness line is "ready to deploy; none of the three MEDIUMs blocks" — but Phase 11's gate is
Per the resumable contract this run does not halt on CHANGES REQUESTED and does not fix anything — Pre-flight gates re-run against HEAD: Full reviewer report (
|
| Claim | How it was verified this pass | Result |
|---|---|---|
mainnet average_block_time: 300000 |
dcrd/chaincfg/mainnetparams.go → TargetTimePerBlock: time.Minute * 5 |
CONFIRMED |
testnet average_block_time: 120000 |
dcrd/chaincfg/testnetparams.go → TargetTimePerBlock: time.Minute * 2, Name: "testnet3" |
CONFIRMED |
DCR chain-id 298e5cc3…b21d980 |
live GET https://dcrdata.decred.org/api/block/0 → "hash":"298e5cc3d985bfe7f81dc135f360abe089edd4396b86d2de66b0cef42b21d980"; also decred/tinydecred dcr/nets/mainnet.py GenesisHash |
CONFIRMED (live) |
DCRT chain-id a649dce5…4a49bac |
decred/tinydecred dcr/nets/testnet.py → GenesisHash = "a649dce53918caf422e9c711c858837e08d626ecfcd198969b24f7b634a49bac", Name = "testnet3" |
CORROBORATED (second independent Decred-org source; still not live-confirmed — testnet.dcrdata.org and testnet.decred.org both returned HTTP 503 again on 2026-10-07) |
| method inventory | diffed spec names against the rpcHandlersBeforeInit map in dcrd/internal/rpcserver/rpcserver.go (master) |
CONFIRMED complete (see below) |
| the three HEAD-commit determinism flips | read handleTicketVWAP, handleGetHeaders, handleGetTreasuryBalance in dcrd master |
CONFIRMED correct |
The DCRT genesis hash remains the one value with no live confirmation anywhere in the
pipeline. It now has two independent Decred-org source-of-record agreements, which is
enough to leave it in place, but it is still the first thing a maintainer should check
once a testnet3 RPC exists (getblockhash 0).
Findings
CRITICAL
None.
Disable-justification audit — PASS
jq -r '.proposal.specs[] | .index as $i
| (.api_collections[]? | (if (.enabled == false) then "COLLECTION_DISABLED \($i)" else empty end),
(.apis[]? | select(.enabled == false) | "API_DISABLED \($i) \(.name)"))' dcr.json
→ (no output)
check_disabled_count.sh dcr.json → 0 distinct method(s), 0 row(s) / RESULT: PASS.
There are zero enabled: false apis and zero enabled: false collections in
dcr.json. The Disabled-API Justifications ledger is correspondingly empty and the PR body
carries <!-- disabled-count: 0 -->. Claim, ledger and file all agree — nothing to justify,
so no CRITICAL arises here.
MEDIUM
MEDIUM-1 — Four caller-controlled, uncapped range scans are priced as single-block reads (20 CU, no timeout_ms)
Location: dcr.json L798 (ticketvwap), L813 (ticketfeeinfo), L828 (txfeeinfo), L669 (getstakeversions)
Evidence (dcrd master, internal/rpcserver/rpcserver.go + internal/blockchain/chain.go):
| Method | Caller-controlled scan | Upper bound in dcrd | Per-iteration cost | spec compute_units |
spec timeout_ms |
|---|---|---|---|---|---|
ticketfeeinfo (blocks windows) |
blocks, windows |
none — both uint32, used raw in for i := start; i > end; i-- |
ticketFeeInfoForBlock → loads the full block and iterates its txs |
20 | absent |
txfeeinfo (blocks start end) |
blocks, rangestart..rangeend |
none (default range = WorkDiffWindowSize = 144) |
ticketFeeInfoForBlock → full block load + tx iteration |
20 | absent |
ticketvwap (start end) |
start..end |
only end <= bestHeight; start may be 1 |
Chain.HeaderByHeight(i) per block (default range = WorkDiffWindows * WorkDiffWindowSize = 20 × 144 = 2880) |
20 | absent |
getstakeversions (hash count) |
count |
BlockChain.GetStakeVersions clamps count only to startNode.height + 1, i.e. the whole chain |
one index-node walk + votes slice copy per block |
20 | absent |
Mainnet chain height on 2026-10-07 was 1,121,576 (https://dcrdata.decred.org/api/block/best/height).
So ticketvwap 1 1121576, txfeeinfo 1121576, ticketfeeinfo 1121576 and
getstakeversions <tip> 1121576 are all legal single relays. ticketfeeinfo/txfeeinfo are
the worst of the four because each iteration deserializes an entire block.
Why this is a defect and not a judgement call: the spec already recognises and prices this
exact class correctly. livetickets (L720), ticketsforaddress (L766) and getticketpoolvalue
(L782) are each compute_units: 500 with timeout_ms: 180000 — and commit 0d4a613
("price the Decred ticket-pool scans like livetickets") deliberately established that rule.
The four methods above are the same class of work (and ticketfeeinfo/txfeeinfo are heavier
per unit scanned, since the ticket-pool scans walk an in-memory set while these load blocks
from disk) yet sit at the getblock price of 20 CU. The guide's CU table puts
"Heavy ops (full scan)" at 500–5000 and tells you to attach timeout_ms to long-running ops.
Impact: CU is Lava's billing and rate-limiting unit, so a consumer obtains an arbitrarily
expensive dcrd operation — up to a full-chain block scan — for the price of one block read.
With no timeout_ms, each such relay also rides the router's default relay timeout rather
than a deliberately widened one, so on a large range the provider burns the work and then
the relay times out: the provider pays the full cost and still eats the QoS penalty. This is
the exact economic-imbalance failure mode the guide lists as pitfall #4.
Suggested fix: raise all four to the livetickets tier (compute_units: 500,
timeout_ms: 180000) to match the pricing rule the spec already applies to its other
full-scan methods.
MEDIUM-2 — gettxoutsetinfo (and createrawssrtx) stay deterministic: true while reading the chain tip, contradicting the criterion ce03338 itself applies
Location: dcr.json L458 (gettxoutsetinfo), L594 (createrawssrtx)
This is the item the triggering comment flagged as deliberate and invited disagreement on.
I disagree, with source evidence.
gettxoutsetinfo — evidence (dcrd master handleGetTxOutSetInfo):
func handleGetTxOutSetInfo(_ context.Context, s *Server, _ any) (any, error) {
best := s.cfg.Chain.BestSnapshot()
stats, err := s.cfg.Chain.FetchUtxoStats()
...
return types.GetTxOutSetInfoResult{
Height: best.Height,
BestBlock: best.Hash.String(),
...The handler takes no parameters at all (_ any), calls BestSnapshot(), and returns
height and bestblock inside the response body. There is no argument a caller can supply
to pin it to a block. Two honest providers one block apart therefore return provably
different bytes, always.
That is precisely the test ce03338 applied to flip ticketvwap (bestHeight), getheaders
(LocateHeaders to tip on empty hashStop) and gettreasurybalance (BestSnapshot()) to
deterministic: false — all three of which I re-read in dcrd master and confirm the commit
got right. gettxoutsetinfo fails the same test more plainly than any of them.
On the stated rationale ("to match btc.json"): btc.json is not positive evidence here,
because dcr.json already and deliberately departs from btc.json on the whole tip-reading
family. btc.json marks getblockcount, getbestblockhash, getblockchaininfo,
getchaintips, getdifficulty, getnetworkhashps and gettxout all deterministic: true;
dcr.json marks every one of those false. Invoking btc.json for gettxoutsetinfo alone
selects the single method where the sibling spec agrees with the status quo, while overriding
it everywhere else. The spec cannot be internally consistent and btc.json-consistent at the
same time, and it has already chosen internal consistency six times over.
createrawssrtx — same class, found during this pass (dcrd master handleCreateRawSSRtx):
ticketUtxo, err := s.cfg.Chain.FetchUtxoEntry(outpoint) // line 33 of handler
...
prevBlkHash := s.cfg.Chain.BestSnapshot().Hash // line 72
prevHeader, err := s.cfg.Chain.HeaderByHash(&prevBlkHash) // line 90It fetches a live UTXO entry and embeds the current tip's header, so its output changes with
the tip and it starts erroring once the ticket is spent/revoked. It is currently
deterministic: true.
Explicitly NOT flagged, on evidence: decoderawtransaction also touches
s.cfg.Chain.BestSnapshot().Hash, but only to select the active script version for decoding;
its output is tip-invariant except across a consensus-agenda activation, so
deterministic: true there is defensible and should be left alone. Likewise
getrawtransaction (deterministic: true) defaults to verbose=0, which returns the bare
serialized tx with no confirmations field — also fine.
Impact: deterministic is the flag that tells the router a response is safe to treat as a
stable function of the requested block — for cross-provider comparison and for caching. A
500-CU, no-argument UTXO-set summary advertised as deterministic can be compared against, or
served from, a snapshot taken at a different tip, and the mismatch surfaces as a provider
fault rather than as the expected tip skew it actually is. (This is distinct from the
router-side caching work in MAG-4207, which is about adding caching for node-local reads
and is out of scope here; the issue is the flag's truth value, not the cache.)
Suggested fix: deterministic: false on gettxoutsetinfo and createrawssrtx.
MEDIUM-3 — Eight zero-chain-state methods use DEFAULT/["latest"] where the guide requires EMPTY/[""]
Location: dcr.json L504 validateaddress, L519 verifymessage, L549 decodescript,
L564 createrawtransaction, L579 createrawsstx, L233 getcurrentnet, L368 version,
L609 estimatefee
Evidence. The guide is explicit on both rows that apply here:
| No block parameter, static/immutable data |
EMPTYwithparser_arg: [""]|
| Pure computation, no chain state |EMPTYwithparser_arg: [""]|
Every one of the eight was verified against dcrd master by grepping its handler body for
s.cfg.Chain (excluding ChainParams), BestSnapshot, TxMempooler, FeeEstimator,
TxIndexer and SubsidyCache — all eight came back with zero chain-state references:
validateaddress,verifymessage,decodescript,createrawtransaction,createrawsstx— pure crypto/serialization againstChainParamsonlygetcurrentnet— body is literallyreturn s.cfg.ChainParams.Net, nil(a compile-time constant)version— returns static build/API-version constantsestimatefee— body isreturn s.cfg.MinRelayTxFee.ToCoin(), nil; a node-config constant, and itsnumblocksparameter is documented inrpcserverhelp.goas literally"(unused)"
Two methods that look like they belong on this list were checked and deliberately
excluded because they do read the tip: decoderawtransaction
(s.cfg.Chain.BestSnapshot().Hash) and createrawssrtx (FetchUtxoEntry + BestSnapshot +
HeaderByHash). DEFAULT/["latest"] is correct for those two.
Precedent inside the UTXO family is on the side of EMPTY, not against it: zcash.json
puts exactly this class on EMPTY — createmultisig, z_converttex, z_validateaddress,
z_listunifiedreceivers, z_validatepaymentdisclosure, getdeprecationinfo,
getexperimentalfeatures — and btc.json uses EMPTY for its bd_estimatefee. dcr.json
currently has zero EMPTY parsers across 59 methods, the only UTXO spec in the catalogue
besides doge.json and litecoin.json with none.
Impact. DEFAULT/["latest"] sets the relay's requested block to LATEST, which drags
these calls through sync-based provider gating: a provider that is healthy but lagging past
allowed_block_lag_for_qos_sync is deprioritised for a request that touches no chain data at
all. That bites harder on DCR than on a fast chain — allowed_block_lag_for_qos_sync is 1
against a 300 000 ms block time, so the tolerance window is a single 5-minute block. It also
forgoes cacheability: EMPTY yields NOT_APPLICABLE, which is indefinitely cacheable, whereas
a LATEST-bound response never is. Nothing breaks functionally, which is why this is MEDIUM
and not CRITICAL.
Suggested fix: "block_parsing": {"parser_arg": [""], "parser_func": "EMPTY"} on those
eight. Leave deterministic as-is in each case (version, getcurrentnet and estimatefee
are per-provider node config, so their current flags are already right).
MINOR
MINOR-1 — Two bounded-but-bulk reads also sit at 20 CU
Location: dcr.json L188 (getheaders), L865 (gettreasuryspendvotes)
Same class as MEDIUM-1 but with a real ceiling in dcrd, hence MINOR:
getheaders—Chain.LocateHeadersis capped bywire.MaxBlockHeadersPerMsg = 2000
(dcrd/wire/msgheaders.go:15). The handler then serializes and hex-encodes each header, so
a maximal response is 2000 × 180 B × 2 ≈ 720 KB of hex — againstgetblock's 20 CU for
one block.gettreasuryspendvotes— tallies votes overTreasuryVoteInterval×
TreasuryVoteIntervalMultiplier= 288 × 12 = 3456 blocks on mainnet
(dcrd/chaincfg/mainnetparams.go:582,586), bounded and not caller-extendable.
60 CU (the guide's "complex queries" tier) would reflect these better than 20. No
timeout_ms change needed — both are bounded.
MINOR-2 — getrawtransaction silently depends on --txindex, which dcrd defaults to OFF, and nothing in the repo says so
Location: dcr.json L383
dcrd/config.go:83 → defaultTxIndex = false. With the index off,
handleGetRawTransaction falls through the mempool lookup and returns a hard error for any
confirmed transaction:
if txIndex == nil {
err := errors.New("the transaction index must be enabled to " +
"query the blockchain (specify --txindex)")
return nil, rpcInternalErr(err, "Configuration")
}So a provider running stock dcrd serves getrawtransaction for mempool txs only and fails
every historical lookup, while the spec enables it in the base add_on: "" collection at
10 CU with deterministic: true — i.e. every DCR provider implicitly commits to it.
Kept at MINOR rather than promoted, for two reasons: the whole UTXO family in this catalogue
takes the same position (btc.json, bch.json, dash.json, doge.json, litecoin.json,
zcash.json all enable getrawtransaction in the base collection even though Bitcoin Core
likewise requires -txindex), so treating it as a DCR defect would mean re-litigating six
other shipped specs; and a provider requirement is a documentation problem, not a wrong field
value. The actionable part is that there is nowhere in this repo that states the
requirement — see MINOR-3.
Worth recording that this was checked and is not a problem for the two neighbouring
methods: existsaddress / existsaddresses also sit behind an optional index, but
dcrd/config.go:84 sets defaultNoExistsAddrIndex = false and the flag is the negative
--noexistsaddrindex, so the exists-address index is on by default and both methods work
on a stock node. getcfilterv2 has no nil guard on FiltererV2 at all (v2 filters are
header-committed since dcrd v1.7), so it is unconditionally available. No change needed for
those three, and the probe report's existsaddress watch-list entry can be closed on this
evidence.
MINOR-3 — docs/dcr/ carries only the probe report; the guide's Phase 5 doc set is absent
Location: /home/runner/work/lava-specs/lava-specs/docs/dcr/
find docs/dcr -type f returns exactly one file, METHOD_PROBE_REPORT.md. Guide Phase 5
calls for SPEC_IMPLEMENTATION.md, API_REFERENCE.md, TESTING_GUIDE.md and
QUICK_START.md. For a chain with no reachable public RPC this documentation matters more
than usual, not less — it is the only place the following can live:
- the
dcrd --txindexprovider requirement from MINOR-2; - that
dcrdrequiresrpcuser/rpcpass, so providers must carry credentials in their
node_url(the spec'sheaders: []is correct — this is deliberately not a finding, and
matchesbtc.json— but it is undocumented and will surprise the first provider); - the DCRT genesis-hash caveat (source-corroborated, never live-confirmed) so it is not lost
whenMETHOD_PROBE_REPORT.mdis eventually regenerated.
Verified correct (checked this pass, no finding)
- Phase 0 removed-field guard.
check_unused_fields.sh dcr.json→RESULT: PASS (no removed fields), exit 0. Noextra_compute_units,category.localorcategory.subscriptionanywhere;compute_unitsis the sole CU input. Envelope is exactly{"proposal":{"specs":[…]}}—jq 'keys'→["proposal"],jq '.proposal|keys'→["specs"]. The nine governance fields andtitle/description/depositare correctly absent (settled decision (a)). - Internal paths.
internal_pathis""on both collections, socheck_internal_paths.shdoes not apply; noNAME_CARRIES_PATH/LABEL_AS_PATH/AMBIGUOUS_REST_*exposure (jsonrpc, no REST names). - API completeness — complete. Diffing the 59 spec names against the 77 entries of dcrd master's
rpcHandlersBeforeInitmap leaves zero spec methods that do not exist in dcrd and 18 dcrd methods omitted — every one of them node-operator control or introspection, correctly excluded per guide Step 3.3b:addnode,node,ping,getaddednodeinfo,debuglevel,startprofiler,stopprofiler,stop,generate,setgenerate,getgenerate,gethashespersec,getwork,regentemplate,invalidateblock,reconsiderblock,verifychain,help.check_node_admin_rpcs.shagrees: "serves no new node-operator control from a base collection".searchrawtransactions,existsexpiredtickets,existsmissedticketsandgetblocktemplateare not gaps — all four were removed from dcrd and are absent from master's handler map. - Parse directives — correct against source.
GET_BLOCKNUM/getblockcount:handleGetBlockCountreturnsbest.Height.GET_BLOCK_BY_NUM/getblockhashwithparams:[%d]:handleGetBlockHashreturnsBlockHashByHeight(index).String(). The two agree on height semantics, so the chain tracker's blocknum→hash round trip is sound, and both matchbtc.json's directives byte-for-byte in shape.check_directive_presence.sh→OK. - No
GET_EARLIEST_BLOCK, noarchiveextension, nopruningverification — correct.dcrdimplements no block pruning, so there is no archive/non-archive provider split to express.extensions: []matchesbtc.json.check_extensions.sh→ PASS. - No
SUBSCRIBE/UNSUBSCRIBE— correct, and deliberately so. dcrd does have a websocket notification API (notifyblocks,notifynewtransactions,notifywinningtickets, …), but those live in the websocket-only extension command set, not inrpcHandlersBeforeInit, and they follow anotifyX/stopnotifyXpair-per-topic shape rather than the single subscribe/unsubscribe pair the directive expects. Declaring them would make aws:///wss://upstream a hard requirement for every DCR provider (the probe report confirms the router enforces this), rendering the spec unservable by the HTTP-only providers that are the realistic population for this chain. Omission is the right call; recorded here so it is visibly a decision rather than an oversight. - Network parameters.
check_network_params.sh→ PASS on all 8 values.average_block_timeconfirmed againstchaincfgfor both nets (above).block_distance_for_finalized_data: 6sits in the guide's 6–12 PoW band and matchesbtc.json; Decred's hybrid PoW + ticket-voting consensus is probabilistic, soblocks_in_finalization_proof: 3is right per settled decision (b) — themax(ceil(1000/abt),3)fallback does not apply because the finality model is not unclear.allowed_block_lag_for_qos_sync: 1is correct on both nets (10000/300000 = 0.03 → min 1;10000/120000 = 0.08 → min 1). - Verifications.
check_verifications.sh→ PASS; bothexpected_values are well-formed 64-hex and sourced as tabulated above. DCR carries the fullparse_directive; DCRT suppliesvaluesonly and noparse_directive, which is exactly the documented child-override idiom (guide Step 3.1a, "Verification special case") — the parent's directive is adopted automatically. - Collection inheritance (DCRT). Textbook. One collection whose
collection_datamatches DCR's on all four fields,apis: [], andheaders/parse_directives/extensionsall[]— which merges, inheriting DCR's values rather than zeroing them (guide Step 3.1a, "Empty arrays inherit everything"; pitfall feat(spec): add Sei chain spec #17). The probe report's router boot independently confirms the closure resolves: DCRT registered with DCR's jsonrpc apis and with its ownaverageBlockTimeof2m0soverriding DCR's5m0s. - Stateful / hanging_api. Exactly three writes —
sendrawtransaction,submitblock,sendrawmixmessage— eachstateful: 1,hanging_api: true,deterministic: false,compute_units: 10,timeout_ms: 10000.check_hanging_api.sh→ 3× PASS;check_stateful.sh→ no FAIL. 10 CU for tx submission matches the ETH1/TENDERMINT baseline. The threecreateraw*constructors are correctlystateful: 0(they build but never broadcast). parsers/parse_typeassignments. All eight are right against dcrd's actual signatures:BLOCK_HASHon.params.[0]for the hash-first methods (getblock,getblockheader,getcfilterv2,getstakeversions,gettreasurybalance,gettreasuryspendvotes) andBLOCK_LATESTfor the height-first ones (getblockhash,getblocksubsidy). Matches thezcash.json/dash.json/bch.jsonconvention.default_value: "latest"on the two treasury methods (second half ofce03338) — correct. Both have an optional leading block argument and both fall back toBestSnapshot()when it is omitted, which I confirmed inhandleGetTreasuryBalance(if c.Hash == nil || *c.Hash == "" { hash = s.cfg.Chain.BestSnapshot().Hash }) andhandleGetTreasurySpendVotes(same pattern). Withoutdefault_valuea no-argument call parses as NOT_APPLICABLE; with it, as latest. ThePARSE_BY_ARG+default_valuepairing is not novel —near.json'sgas_priceuses the identical shape. The six other hash-first methods correctly lackdefault_valuebecause their argument is required.- The three determinism flips in
ce03338— all three confirmed in dcrd master.ticketvwap→bestHeight := s.cfg.Chain.BestSnapshot().Height, default windowWorkDiffWindows * WorkDiffWindowSize.getheaders→ zerohashStopwhenc.HashStop == "", soLocateHeadersruns to the tip.gettreasurybalance→BestSnapshot().Hashwhen no hash is supplied. The commit is right on all three; MEDIUM-2 is only that the same rule stops one method short. - Headers.
headers: []on both collections is correct.dcrdrequires HTTP Basic auth, but providers carry credentials in their configurednode_url, so nopass_sendheader is needed — identical tobtc.json. (Documentation gap only; MINOR-3.) - Hygiene.
jq -e . dcr.jsonvalid; no duplicate api names within the collection;check_method_schema.sh→ 59/59schema ok; per-apitypeabsent throughout, matchingbtc.jsonand every other jsonrpc spec (the collection-leveltype: POSTgoverns).
Summary
| Count | |
|---|---|
| Endpoints reviewed | 59 methods, 2 parse directives, 2 verifications (2 specs) |
| CRITICAL | 0 |
| MEDIUM | 3 |
| MINOR | 3 |
| Removed-field cleanup findings | 0 |
| Disabled apis/collections lacking justification | 0 (there are no disabled entries at all) |
Deployment readiness: ready to deploy; the three MEDIUMs are worth a follow-up but none of
them blocks.
Nothing in dcr.json is functionally broken. The structural half of the spec — envelope,
inheritance, parse directives, verifications, network parameters, write classification,
method inventory — came back clean against primary sources on every check, and the method
inventory is genuinely complete against dcrd master rather than approximately so. ce03338
does what it claims and nothing else, and all five of its changes are correct against the
dcrd handlers.
The three MEDIUMs are refinements of judgement calls, in descending order of real-world cost:
MEDIUM-1 (four uncapped scans at 20 CU) is the one with actual exposure, and it is a
one-line-per-method fix that simply extends the pricing rule commit 0d4a613 already
established. MEDIUM-2 finishes the determinism sweep ce03338 started — I do think
gettxoutsetinfo is wrong, and the "match btc.json" rationale does not survive the
observation that this spec already overrides btc.json on six sibling methods. MEDIUM-3
is guide conformance with a modest provider-availability cost.
Router-side caching for Decred's node-local reads (MAG-4207) is out of scope for this spec
and is not reported.
|
Phase 12 — closing summary checklist (resumable run, Phases 11–11 only) Verdict this run: Annotation key: Read the Open items (what
|
| # | Severity | Item | Needs |
|---|---|---|---|
| MEDIUM-1 | fixable now | ticketvwap, ticketfeeinfo, txfeeinfo, getstakeversions → 500 CU + timeout_ms: 180000 |
extends the rule 0d4a613 set |
| MEDIUM-2 | human call | gettxoutsetinfo (+ createrawssrtx) → deterministic: false |
contradicts this PR's stated btc.json-parity rationale; reviewer argues the parity already broke on 6 sibling methods |
| MEDIUM-3 | fixable now | 8 zero-chain-state methods → EMPTY/[""] |
guide conformance |
| MINOR-1 | optional | getheaders, gettreasuryspendvotes → 60 CU (bounded at 2000 headers / 3456 blocks) |
— |
| MINOR-2 | docs | getrawtransaction needs dcrd --txindex (default OFF) |
whole UTXO family shares this; doc it |
| MINOR-3 | docs | docs/dcr/ doc set absent |
out of skill scope |
Nothing was committed or edited by this run — dcr.json is byte-for-byte ce03338 and the working tree is clean of spec changes. MAG-4207 (router-side caching for Decred's node-local reads) is out of scope and was excluded from the review.
Run stats — this pipeline run only (Phases 11–11)
Elapsed: 00h 19m 11s (first→last logged activity)
Transcripts: 1 main + 1 subagent
API round-trips: 123 (main=28, subagents=95)
Fresh tokens: input=246 output=88038 (sum=88284)
Cached tokens: cache_read=9640339 cache_write=369159
Total billed: 10097782 tokens
Split (total billed): main=1911401 subagents=8186381
Models used:
claude-opus-5 123 calls 10097782 billed
These numbers cover Phases 11–11 of this invocation only. They are not a 1–11 total: Phases 1–7 ran in the original create_spec job (see the PR body), and Phases 8–11 ran in the 2026-10-06 pipeline run, with three further /rerun-final runs on 2026-10-06 and 2026-10-07. The true cost of this PR is all of those runs added together.
…ss methods as EMPTY (MAG-2961) Applies the three items from the 2026-10-07 Phase 11 review of ce03338: - ticketvwap, ticketfeeinfo, txfeeinfo, getstakeversions: compute_units 20 -> 500 and timeout_ms 180000. Each scans a caller-chosen block range with no cap in dcrd (up to the whole chain), the same class of work as livetickets, ticketsforaddress and getticketpoolvalue. - validateaddress, verifymessage, decodescript, createrawtransaction, createrawsstx, getcurrentnet, version, estimatefee: block_parsing DEFAULT ["latest"] -> EMPTY [""]. None reads chain state. - createrawssrtx: deterministic true -> false. dcrd builds the revocation from the current tip (BestSnapshot().Hash, HeaderByHash), and the previous header seeds the PRNG that places the remainder (stake.CalculateRevocationRewards), so the output moves with the tip. gettxoutsetinfo stays deterministic: true on purpose (2026-10-07 human review): it mirrors btc.json, and the two specs should change together. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
/rerun-final Final review of 7d1673c, which applies the three items from the 2026-10-07 Phase 11 verdict on ce03338 and nothing else:
Scope: these three edits only. Pass |
|
🤖 Command acknowledged — running Phase 11 only. Progress and results post here as comments. View run |
|
Phase 11 — final reviewer verdict: Resumable run, Phases 11–11 only ( All three requested items are in, and all three are correct. The reviewer re-derived each one from dcrd
Nothing else changed.
Why the verdict is CHANGES REQUESTED. Zero CRITICAL, zero MINOR, and the reviewer's own readiness line is "Ready for deployment; the three CU/timeout alignments should follow in the next pricing pass." But Phase 11's gate is Critically, none of the three new MEDIUMs is a regression from
I re-fetched dcrd Two re-grades against the previous round, stated plainly. Last round's MINOR-1 paired Per the resumable contract this run does not halt on CHANGES REQUESTED and does not fix anything — Pre-flight gates re-run against HEAD (all exit 0, all FAIL sections empty): Reviewer-anchoring sanity check passed. All three cited line numbers ( Full reviewer report (
|
| Method | dcrd evidence | Caller-controlled extent |
|---|---|---|
ticketvwap |
handleTicketVWAP loops for i := start; i <= end; i++ { HeaderByHeight(i) }; start/end come straight from c.Start/c.End with only a start <= end <= bestHeight sanity check |
start=1, end=tip → full chain (~1.1M header reads) |
ticketfeeinfo |
handleTicketFeeInfo loops blocks back from the tip calling ticketFeeInfoForBlock → Chain.BlockByHeight (full block); the windows loop clamps only at height 0 |
blocks/windows uncapped uint32 → full chain of full block reads |
txfeeinfo |
handleTxFeeInfo → ticketFeeInfoForRange(start, end+1) → chain.HeightRange + chain.BlockByHash per block, over the caller's rangestart/rangeend |
full chain of full block reads |
getstakeversions |
handleGetStakeVersions → Chain.GetStakeVersions(hash, c.Count); internal/blockchain/chain.go:310-348 clamps count only to startNode.height+1 and then walks prevNode = prevNode.parent |
count → whole chain, and the reply serialises one entry per block |
All four are the same class of work as livetickets / ticketsforaddress / getticketpoolvalue (already 500/180000). 500 + timeout_ms: 180000 is applied to exactly these four and to nothing else. Determinism was correctly left untouched: the three tip-reading ones stay false (ticketfeeinfo/txfeeinfo unconditionally fold in feeInfoForMempool; ticketvwap defaults end to BestSnapshot().Height), and getstakeversions stays true because its walk is a pure function of (hash, count) over the block index with no tip input.
Item 2 (previous MEDIUM-3) — eight zero-chain-state methods → EMPTY / [""] — CONFIRMED CORRECT
Every one of the eight handlers was read in full. None touches s.cfg.Chain:
| Method | Handler body reduces to |
|---|---|
validateaddress |
stdaddr.DecodeAddress(c.Address, s.cfg.ChainParams) |
verifymessage |
ecdsa.RecoverCompact + stdaddr.Hash160 + address re-encode |
decodescript |
txscript.DisasmString, stdscript.ExtractAddrs, stdaddr.NewAddressScriptHash |
createrawtransaction |
wire.NewMsgTx assembly from params + address decode |
createrawsstx |
wire.NewMsgTx assembly + stake.SStxNullOutputAmounts + stake.CheckSStx |
getcurrentnet |
return s.cfg.ChainParams.Net |
version |
build constants only (_ *Server — the handler does not even receive the server) |
estimatefee |
return s.cfg.MinRelayTxFee.ToCoin() |
s.cfg.ChainParams and s.cfg.MinRelayTxFee are static network/node configuration, not chain state, so EMPTY is right for all eight.
Determinism is unchanged and remains correct on all eight: true for the six pure functions, false for version (per-provider build string) and estimatefee (per-provider --minrelaytxfee).
The eight-method boundary is exactly right, and this is worth calling out. decoderawtransaction looks like a ninth pure decoder but was correctly left at DEFAULT ["latest"]: handleDecodeRawTransaction reads s.cfg.Chain.BestSnapshot().Hash and calls s.isTreasuryAgendaActive(&prevBlkHash) to decide treasurybase vin rendering. Its deterministic: true also survives scrutiny, because the treasury agenda is permanently latched active on both networks, so the tip read cannot move the output.
Item 3 (previous MEDIUM-2, second half) — createrawssrtx → deterministic: false — CONFIRMED CORRECT
The output genuinely moves with the tip. Chain from source:
handleCreateRawSSRtx(rpcserver.go:1049) resolves the ticket withs.cfg.Chain.FetchUtxoEntry(outpoint)— a tip-relative UTXO-set read, so the call succeeds or 404s depending on the tip.prevBlkHash := s.cfg.Chain.BestSnapshot().Hash, thens.isAutoRevocationsAgendaActive(&prevBlkHash), thenprevHeader, err := s.cfg.Chain.HeaderByHash(&prevBlkHash)→prevHeaderBytes.prevHeaderBytesis passed intostake.CreateRevocationFromTicket(..., prevHeaderBytes, isAutoRevocationsEnabled)(blockchain/stake/staketx.go:1349), which forwards it toCalculateRevocationRewards(staketx.go:648).CalculateRevocationRewardsdoes, when auto-revocations is active and a remainder exists:prng := NewHash256PRNG(prevHeaderBytes) for i := int64(0); i < remainder; i++ { returnIndex := prng.UniformRandom(numReturnAmounts) returnAmounts[returnIndex]++ }
The remainder atoms are placed by a PRNG seeded with the serialized current tip header, which changes every block. The auto-revocations agenda (DCP0009) is active on mainnet and testnet3, so this branch is live. deterministic: false is correct, and it is the right call for this method specifically while decoderawtransaction stays true — the distinction between "reads the tip" and "output moves with the tip" is drawn in the right place.
Nothing else changed
git show --stat 7d1673c → dcr.json | 46 +++---, one file, 25 insertions / 21 deletions. The hunk-by-hunk diff is exactly 13 api entries: 8 × DEFAULT ["latest"] → EMPTY [""], 1 × deterministic true → false (createrawssrtx), 4 × compute_units 20 → 500 plus a new timeout_ms: 180000. No api was added, removed, renamed, disabled or re-tagged; no collection, directive, verification, header, extension or network parameter was touched. No unintended change found.
Part 2 — Full-spec audit by phase
Phase 0 — Removed-field guard
check_unused_fields.sh dcr.json→RESULT: PASS (no removed fields), exit 0.check_internal_paths.sh dcr.json→RESULT: PASS (0 warning(s), no errors); everyinternal_pathis"", so noNAME_CARRIES_PATH,LABEL_AS_PATH,AMBIGUOUS_REST_NAMEorAMBIGUOUS_REST_SHAPEexposure.- Envelope is exactly
{ "proposal": { "specs": [ DCR, DCRT ] } }. Per this run's standing decision, the absence oftitle/description/depositand of the nine removed spec-level governance fields is correct and is not reported. jq -e . dcr.jsonvalid. No duplicate api names within the collection.
Phase 1 — Provider identification
Native dcrd JSON-RPC, not a third-party wrapper. Single api_interface: "jsonrpc", single type: "POST", single collection (add_on: "", internal_path: "") on DCR; DCRT imports ["DCR"]. Two specs in the proposal. No addons, no extensions — matching the probe report's mechanical ADDONS: none declared.
Phase 2 — Network parameters
| Parameter | DCR | DCRT | Verdict |
|---|---|---|---|
average_block_time |
300000 | 120000 | OK. chaincfg/mainnetparams.go:105 TargetTimePerBlock: time.Minute * 5; chaincfg/testnetparams.go:103 time.Minute * 2. Corroborated by the probe report's inherited dcrdata lifetime mean of 299.96 s/block (~0.01% drift) and by the router resolving 5m0s / 2m0s. |
block_distance_for_finalized_data |
6 | 6 | OK. Decred is hybrid PoW/PoS with probabilistic finality; the guide's band is 6–12. |
blocks_in_finalization_proof |
3 | 3 | OK. Probabilistic finality → 3 per the finality-typed rule. |
allowed_block_lag_for_qos_sync |
1 | 1 | OK. 10000/300000 = 0.03 and 10000/120000 = 0.08, both floored to the minimum 1. |
Phase 3 — API completeness
No API-doc file, so completeness was established by diffing the spec's api names against dcrd's rpcHandlers dispatch table in internal/rpcserver/rpcserver.go.
- Spec → dcrd: all 59 api names exist as dcrd handlers. Zero typos, zero phantom methods.
- dcrd → spec: 18 handlers are absent from the spec:
addnode,debuglevel,generate,getaddednodeinfo,getgenerate,gethashespersec,getwork,help,invalidateblock,node,ping,reconsiderblock,regentemplate,setgenerate,startprofiler,stop,stopprofiler,verifychain. Every one is node-operator control, mining-template, profiling or introspection — correctly excluded, and consistent withcheck_node_admin_rpcs.shreporting(none)new node-admin exposure.
No chain-data method is missing. Coverage is complete.
Phase 4 — Method-by-method review
All 59 apis were reviewed. Block parsing, determinism, statefulness and CU were each checked against the corresponding dcrd handler.
- Block parsing. Hash-argument methods (
getblock,getblockheader,getcfilterv2,getstakeversions,gettreasurybalance,gettreasuryspendvotes) correctly pairPARSE_BY_ARG ["0"]with aparsersentry{".params.[0]", "BLOCK_HASH"}; the two treasury methods additionally carrydefault_value: "latest", which matches dcrd's "useBestSnapshot().Hashwhen the hash argument is omitted" behaviour. Height-argument methods (getblockhash,getblocksubsidy) use plainPARSE_BY_ARG ["0"]. Everything else isDEFAULT ["latest"]except the nineEMPTYentries (the eight from this commit plus none other), all of which are genuinely chain-state-free. - Determinism.
DCRapplies a stricter and more accurate rule than the Bitcoin-family precedent —gettxout,getchaintips,getdifficulty,getnetworkhashpsand the tip-reading stake methods arefalsehere wherebtc.jsonhas themtrue. No api isdeterministic: truewhose output moves with the tip under its own parsing, with the single recorded exception noted in the advisory below. - Statefulness. Exactly three
stateful: 1entries —sendrawtransaction,submitblock,sendrawmixmessage— eachhanging_api: true,deterministic: false,compute_units: 10,timeout_ms: 10000. This matches the guide's 10-CU transaction-submission rule, andcheck_stateful.sh/check_hanging_api.shboth pass with empty FAIL sections. - Compute units. The 10/20 split follows the guide (simple reads 10, block/tx queries 20) and lines up with
btc.jsonon every shared method. The 500/180000 heavy tier now holds eight methods. Three methods that belong in that tier are still priced at the cheap tier — see MEDIUM-1 through MEDIUM-3 below. These are the only Phase 4 defects found.
Phase 5 — Parse directives
Two directives on the DCR collection, both required ones present, and both byte-for-byte the pattern btc.json already uses for a UTXO JSON-RPC chain:
GET_BLOCKNUM→getblockcount,params:[],PARSE_BY_ARG ["0"].handleGetBlockCountreturnsBestSnapshot().Heightas a bare number.GET_BLOCK_BY_NUM→getblockhash,params:[%d],PARSE_BY_ARG ["0"].handleGetBlockHashreturns a bare hash string.
Both api_names exist in the collection. No GET_EARLIEST_BLOCK is required, because the spec declares no archive extension (neither does btc.json). No SUBSCRIBE/UNSUBSCRIBE anywhere — confirmed mechanically — so no ws/wss upstream requirement, and no category.subscription question arises. check_directive_presence.sh → OK.
Phase 6 — Verifications
One verification per spec, chain-id, implemented as getblockhash(0) compared against the genesis hash. Both values are 64 lowercase hex chars.
DCR=298e5cc3d985bfe7f81dc135f360abe089edd4396b86d2de66b0cef42b21d980— live-verified this run.https://dcrdata.decred.org/api/block/0andhttps://explorer.dcrdata.org/api/block/0both return exactly this hash for height 0.DCRT=a649dce53918caf422e9c711c858837e08d626ecfcd198969b24f7b634a49bac— source-verified this run. Both testnet3 explorers are still down (testnet.dcrdata.orgtimed out,testnet.decred.orgHTTP 503), so no live check was possible, but the value is corroborated independently of this spec by Decred's owndecred/tinydecredrepository,decred/decred/dcr/nets/testnet.py:GenesisHash = "a649dce53918caf422e9c711c858837e08d626ecfcd198969b24f7b634a49bac". This closes item 4 of the probe report's "what a maintainer must do" list to source-grade confidence; a livegetblockhash(0)on testnet3 remains the only stronger evidence available and is still outstanding.
check_verifications.sh passes with an empty FAIL section. No pruning verification is needed in the absence of an archive extension.
Phase 7 — Collection inheritance (DCRT)
DCRT declares one collection whose collection_data matches DCR's exactly (jsonrpc / "" / POST / ""), with apis: [], headers: [], parse_directives: [], extensions: [], and a single chain-id verification carrying only values and no parse_directive.
This is precisely the pattern the guide prescribes. Under CombineUnique merge semantics the empty arrays inherit everything from DCR rather than zeroing it, and the parse-directive-less verification adopts DCR's VERIFICATION directive while values merge by extension so the child's testnet3 expected_value wins. The probe report confirms this resolved correctly inside the router: DCRT registered with providerCount:1, a non-empty api set inherited through the import closure, its own genesis-hash verification compiled, and averageBlockTime resolving to DCRT's 2m0s override rather than DCR's 5m0s. Defining the collection is justified — it is the only way to carry the testnet3 chain-id override.
Phase 8 — Headers
headers: [] on both collections. Correct: dcrd JSON-RPC takes HTTP Basic auth at the provider's own endpoint, which is provider configuration rather than a client-forwarded credential, so there is no pass_send key to declare. Single-content-type POST collection, so no blanket pass_override hazard.
Phase 9 — Live testing
Not performed: $ARGUMENTS[2] is empty and no reachable dcrd JSON-RPC upstream exists on either network. Per the standing rule for this run, the resulting probe gaps are an endpoint limitation and are not treated as spec defects, and no method/addon/collection is disabled on account of them. The two live checks that were possible without a node — the mainnet genesis hash via the dcrdata REST explorer, and the testnet3 genesis hash via Decred's own published parameters — were both performed and both pass (Phase 6).
Pre-flight gates (re-run, confirming the orchestrator's results)
jq -e . valid · check_unused_fields.sh PASS · check_internal_paths.sh PASS · check_network_params.sh empty FAIL · check_verifications.sh empty FAIL · check_directive_presence.sh OK · check_extensions.sh PASS · check_method_schema.sh 59/59 schema ok · check_node_admin_rpcs.sh OK · check_hanging_api.sh 3/3 hanging ok · check_stateful.sh PASS · check_disabled_count.sh 0 distinct disabled methods. All exit 0, all FAIL sections empty.
Part 3 — Disable-justification audit
jq '[.proposal.specs[] | .api_collections[] | select(.enabled==false)] | length' → 0
jq '[.proposal.specs[] | .api_collections[].apis[] | select(.enabled==false)] | length' → 0
Zero enabled: false api collections and zero enabled: false apis across both DCR and DCRT. The Disabled-API Justifications ledger is correspondingly empty, so the audit is vacuously satisfied: there is no disabled entry lacking a positive-evidence row. This also matches the PR body's <!-- disabled-count: 0 --> and check_disabled_count.sh.
No CRITICAL finding from this audit.
Part 4 — Findings
MEDIUM-1 — gettreasuryspendvotes reads up to 3456 full blocks per tspend but is still priced at 20 CU with no timeout_ms
- Location:
dcr.json:869(gettreasuryspendvotes,compute_units: 20, notimeout_ms) - Evidence:
handleGetTreasurySpendVotescallschain.TSpendCountVotes(&checkBlock, tx)once per entry in the caller'stspendsarray.TSpendCountVotes(internal/blockchain/treasury.go:1097) delegates totSpendCountVotes(treasury.go:1002), whose tally loop is:for n := prevNode; n != nil && n.height >= int64(start); n = n.parent { block, err = b.fetchBlockByNode(n) // FULL block, from disk for _, stx := range block.MsgBlock().STransactions { ... stake.CheckSSGenVotes(stx) ... } }
startcomes fromstandalone.CalcTSpendWindow(expiry, tvi, tvim), and mainnet setsTreasuryVoteInterval: 288withTreasuryVoteIntervalMultiplier: 12(chaincfg/mainnetparams.go:582,586) — a 3456-block voting window. So a single in-window or mined tspend costs up to 3456 full-block reads plus aCheckSSGenVotesparse of every stake transaction in them. Thetspendsarray has no length cap and dcrd does not de-duplicate it, so N entries cost N × that. - Why this is the same tier the commit just created:
ticketfeeinfoandtxfeeinfowere raised to 500/180000 in this very commit precisely because they read full blocks over a range.ticketfeeinfowithblocks: 1reads one full block and is now priced at 500 CU;gettreasuryspendvotesreads up to 3456 full blocks in its default single-tspend form and is priced at 20. - Failure scenario: a consumer calls
gettreasuryspendvoteswith 50 copies of one mined, in-window tspend hash against a mainnet provider. dcrd performs ~172,800 full-block disk reads and parses the stake tree of each (on the order of gigabytes of block data). The provider is compensated 20 CU — 1/25th of whatticketfeeinfoearns for reading a single block — and, with notimeout_ms, the relay is cut off at the router default, so the caller gets a timeout rather than an answer while the provider has already paid the full I/O cost. - Impact: economic under-compensation and an unmetered amplification vector against every DCR/DCRT provider; legitimate treasury-governance queries over a live voting window fail on the default timeout.
- Suggested fix (for a follow-up, not this review):
compute_units: 500,timeout_ms: 180000— theliveticketstier, consistent with the four methods this commit just moved there.
MEDIUM-2 — getnetworkhashps is a caller-controlled whole-chain scan priced at 10 CU with no timeout_ms
- Location:
dcr.json:338(getnetworkhashps,compute_units: 10, notimeout_ms) - Evidence:
handleGetNetworkHashPScomputesstartHeight := endHeight - numBlockswherenumBlocks = int64(*c.Blocks)whenever the caller passesblocks >= 0. The only clamp isif startHeight < 0 { startHeight = 0 }— there is no upper bound onblocks.GetNetworkHashPSCmd.Blocksis*int(rpc/jsonrpc/types/chainsvrcmds.go:597), i.e. 64-bit, so any value is accepted. The loop then runs:Per block that is two index lookups plus afor curHeight := startHeight; curHeight <= endHeight; curHeight++ { hash, err := chain.BlockHashByHeight(curHeight) header, err := chain.HeaderByHash(hash) totalWork.Add(totalWork, standalone.CalcWork(header.Bits)) }
big.Intwork computation — strictly more work per block thanticketvwap's singleHeaderByHeight, andticketvwapwas raised to 500/180000 in this commit for exactly this shape. - Failure scenario:
getnetworkhashps(2000000, -1)on mainnet walks all ~1.1M blocks, performing ~2.2M block-index lookups and ~1.1Mbig.Intwork additions, for 10 CU — the same price asgetblockcount. With notimeout_msthe relay is severed at the router default while the provider absorbs the full CPU cost; repeated at any concurrency this starves the provider'schainLockreaders and degrades every other DCR request it is serving. - Impact: same two-sided failure as MEDIUM-1 — under-compensation plus an unmetered CPU amplification vector — and it is the cheapest-priced unbounded scan left in the spec.
- Suggested fix (for a follow-up):
compute_units: 500,timeout_ms: 180000.
MEDIUM-3 — getstakeversioninfo walks the whole chain for a caller-chosen count but is still priced at 20 CU with no timeout_ms
- Location:
dcr.json:691(getstakeversioninfo,compute_units: 20, notimeout_ms) - Evidence:
handleGetStakeVersionInfoclamps the caller'scountonly tototalIntervals := (snapshot.Height + interval - 1) / interval, then loopscounttimes callingchain.GetStakeVersions(hash, numBlocks+adjust)withnumBlocks = startHeight - endHeight— one fullStakeVersionIntervalper iteration — plus achain.BlockHashByHeightto step back. MainnetStakeVersionIntervalis144 * 2 * 7 = 2016(chaincfg/mainnetparams.go:561), socount = totalIntervals ≈ 540at today's height walks540 × 2016 ≈ 1.09Mblock-index nodes and, for each, iteratesv.Votesinto twomap[int]inttallies (~5 votes per block, so ~5.4M map updates). - Why this is inconsistent with the commit: this is the sibling of
getstakeversions, which this very commit moved from 20 to 500/180000 for walking the same block index over a caller-chosen count.getstakeversioninfovisits the same ~1.09M nodes and does strictly more per-node work (the vote-map aggregation); only its response is smaller. The spec now prices the two at 500 and 20 respectively. - Failure scenario:
getstakeversioninfo(540)on mainnet performs a full-chain block-index walk with ~5.4M map operations underchainLockfor 20 CU, then is cut off at the router's default timeout because notimeout_msis set — so the caller cannot obtain the full stake-version history at all, and the provider pays for the aborted walk. - Impact: under-compensation; the highest-count form of the method is effectively unusable through Lava;
chainLockcontention degrades co-resident requests. - Suggested fix (for a follow-up):
compute_units: 500,timeout_ms: 180000.
No CRITICAL findings
No disabled api or collection lacking justification (there are none at all), no missing required parse directive, no wrong chain-id, no removed field, no broken inheritance, no phantom or misnamed method, no mis-set stateful/hanging_api, and no regression introduced by 7d1673c.
No MINOR findings
Bounded-cost methods were checked explicitly rather than assumed: getheaders is capped at wire.MaxBlockHeadersPerMsg inside BlockChain.LocateHeaders (internal/blockchain/chain.go:1973); getvoteinfo's CountVoteVersion walks back only to the start of the current rule-change interval (internal/blockchain/thresholdstate.go:657); existsaddresses, existslivetickets and existsmempooltxs are bounded by request body size with O(1) lookups each; getblock and getrawmempool are bounded by block and mempool size and match btc.json's pricing. None of these warrants a finding.
Part 5 — Advisory notes (explicitly NOT findings; excluded from the tally)
A. gettxoutsetinfo — for the future joint btc.json + dcr.json change
Out of scope for this PR by recorded human decision ("Human decision: gettxoutsetinfo stays deterministic: true. DO NOT REVERT"). Recording the technical position for whoever makes the joint change, with no severity attached and no effect on the tally:
handleGetTxOutSetInfo (internal/rpcserver/rpcserver.go:3790) opens with best := s.cfg.Chain.BestSnapshot() and returns Height: best.Height and BestBlock: best.Hash.String() alongside the UTXO statistics, so two providers one block apart return different payloads for the same request. It also returns DiskSize: stats.Size, which is node-local and can differ between two perfectly synced providers. Under the determinism rule DCR otherwise applies consistently — tip-derived output ⇒ deterministic: false — this method would be false. btc.json:gettxoutsetinfo has the same shape (cu=500, timeout=180000, DEFAULT ["latest"], deterministic: true), which is exactly why the author has ruled the two specs change together. Nothing here needs to happen in this PR.
B. confirmations in Bitcoin-family verbose replies — catalog-wide, not a dcr.json defect
getblock, getblockheader and getrawtransaction are deterministic: true while their verbose dcrd replies embed confirmations (and nextblockhash), which are derived from the tip even when a specific finalized block hash is requested. dcr.json is identical to btc.json here, and to every Bitcoin-family spec in the catalog, so this is a settled convention rather than a defect in this spec. Raised only so it is on the record; it should travel with the same joint review as note A if anyone revisits it.
C. Out of scope by instruction
Router-side caching of Decred's node-local reads is tracked as MAG-4207 and is outside this spec. No other spec file was inspected for change, and none is proposed.
Summary
| Item | Value |
|---|---|
| Specs reviewed | 2 (DCR mainnet, DCRT testnet3) |
| API methods reviewed | 59 (all in DCR's single jsonrpc collection; DCRT inherits all 59) |
| API collections reviewed | 2 (1 per spec, both jsonrpc/POST/""/"") |
| Parse directives reviewed | 2 (GET_BLOCKNUM, GET_BLOCK_BY_NUM) |
| Verifications reviewed | 2 (chain-id on each spec) |
| Disabled apis / collections | 0 / 0 — ledger vacuously satisfied |
Items claimed by 7d1673c and independently confirmed |
3 of 3 |
Unintended changes in 7d1673c |
0 |
| CRITICAL | 0 |
| MEDIUM | 3 (all one category: heavy-scan methods left in the cheap CU tier) |
| MINOR | 0 |
| Advisory notes (not findings) | 3 |
Verdict: the three fixes this commit claims are all correctly applied and independently verified against dcrd source, and the commit changed nothing else. The spec is structurally sound — valid envelope, no removed fields, complete method coverage against dcrd's handler table, correct network parameters on both networks, correct and (for mainnet) live-verified chain-id verifications, textbook imports inheritance for DCRT, and zero disabled entries to justify.
The three remaining MEDIUM findings are all the same category as the one this commit just fixed: gettreasuryspendvotes, getnetworkhashps and getstakeversioninfo are heavy scans — one of them (gettreasuryspendvotes) reading thousands of full blocks per call — still sitting in the 10/20-CU tier with no timeout_ms, while their structural siblings now sit at 500/180000. None of them blocks deployment: they are mispricings, not correctness or safety defects, and each has an obvious one-line fix in the tier this commit established. Ready for deployment; the three CU/timeout alignments should follow in the next pricing pass.
|
Phase 12 — closing summary checklist (resumable run, Phases 11–11 only) Reviewed Annotations: Working-tree state
Required actionNot blocking on the author's judgement, but the gate will not clear until these move. Each is a one-line change into the tier
To apply them: Still carried forward, unchanged by this run: a live testnet3 Run stats — this pipeline run (Phases 11–11) onlyThis is a resumable run covering Phase 11 alone, in a separate workflow run from the |
…s timeout (MAG-2961) Applies the three items from the 2026-11-08 Phase 11 review of 7d1673c, the same rule 7d1673c applied to ticketvwap and its siblings: - getnetworkhashps: compute_units 10 -> 500, timeout_ms 180000. dcrd takes the caller's block count with no upper bound, so one call can walk the whole chain. - gettreasuryspendvotes: compute_units 20 -> 500, timeout_ms 180000. Each tspend in the caller's list costs up to 3456 full-block reads (the mainnet voting window), and the list has no length cap. - getstakeversioninfo: compute_units 20 -> 500, timeout_ms 180000. The caller's interval count is capped only by chain height, so one call can walk about 1.09M block-index nodes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
/rerun-final Final review of d02718a, which applies the three items from the 2026-11-08 Phase 11 verdict on 7d1673c and nothing else:
Scope: these three edits only. As in the previous run, Pass |
|
🤖 Command acknowledged — running Phase 11 only. Progress and results post here as comments. View run |
|
Phase 11 — final reviewer verdict: ✅ APPROVED ( Resumable run, Phases 11–11 only. Reviewed commit The three items this commit claims to apply — all three CONFIRMED CORRECT
The reviewer read the handlers in full rather than accepting the rationale, and confirmed each is genuinely an uncapped caller-controlled scan. It also confirmed the negative half: Heavy tier is now internally coherent and complete. All 11 methods at that price carry identical
Scope discipline
Full-spec audit — no in-scope defects
Disable-justification audit: vacuously satisfied. Zero Pre-flight gates re-run against HEAD by the orchestrator (all exit 0, all FAIL sections empty): Advisory notes (NOT findings — excluded from the tally, no severity)
Limitations of this review (stated honestly)
Verdict: APPROVED. |
|
Phase 12 — closing summary checklist (resumable run, Phases 11–11 only) Chain: Decred — This run executed Phase 11 only ( Open advisory items carried forward (none block this PR)
Run stats — this pipeline run (Phases 11–11) onlyThese numbers cover Phase 11 of this run only — not a Phases 1–11 grand total. The original Phases 1–7 time and tokens live in the Run complete. |
|
@avitenzer could you re-review? Changes since your 2026-10-07 review:
|
avitenzer
left a comment
There was a problem hiding this comment.
Re-reviewed at d02718a. Approving.
Checked:
- The diff since
ce03338(7d1673c,d02718a) is exactly the listed changes, nothing else:- 7 range scans → 500 CU +
timeout_ms: 180000, the same asbtc.json'sgettxoutsetinfo. The router uses the spec'stimeout_msinstead of the time it derives from CU. - 8 stateless methods →
EMPTYparsing. createrawssrtx→deterministic: false.gettxoutsetinfounchanged.
- 7 range scans → 500 CU +
- The
deterministicflags on the 8EMPTYmethods make sense:versionandestimatefeearefalse, the pure functions aretrue. - The branch merges into current main with no conflicts. Main's spec guards pass on the merged
dcr.json: node-admin RPCs, removed fields, internal paths, method schema, network params, verifications, directive presence, and disabled count = 0 against the body. - On smart-router main (v1.6.7), the spec at
d02718aloads and builds. I had no keyed Decred endpoint, so I did not check live answers; that evidence is your run at7d1673c, andd02718achanges only CU and timeouts.
Not covered: the 33 methods NOWNodes answers with 405 have still never answered live. Router caching stays in MAG-4207.
dcrd's handleTxFeeInfo always embeds the live mempool fee distribution (FeeInfoMempool), so two providers can answer the same call differently, exactly like ticketfeeinfo, which is already deterministic: false. Clears the Phase 11 CRITICAL on #186. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…961) getticketpoolvalue and ticketsforaddress both walk the whole live ticket pool (about 41k entries, one utxo read each). Give them 500 CU and a 180 s timeout, matching livetickets and gettxoutsetinfo. These were the two remaining MEDIUMs from the Phase 11 review on #186. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
New chain spec: Decred
Revisions after the 2026-10-07 review
ticketvwap,getheadersandgettreasurybalance→deterministic: false. With no arguments each reads the tip:ticketvwapdefaults toend = bestHeight,getheaderswith an emptyhashStopreturns headers up to the tip, andgettreasurybalancewith no hash readsBestSnapshot()(dcrdinternal/rpcserver/rpcserver.go). Atruewould raise false cross-validation outliers between providers at different heights.gettxoutsetinfostaystrueto matchbtc.json; the two specs should change together.gettreasurybalanceandgettreasuryspendvotes:"default_value": "latest"added toblock_parsing. Without it a no-argument call parses as NOT_APPLICABLE (ParseRawBlock, smart-routerprotocol/parser/parser.go), not latest.Revisions after the 2026-10-07 Phase 11 review (
7d1673c)ticketvwap,ticketfeeinfo,txfeeinfo,getstakeversions:compute_units20 → 500 andtimeout_ms: 180000(Phase 11 MEDIUM-1). Each scans a block range the caller chooses, and dcrd caps none of them (the range can be the whole chain). That is the same class of work aslivetickets,ticketsforaddressandgetticketpoolvalue.validateaddress,verifymessage,decodescript,createrawtransaction,createrawsstx,getcurrentnet,version,estimatefee:block_parsingDEFAULT ["latest"]→EMPTY [""](Phase 11 MEDIUM-3). None of them reads chain state. Theirdeterministicflags are unchanged.createrawssrtx:deterministictrue → false (Phase 11 MEDIUM-2, second half). dcrd builds the revocation from the current tip (BestSnapshot().Hash, thenHeaderByHash), and that header seeds the PRNG that places the remainder (stake.CalculateRevocationRewards), so the output moves with the tip.btc.jsonhas no such method, so the parity argument below does not apply.failed=0. Of the 13 changed methods,validateaddress,decodescript,createrawtransactionandestimatefeeanswered, andverifymessagereturned dcrd's own error for a junk signature. The other 8 get NOWNodes' HTTP 405, like the 33 gated methods below. The router bound all 13 relays to their spec method (noDefault-*metric labels).Revisions after the 2026-11-08 Phase 11 review (
d02718a)getnetworkhashps(10 CU),gettreasuryspendvotes(20) andgetstakeversioninfo(20) → 500 CU andtimeout_ms: 180000, the same rule as the four methods above. dcrd caps none of their scans:getnetworkhashpscan walk the whole chain,gettreasuryspendvotesreads up to 3456 full blocks per tspend in a list with no length limit, andgetstakeversioninfocan walk about 1.09M block-index nodes.Human decision:
gettxoutsetinfostaysdeterministic: true. DO NOT REVERTPhase 11 MEDIUM-2 (at
ce03338) is right that the result carriesheightandbestblock. The 2026-10-07 human review kepttrueanyway: the method mirrorsbtc.json, so both specs change together or neither. That change belongs in a PR that editsbtc.jsonanddcr.jsontogether, outside this PR's scope. This is a settled decision for this PR: a reviewer who still disagrees should record it as advisory for that joint change, not as a finding against this PR.Inputs provided
Jira: MAG-2961 "Add Decred spec (the customer)" (epic MAG-2888). The ticket asks for mainnet only. DCRT (testnet3) is included because new_chain mode requires a testnet index.
Chain
Decred (DCR): hybrid proof-of-work / proof-of-stake (each block calls 5 tickets; a block needs at least 3 votes approving its parent). Node: dcrd (latest release v2.1.6, 2026-08-18; JSON-RPC API semver 8.3.0). Source: https://github.com/decred/dcrd. RPC docs: https://github.com/decred/dcrd/blob/master/docs/json_rpc_api.mediawiki
Transport: JSON-RPC over HTTP POST
/(JSON-RPC 1.0 and 2.0 both accepted; 2.0 batches supported) and WebSocket/ws. Ports: mainnet 9109, testnet3 19109. dcrd serves chain RPCs only; wallet RPCs live in the separate dcrwallet process (out of scope).Spec shape: standalone, NOT an import of BTC. DO NOT REVERT (record in the PR body)
dcrd is a btcd descendant, but its RPC surface diverges from bitcoind's:
txandstx) pluspowhash, which differs fromhashsince DCP0011 moved PoW to BLAKE3.Status: honoured in full.
DCRships with noimportsand 59 of its own apis. None of the 12 absent methods was emitted.getrawtransactioncarriesDEFAULT ["latest"], not BTC'sPARSE_BY_ARG ["2"]. No REST collection, noblockdaemonadd-on, and the chain-id value is the genesis hash rather than"main".DCRTcarriesimports: ["DCR"]— the canonical mainnet→testnet pattern (btc.json'sBTCT, iota.json, the whole catalog); the standalone mandate is about not importing BTC, which is honoured.Live-verified 2026-10-06 (mainnet, through a keyed NOWNodes endpoint; the key is NOT part of this spec or PR)
chain= "mainnet", blocks 1,121,269, syncheight = blocks, initialblockdownload false.feerate) answer normally.Status: honoured. All 33 whitelisted-out methods ship enabled and are carried on the watch-list below. Zero methods are disabled anywhere in the file. The ENDPOINTS block below is intentionally empty on both lines — no endpoint was invented and no explorer API is listed as an RPC. The two reachable dcrdata mirrors were used only to corroborate the genesis hash and block timing, and are labelled as explorer corroboration, never as RPC.
Chain identity (DO NOT REVERT)
getblockchaininfo.chain= "mainnet" is not unique: btcd (Go Bitcoin) also reports "mainnet".Status: honoured. The
chain-idverification pins ongetblockhash [0], not ongetblockchaininfo.chain. Both magics were independently re-confirmed againstwire/protocol.go(mainnetMainNet CurrencyNet = 0xd9b400f9= 3652452601; testnet3TestNet3 = 0xb194aa75= 2979310197), and the mediawiki's 3652501241 was confirmed to be Bitcoin's btcd-inherited magic. Nogetcurrentnetverification was added — one identity pin suffices, andgetcurrentnetis one of the methods the only reachable gateway refuses, so it is unverifiable today.Parse directives
Status: honoured. Both directives ship with
PARSE_BY_ARG ["0"]; theirfunction_templatestrings hash byte-identical to btc.json's (verified bycompare_spec_directives.sh—getblockcountandgetblockhashare the two methods where dcrd and bitcoind agree on both name and arity). GET_EARLIEST_BLOCK is omitted, resolved from dcrd's storage model — see auto-decision #1.Ticket-mandated and measured values: DO NOT REVERT (record each one in the PR body's do-not-revert section)
Status: all four shipped verbatim.
jqconfirms on both entries:block_distance_for_finalized_data: 6,blocks_in_finalization_proof: 3,allowed_block_lag_for_qos_sync: 1;average_block_time300000 (DCR) / 120000 (DCRT). Corroborated from source this run:chaincfg/mainnetparams.goTargetTimePerBlock: time.Minute * 5andchaincfg/testnetparams.goTargetTimePerBlock: time.Minute * 2. An independent lifetime-mean check (genesis ts 1454954400 → height 1,121,271 @ ts 1791288638) gives 299.96 s/block, agreeing with the 300000 ms target to within 0.02%; the 313.3 s 2,000-block mean and two 100-block samples (321.4 s, 353.1 s) all sit modestly above target, as expected for Decred. No >20% disagreement, so no block-time gate was triggered.Category rules
stateful: 1andhanging_api: true(same rule as MAG-4035). submitblock and sendrawmixmessage are also writes; mark them stateful.Status: honoured. Exactly three apis carry
stateful: 1—sendrawtransaction,submitblock,sendrawmixmessage— each withhanging_api: trueand an explicittimeout_ms: 10000(the flag alone only adds2 * average_block_time; btc.json's ownsendrawtransactionships this gap and it was deliberately not copied). Every other api isstateful: 0. The WebSocket-only family is omitted entirely — see auto-decision #2.Gateway gating is not absence
These errors are gateway gating, NOT evidence that a method is absent: -32601 on one provider while another serves it, -32401 "auth required", -32005 rate limits, drpc code 35 "not available on free plan". Never disable anything because of them; record which provider serves each method.
Status: honoured — zero disabled entries in the file (
<!-- disabled-count: 0 -->). Provider coverage: the keyed NOWNodes mainnet endpoint is the only RPC known to serve Decred at all, and it servesgetblockchaininfo,getblockhash,getblockcount,getrawmempoolandestimatesmartfeewhile whitelisting outversion,getbestblock,getstakedifficulty,existsaddressandgetcurrentnet. No other provider serves Decred.Sources used
getcurrentnetmagic 3652501241 is wrong, being Bitcoin's btcd-inherited value)UFWebsocketOnly)rpcHandlersBeforeInitHTTP handler map,rpcLimited,rpcAskWallet,rpcUnimplementedwsHandlersBeforeInit; confirms same-port/vs/wsroutingTxIndexer,ExistsAddresser,FiltererV2,MixPoolerCurrencyNetmagicssearchrawtransactions/txbyaddridxare gone)testnet.dcrdata.orgreturned HTTP 503 andtestnet.decred.orgwas down on 2026-10-06. The only working mainnet endpoint is a keyed NOWNodes endpoint whose key is withheld and is not part of this spec or PR. No endpoint was invented, and no explorer REST API is listed as an RPC.DCRis standalone (importsabsent) per the do-not-revert mandate.btc.jsonwas used as a convention template only — CU bands (10 / 20 / 500+timeout_ms),category-flag conventions, thePARSE_BY_ARGidiom, the 2-directive shape and the spec-entry key order — never as an import and never as an api-list source.kaspa.json(the repo's only standalone non-EVM spec) was the reference for pinning identity on a block hash.DCRTimportsDCR.Calculations table
average_block_timechaincfg/mainnetparams.goTargetTimePerBlock: time.Minute * 5;chaincfg/testnetparams.gotime.Minute * 2block_distance_for_finalized_datablocks_in_finalization_proof3(probabilistic)allowed_block_lag_for_qos_syncmax(ceil(10000 / 300000), 1)= 1;max(ceil(10000 / 120000), 1)= 1Empirical corroboration of
average_block_time(mainnet): lifetime mean from genesis ts 1454954400 → height 1,121,271 @ ts 1791288638 = 299.96 s/block (0.02% from the 300 s target); 2,000-block mean 313.3 s; two 100-block samples 321.4 s and 353.1 s. All above-target drift, which is normal for Decred. Deviation from docs < 20%, so the docs value was locked and no disagreement gate fired. DCRT was not measurable (no reachable testnet endpoint) so its 2-minute protocol target was used.No human was available, so every gate below was auto-resolved with the conservative default and is recorded here.
archiveextension, nopruningverification, noGET_EARLIEST_BLOCKdirective;extensions: []). The archive-researcher returnedstatus: OK(notNEEDS_HUMAN_DECISION), so this was a researched conclusion rather than a coin-flip, but it resolves the ticket's open question "GET_EARLIEST_BLOCK and archive: decide from dcrd's storage model". Evidence: dcrd'sconfig.gocontains no block-pruning flag of any kind (the only storage flags are--txindex,--droptxindex,--noexistsaddrindex,--dropexistsaddrindex); the README states dcrd "maintains the entire past transactional ledger of Decred" with disk use only growing (~2.5 GB/yr); docs.decred.org's full-node page documents no pruning or archive tier; and NOWNodes offers only one Decred node tier. Archive-vs-full is therefore not a meaningful Decred distinction. Both live probes were honestly recorded asskipped(no keyless endpoint) rather than faked. Deliberately not copied: the uncalibratedrule.block: 42600thatdoge.json,litecoin.json,dash.jsonandbch.jsonall carry.FUNCTION_TAG_SUBSCRIBEdirective. Declaring a ws interface that cannot be probed (there is no reachable endpoint, keyed or otherwise, for ws) is the riskier option, so the conservative default was taken: no ws collection, noSUBSCRIBE/UNSUBSCRIBEdirectives, and the 17 names absent fromapis. Omission reason: platform-specific — each is registeredUFWebsocketOnlyinchainsvrwscmds.goand present inwsHandlersBeforeInit, but absent from the HTTP handler maprpcHandlersBeforeInit, so none is reachable over the HTTP POST collection this spec declares. Names:authenticate, loadtxfilter, notifyblocks, stopnotifyblocks, notifywork, stopnotifywork, notifytspend, stopnotifytspend, notifynewtransactions, stopnotifynewtransactions, notifynewtickets, notifywinningtickets, notifymixmessages, stopnotifymixmessages, rebroadcastwinners, rescan, session. If Lava wants Decred subscriptions, this is the decision to revisit — the surface is real and fully enumerated above.rpcLimitedmap, i.e. they need fullrpcusercredentials rather than therpclimitusertier a Lava provider would expose. Node control:stop,node,addnode,getaddednodeinfo,debuglevel,startprofiler,stopprofiler,ping. Chain surgery:invalidateblock,reconsiderblock,regentemplate,verifychain. Legacy solo-CPU-mining control:generate,setgenerate,getgenerate,getwork,gethashespersec. Introspection:help. Anadd_on: "admin"collection was considered and rejected — omitting a surface we cannot probe is the conservative choice.rpcLimited:getconnectioncount,getmempoolinfo,getmininginfo,getpeerinfo,getticketpoolvalue,gettreasuryspendvotes,gettxoutsetinfo. They are reads, not node control, and btc.json keeps its equivalents (getconnectioncount,getmempoolinfo,gettxoutsetinfo) in its base collection. A provider running limited-tier credentials may see these rejected — worth a reviewer's eye.getrawtransactionkept in the BASE collection, not behind atxindexadd-on. dcrd's--txindexdefaults to false and gatesgetrawtransactionfor confirmed non-mempool txs (handler returns "the transaction index must be enabled to query the blockchain (specify --txindex)"), which is a genuine argument for an add-on. Rejected because bitcoind has the identical-txindexrequirement and btc.json keeps the method in base; gating the chain's primary transaction read would leave the base spec unable to read a transaction at all. Treated as a provider node-configuration requirement (providers must run--txindex) rather than an opt-in API tier. This is the most debatable call in the spec.--txindex, dcrd's other capability gates do not warrant one: the exists-address index is on by default (defaultNoExistsAddrIndex = false, opt out via--noexistsaddrindex) soexistsaddress/existsaddressesare base;getcfilterv2has no gating flag (GCS v2 filters are structurally mandatory post-DCP0005) so it is base; mixing (getmixmessage,getmixpairrequests,sendrawmixmessage) and treasury (gettreasurybalance,gettreasuryspendvotes) have zero gating flags inconfig.goand are chain-state gated only, so they are base.DCRTcarriesimports: ["DCR"]. The ticket's standalone mandate is explicit about not importing BTC but silent on the mainnet→testnet self-import. The canonical catalog pattern (btc.json'sBTCT, iota.json, and the lean-testnet shape the skill documents) was taken as the conservative default:DCRTdeclaresapis: [],parse_directives: [], and overrides only the chain-idexpected_value.getblockhash [0]through the keyed NOWNodes endpoint on 2026-10-06 returned the shipped hash, independently corroborated by two dcrdata mirrors. Testnet3'sa649dce5…is source-derived only (decred/tinydecrednets/testnet.py, dcrdata rpcclient tests), partially corroborated bychaincfg/testnetparams.go's genesis timestamp 1533513600 = 2018-08-06 (the current testnet3 reset). Confidence: medium — this is the single value most worth a maintainer's live check. Note testnet3 has been reset before while keeping its name and magic, so a future reset would change this hash.enabled: false— in particular not the 33 the keyed gateway whitelists out (first counted as five; corrected 2026-10-07). Watch-list (re-probe against a fully-permissioned node): all 33 gated methods, including the five first seen,version,getbestblock,getstakedifficulty,existsaddress,getcurrentnet, and the ticket-pool scans.gettxoutsetinfo→ 500 +timeout_ms: 180000(btc.json ships exactly this for the identical method; full UTXO-set scan);livetickets,ticketsforaddressandgetticketpoolvalue→ 500 +timeout_ms: 180000(each walks the full live-ticket pool, ~41,000 entries; raised from 20 inc6a1592and0d4a613to matchgettxoutsetinfo);getblockhash→ 10 rather than 20 despitePARSE_BY_ARG(btc.json ships this identical method at 10); four set-scan / range-aggregate methods parsedDEFAULT ["latest"]rated 20 rather than 10 on thegetrawmempoolprecedent (getrawmempool,getheaders,existsaddresses,existslivetickets); and seven uncapped range scans → 500 +timeout_ms: 180000:ticketvwap,ticketfeeinfo,txfeeinfoandgetstakeversions(from 20, in7d1673c), thengetnetworkhashps(from 10),gettreasuryspendvotesandgetstakeversioninfo(from 20, ind02718a). Two brief-suggested values were reverted to the mechanical table where btc.json offered no same-shaped precedent:getblocksubsidyandgettreasurybalance, both 10 → 20.timeout_ms: 10000(the repo's dominant hanging-api value). dcrd returns on mempool/validation acceptance rather than block inclusion, so this is ample; btc.json's ownsendrawtransactionshipshanging_api: truewith notimeout_msand that gap was deliberately not copied.No STOP-and-ask gate fired beyond these. Archive returned
status: OK; the block-time disagreement was 0.02% (far under the 20% threshold); no existingdcr.jsonordecred.jsonwas present (confirmed across all 131 root spec files, none of which claimsDCRorDCRT), so there was no existing-file prompt.Phase 6 — static gate results
All nine gates PASS; no fixer pass was needed.
extensions: []; triplet uniformly absent (not mixed)gettxoutsetinfo=500INFO: retention unknown— no finite window exists; no strayrule.block/latest_distance/cu_multiplierPhase 7 gates:
jqexit 0;check_unused_fields.sh→RESULT: PASS (no removed fields);check_disabled_count.sh→ 0 distinct disabled methods (matches the marker above); internal-path guard N/A (everyinternal_pathis"").Methods named in earlier briefing material that DO NOT EXIST in current dcrd and were never emitted (source-verified absent from both
chainsvrcmds.goand the handler map):getblocktemplate(dcrd has no getblocktemplate and no stratum; mining is legacygetwork),searchrawtransactions(removed with the legacytxbyaddridxindex),existsexpiredtickets,existsmissedtickets,notifystakedifficulty,notifyspentandmissedtickets, andestimatepriority(in dcrd'srpcUnimplementedmap — errors on every call). The real name isgetnettotals, notgetnetworktotals.Supporting evidence (INLINE — do NOT reference file paths)
Parse directives
The
DCRcollection declares exactly two parse_directives.getblockcountandgetblockhashare the two methods where dcrd and bitcoind agree on both name and arity, so these are byte-identical in shape to btc.json's (confirmed bycompare_spec_directives.sh: both rows PRESENT, hashes match, no MISSING / EXTRA / HASH-MISMATCH).GET_BLOCK_BY_NUMreturns a genuine block identifier (the block hash), not an echoed height, so data-reliability cross-checks are meaningful. Decred is not a slot-based chain, so no empty-slot handling applies. NoGET_EARLIEST_BLOCK— omitted with the rest of the archive triplet (auto-decision #1). NoSUBSCRIBE/UNSUBSCRIBE— no declared api name containsubscribe(auto-decision #2).chain-id verifications (genesis-hash identity pin)
getblockchaininfo.chainreturns"mainnet"on Decred, which btcd also returns — it cannot distinguish a Decred node from a Go-Bitcoin node, so it is unusable as an identity pin. The verification pins ongetblockhash [0]instead (kaspa.jsonis the in-repo precedent for pinning identity on a block hash).DCR:
DCRT (lean inherited form —
imports: ["DCR"]merge semantics supply the directive; btc.json'sBTCTpattern):Spec shape, network params, and the three write methods
Top-level keys:
proposal→specsonly. Spec-entry key set mirrors btc.json exactly(
index, name, enabled, [imports], block_distance_for_finalized_data, blocks_in_finalization_proof, average_block_time, allowed_block_lag_for_qos_sync, api_collections). Collection:api_interface: "jsonrpc",internal_path: "",type: "POST",add_on: "",headers: [],inheritance_apis: [],extensions: [].Archive triplet, both entries — uniformly absent, as intended:
The only
statefulapis (the chain's three writes), each with an explicit timeout:Query for
hanging_api: truewith notimeout_msreturns empty. CU histogram across the 59 apis: 39×10, 9×20, 11×500 (the 500s aregettxoutsetinfo,livetickets,ticketsforaddress,getticketpoolvalue,ticketvwap,ticketfeeinfo,txfeeinfo,getstakeversions,getnetworkhashps,gettreasuryspendvotesandgetstakeversioninfo, each withtimeout_ms: 180000).The 59 declared methods
One
jsonrpcPOST collection,add_on: "":createrawssrtx,createrawsstx,createrawtransaction,decoderawtransaction,decodescript,estimatefee,estimatesmartfee,estimatestakediff,existsaddress,existsaddresses,existsliveticket,existslivetickets,existsmempooltxs,getbestblock,getbestblockhash,getblock,getblockchaininfo,getblockcount,getblockhash,getblockheader,getblocksubsidy,getcfilterv2,getchaintips,getcoinsupply,getconnectioncount,getcurrentnet,getdifficulty,getheaders,getinfo,getmempoolinfo,getmininginfo,getmixmessage,getmixpairrequests,getnettotals,getnetworkhashps,getnetworkinfo,getpeerinfo,getrawmempool,getrawtransaction,getstakedifficulty,getstakeversioninfo,getstakeversions,getticketpoolvalue,gettreasurybalance,gettreasuryspendvotes,gettxout,gettxoutsetinfo,getvoteinfo,livetickets,sendrawmixmessage,sendrawtransaction,submitblock,ticketfeeinfo,ticketsforaddress,ticketvwap,txfeeinfo,validateaddress,verifymessage,versionMethods carrying a block identifier at arg 0, with
PARSE_BY_ARG ["0"]:getblock(hash),getblockhash(height),getblockheader(hash),getblocksubsidy(height),getcfilterv2(hash),getstakeversions(hash),gettreasurybalance(optional hash),gettreasuryspendvotes(optional block hash). Those two carry"default_value": "latest", so a call without the optional hash parses as latest. Eight methods that read no chain state useEMPTY [""]:validateaddress,verifymessage,decodescript,createrawtransaction,createrawsstx,getcurrentnet,version,estimatefee. All others useDEFAULT ["latest"].Two param-shape traps avoided, both verified by the parse-directive gate:
getrawtransactionusesDEFAULT ["latest"]— not btc.json'sPARSE_BY_ARG ["2"], which points at a 3rd positionalblockhashparam that dcrd's 2-paramgetrawtransaction(txid string, verbose *int = 0)does not have; andgettxoutis given no block param, since dcrd'sgettxout(txid, vout, tree int8 REQUIRED, includemempool)reads only the live UTXO set.Why dcrd has no archive tier (storage-model evidence)
config.go— no--pruneflag or analogue exists. The only storage-related flags are--txindex(defaultfalse),--droptxindex,--noexistsaddrindex(defaultfalse, i.e. the exists-address index is on),--dropexistsaddrindex.sample-dcrd.conf— zero mentions ofprune,filter, orindexbeyondtxindex; pruning is not even offered as a commented-out operator option.docs/json_rpc_api.mediawiki§8.1.2 — "Using getblock to Retrieve the Genesis Block" is presented as a normal operation on a default node.https://explorer.dcrdata.org/api/block/1→ HTTP 200 with full block-1 data.The only historical-access limiters are the optional indexes, which fail identically at any height rather than only old ones — a node-configuration concern, not an archive-extension concern.
🤖 Generated with Claude Code
🤖 Generated by
create_spec.yml· workflow run · full transcript in run artifacts