Task
-32000 is DISPATCH_FAILED in dig-node-service and SERVER_ERROR in dig-rpc-protocol. Decide
whether the shell adopts the crate's name, and say what a client matching the other one sees.
Split out of #478, which pointed the shell's error
catalogue at dig_rpc_protocol::ErrorCode for every other shared code and deliberately excluded this
one rather than renaming it silently.
Why it was excluded there, measured
-32004 was safe to reconcile because RESOURCE_NOT_AVAILABLE_AT_ROOT had zero producers: every
-32004 frame dig-node emits is minted in dig-node-core and framed from dig_rpc_protocol, so it
already carried RESOURCE_UNAVAILABLE. The long name existed only in the discovery document — a lie
about the wire, fixable without touching the wire.
-32000 is the opposite case:
DISPATCH_FAILED is on the wire. dig-node-service's rpc_error (src/rpc.rs:67-77) puts
code.name() into error.data.code, and server.rs mints ErrorCode::DispatchFailed at two sites
(the spawn join failure, and the Sage wallet HTTP fallback arm).
dig-node-core mints no -32000 under ServerError — grep returns nothing — so unlike -32004
there is no second name reaching the same client. The shell's catalogue and the shell's frames agree.
So this is a divergence between two documents, not a lie to a client, and renaming it is a genuine
released-wire-name change of the class SYSTEM.md records the dig-rpc-protocol 0.9.0 yank for.
Scope
Pick one and record it in SPEC.md §error table either way:
- Keep
DISPATCH_FAILED and state in SPEC.md that the shell's -32000 carries a more specific
name than the crate's generic one, deliberately — a dispatch failure is strictly narrower than
"server error", and the narrower name is the more useful branch key.
- Adopt
SERVER_ERROR, accepting the break, with the migration a renamed wire string needs.
Note that option 1 is not the status quo by default: it needs the SPEC sentence, because today the
disagreement reads as unexamined drift.
Evidence
crates/dig-node-service/src/meta.rs (code() / name(), both carrying a comment pointing here),
src/rpc.rs:74, src/server.rs, dig-rpc-protocol 0.10.2 src/error.rs:113,267.
Parent: #478
Task
-32000isDISPATCH_FAILEDindig-node-serviceandSERVER_ERRORindig-rpc-protocol. Decidewhether the shell adopts the crate's name, and say what a client matching the other one sees.
Split out of #478, which pointed the shell's error
catalogue at
dig_rpc_protocol::ErrorCodefor every other shared code and deliberately excluded thisone rather than renaming it silently.
Why it was excluded there, measured
-32004was safe to reconcile becauseRESOURCE_NOT_AVAILABLE_AT_ROOThad zero producers: every-32004frame dig-node emits is minted indig-node-coreand framed fromdig_rpc_protocol, so italready carried
RESOURCE_UNAVAILABLE. The long name existed only in the discovery document — a lieabout the wire, fixable without touching the wire.
-32000is the opposite case:DISPATCH_FAILEDis on the wire.dig-node-service'srpc_error(src/rpc.rs:67-77) putscode.name()intoerror.data.code, andserver.rsmintsErrorCode::DispatchFailedat two sites(the
spawnjoin failure, and the Sage wallet HTTP fallback arm).dig-node-coremints no-32000underServerError— grep returns nothing — so unlike-32004there is no second name reaching the same client. The shell's catalogue and the shell's frames agree.
So this is a divergence between two documents, not a lie to a client, and renaming it is a genuine
released-wire-name change of the class
SYSTEM.mdrecords thedig-rpc-protocol0.9.0 yank for.Scope
Pick one and record it in
SPEC.md§error table either way:DISPATCH_FAILEDand state inSPEC.mdthat the shell's-32000carries a more specificname than the crate's generic one, deliberately — a dispatch failure is strictly narrower than
"server error", and the narrower name is the more useful branch key.
SERVER_ERROR, accepting the break, with the migration a renamed wire string needs.Note that option 1 is not the status quo by default: it needs the SPEC sentence, because today the
disagreement reads as unexamined drift.
Evidence
crates/dig-node-service/src/meta.rs(code()/name(), both carrying a comment pointing here),src/rpc.rs:74,src/server.rs,dig-rpc-protocol0.10.2src/error.rs:113,267.Parent: #478