docs(adr-0011): record why request-batch keeps its dead outer chain-error#427
Open
lgahdl wants to merge 1 commit into
Open
docs(adr-0011): record why request-batch keeps its dead outer chain-error#427lgahdl wants to merge 1 commit into
lgahdl wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #288.
request_batch's outerchain-error(result<list<rpc-result>, chain-error>) never returnsErron the reference host — every failure (denied method, node revert, transport fault) surfaces per-entry asrpc-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 onchain::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— cleancargo clippy -p nexum-runtime --all-targets --all-features --locked -- -D warnings— cleancargo fmt -p nexum-runtime -- --check— clean