Skip to content

fix: stop swallowing facilitator verification errors#18

Open
namedfarouk wants to merge 1 commit intoOpenGradient:mainfrom
namedfarouk:codex/fix-13-silent-catch-verification-errors
Open

fix: stop swallowing facilitator verification errors#18
namedfarouk wants to merge 1 commit intoOpenGradient:mainfrom
namedfarouk:codex/fix-13-silent-catch-verification-errors

Conversation

@namedfarouk
Copy link
Copy Markdown

Summary

This PR fixes silent catch behavior in facilitator verification flows so we no longer continue with ambiguous state when core checks fail.

What changed

  • EVM exact verifyEIP3009:
    • log signature verification exceptions with context
    • return explicit invalid_exact_evm_payload_signature_verification_error when smart-wallet bytecode lookup fails
    • return explicit invalid_exact_evm_payload_balance_check_failed when balance reads fail
    • keep fallback logic for undeployed smart wallets but avoid silent parse failures
  • EVM exact verifyPermit2:
    • log signature verification exceptions and return invalid_permit2_signature_verification_error
    • return explicit permit2_allowance_check_failed on allowance read errors
    • return explicit permit2_balance_check_failed on balance read errors
  • SVM exact facilitator verify flow:
    • log transaction decode and transfer parse failures with context
    • return explicit invalid_exact_svm_payload_recipient_ata_lookup_failed (with message) when ATA derivation fails instead of generic recipient mismatch

Tests

Added targeted regression coverage in:

  • typescript/packages/mechanisms/evm/test/unit/exact/facilitator.test.ts

Validated with:

  • pnpm --filter @x402/evm test -- test/unit/exact/facilitator.test.ts
  • pnpm --filter @x402/svm test -- test/unit/facilitator.test.ts

Fixes #13

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.

Silent catch blocks mask failures in verification flow

1 participant