Skip to content

feat(rust-client): distinct error for submissions with an unknown outcome - #2498

Open
sofiazcoaga wants to merge 3 commits into
nextfrom
feat/indeterminate-submission-error
Open

feat(rust-client): distinct error for submissions with an unknown outcome#2498
sofiazcoaga wants to merge 3 commits into
nextfrom
feat/indeterminate-submission-error

Conversation

@sofiazcoaga

@sofiazcoaga sofiazcoaga commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Problem

A transaction submission can fail without the node saying whether it processed the transaction. Those failures reach the caller as ClientError::RpcError, the same shape as any other network error. The caller cannot tell "the node rejected this" from "this may be in the mempool right now", and has nothing to check with: submit_new_transaction runs execute, prove and submit internally, so the transaction id and the ProvenTransaction are dropped when the submit fails. Re-running the request is not a recovery, it builds a different transaction with different note serial numbers and a different id.

Changese

  • New error ClientError::SubmissionOutcomeUnknown, carrying the ProvenTransaction and the originating RpcError, plus an ErrorHint.
  • Client::submit_proven_transaction returns it when the submission failed without a definite answer. Every other failure keeps arriving as ClientError::RpcError.
  • New predicate RpcError::is_indeterminate_submission decides that. It lists the codes the node issues deliberately and treats everything else as indeterminate, so a code this client does not recognize stays on the "may have landed" side.

Code matching ClientError::RpcError for submission failures still compiles and stops matching these cases. Callers that only propagate or log need no change.

@sofiazcoaga
sofiazcoaga force-pushed the feat/indeterminate-submission-error branch from a70c9b8 to d92e77b Compare September 4, 2026 15:34
@sofiazcoaga
sofiazcoaga marked this pull request as ready for review September 4, 2026 19:44
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.

1 participant