Skip to content

Fix: cross-contract call swallows the inner error - #1679

Merged
Baskarayelu merged 1 commit into
Remitwise-Org:mainfrom
greatest0fallt1me:fix/1627-cross-contract-swallowed-error
Jul 30, 2026
Merged

Fix: cross-contract call swallows the inner error#1679
Baskarayelu merged 1 commit into
Remitwise-Org:mainfrom
greatest0fallt1me:fix/1627-cross-contract-swallowed-error

Conversation

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Summary

run_remittance_fan_out collapsed every downstream cross-contract failure (savings, bills, insurance) into the same generic OrchestratorError::CrossContractCallFailed, discarding whether the callee itself rejected the call (Ok(Err(_))) or the invocation could not be made at all (Err(_), e.g. bad address/interface mismatch). Callers and off-chain indexers had no way to tell which step failed or why.

Change

  • Match on the full nested try_* result instead of collapsing it with .is_err().
  • Emit a (cctx_err, <step>) event carrying a bool (rejected_by_contract) before returning the existing error, for each of the three downstream calls (savings, bills, insurance). Existing return values/error variants are unchanged, so this is additive.

Tests

  • Added test_cross_contract_failure_emits_step_and_cause, which reproduces the swallow (a failing mock previously produced identical, undifferentiated errors) and asserts the new event carries the failing step and cause.
  • cargo test -p orchestrator --lib: 95 passed (1 pre-existing, unrelated failure that requires wasm artifacts to be pre-built).

Closes #1627

…ilure

run_remittance_fan_out collapsed every downstream failure (savings, bills,
insurance) into the same generic CrossContractCallFailed, discarding
whether the callee itself rejected the call or the invocation could not
be made at all. Emit a cctx_err event identifying the failing step and
that distinction before returning.
@Baskarayelu
Baskarayelu merged commit 6aba4a4 into Remitwise-Org:main Jul 30, 2026
6 of 7 checks passed
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.

Fix: cross-contract call swallows the inner error

2 participants