Skip to content

docs(adr-0011): record why request-batch keeps its dead outer chain-error#427

Open
lgahdl wants to merge 1 commit into
nullislabs:developfrom
bleu:docs/288-request-batch-outer-error-escape-hatch
Open

docs(adr-0011): record why request-batch keeps its dead outer chain-error#427
lgahdl wants to merge 1 commit into
nullislabs:developfrom
bleu:docs/288-request-batch-outer-error-escape-hatch

Conversation

@lgahdl

@lgahdl lgahdl commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #288. request_batch's outer chain-error (result<list<rpc-result>, chain-error>) never returns Err on the reference host — every failure (denied method, node revert, transport fault) surfaces per-entry as rpc-result::err, since this host folds each entry independently. The outer arm is structurally dead here.

The issue offered two options: flatten the WIT to list<rpc-result>, or record why the outer error is retained. Went with the latter — the WIT stays as-is (a breaking wire change for a case that's genuinely load-bearing for other host implementations isn't worth it), and the existing rationale (already present as a doc comment on chain::Host::request_batch) is now also recorded in ADR-0011, with the two cross-linked.

The reasoning: a different host could need to fail the whole batch atomically before dispatching any entry — e.g. a transport that can only submit the request list as one unit. This host doesn't have that constraint and chooses to fold per-entry instead, but that's a design choice, not the only valid one, so the WIT keeps the option open.

No code behavior changes — pure documentation.

Test plan

  • cargo doc -p nexum-runtime --no-deps --locked — clean
  • cargo clippy -p nexum-runtime --all-targets --all-features --locked -- -D warnings — clean
  • cargo fmt -p nexum-runtime -- --check — clean

…rror

request_batch's outer ChainError never returns Err on the reference
host - every failure surfaces per-entry as rpc-result::err, folding
the batch independently - so the escape hatch is structurally dead
here. The reasoning for keeping it in the WIT contract (a different
host could genuinely fail the whole batch atomically before
dispatching any entry) already lived in a doc comment; recorded it in
ADR-0011 too, per the issue's suggested fallback to flattening the
WIT, and cross-linked the two.

Fixes nullislabs#288.
@lgahdl
lgahdl requested a review from mfw78 as a code owner July 16, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chain: flatten request-batch's dead outer chain-error or record the escape hatch

1 participant