Loading
Fix EVM receipt skipping for failed outbounds and direct token deposits
🔎 Visual review of04f10162: explainer, review flags and prompts to ask an AI about the change
Why this is needed
- Follow-up to !5330 (merged) and !5331 (merged).
- Skipping receipts can leave a failed outbound stuck in the signer cache and block its retry.
- The receipt filter and the direct ERC20 parser need to agree on which transfers can count as deposits.
Changes
Keep failed outbounds retryable
- Before BSC, BASE or Ethereum skips receipts, check whether the local signer cache contains a transaction from the block.
- If a transaction is cached, or the cache cannot be read, fetch the receipts.
- A failed transaction clears its cache entry so the payment can be retried. A successful transaction stays protected against duplicate signing.
- This also works when the scanner catches up after the signing vault has left the node's vault list.
Only credit direct token transfers addressed to a vault
- The token transfer call must name an active vault as its recipient.
- The token's matching
Transferevent must confirm that same recipient. - Credit the amount reported by that event, rather than the amount requested in the call.
- Ignore side payments to a vault when the call names someone else.
- Support address encoding used by older tokens when a successful receipt confirms the decoded vault address.
- Apply this rule everywhere the shared direct-transfer parser is used.
Verification
- All four affected packages pass in default, mocknet and mainnet builds.
- Targeted scanner tests pass with the race detector.
- Formatting, scoped Trunk checks and the configured Go linter pass.
- Regression tests cover:
- Failed and successful outbounds after vault removal.
- Direct deposits where the event reports less than the requested amount.
- Side payments, non-vault recipients and incomplete call data.
- Address encoding used by older tokens.
- Signer-cache read errors.
Token limitation
- Direct deposits rely on the token's
Transferevent reporting the amount actually received by the vault. - A token that reports the full amount and later deducts a fee from the vault can cause an over-credit.
- Token eligibility and the per-chain direct-inbound Mimir control rollout.
Edited by Huginn Ai