Skip to content

feat(transaction-pay-controller): enable relay validation per transaction type - #9888

Open
matthewwalsh0 wants to merge 5 commits into
mainfrom
feat/validation-enabled-per-tx-type
Open

feat(transaction-pay-controller): enable relay validation per transaction type#9888
matthewwalsh0 wants to merge 5 commits into
mainfrom
feat/validation-enabled-per-tx-type

Conversation

@matthewwalsh0

@matthewwalsh0 matthewwalsh0 commented Aug 15, 2026

Copy link
Copy Markdown
Member

Explanation

The payStrategies.relay.validationEnabled flag (in the confirmations_pay_extended remote feature flag) was a plain boolean, so Relay quote validation could only be toggled globally — there was no way to enable or disable it per transaction type.

This PR replaces the boolean with an object-only schema:

validationEnabled: {
  default?: boolean;                                             // base toggle for all types (omitted = false)
  transactionTypes?: Partial<Record<TransactionType, boolean>>;  // per-type overrides
}
  • default is the base toggle applied to every transaction type. When omitted, validation is off.
  • A matching transactionTypes[txType] entry overrides default for that specific type (using ??, so an explicit false override correctly beats a true default).

Because the confirmations_pay_extended flag is versioned, the boolean form is dropped rather than kept for backwards compatibility — this is a breaking change to the flag shape (true is now expressed as { default: true }).

The resolver isRelayValidationEnabled gains an optional transactionType parameter, and the single call site in relay-validation.ts passes request.transaction.type. A new RelayValidationEnabledConfig type describes the flag shape.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Cursor Bugbot is generating a summary for commit c87b3be. Configure here.

… default field

Drop boolean support for the payStrategies.relay.validationEnabled flag;
it is now object-only with an optional `default` toggle (omitted = false)
plus per-TransactionType overrides.

BREAKING CHANGE: validationEnabled is no longer a boolean.
@matthewwalsh0 matthewwalsh0 changed the title feat(transaction-pay-controller): support per-TransactionType validationEnabled flag feat!(transaction-pay-controller): per-TransactionType validationEnabled flag Aug 15, 2026
…es via hasTransactionType

Pass the full transaction to isRelayValidationEnabled and iterate over each
transactionTypes entry, using hasTransactionType so a per-type override
matches the top-level or any nested transaction type.
@matthewwalsh0 matthewwalsh0 changed the title feat!(transaction-pay-controller): per-TransactionType validationEnabled flag feat!(transaction-pay-controller): enable validation per transaction type Aug 15, 2026
@matthewwalsh0 matthewwalsh0 changed the title feat!(transaction-pay-controller): enable validation per transaction type feat!(transaction-pay-controller): enable relay validation per transaction type Aug 15, 2026
@matthewwalsh0 matthewwalsh0 changed the title feat!(transaction-pay-controller): enable relay validation per transaction type feat(transaction-pay-controller): enable relay validation per transaction type Aug 15, 2026
@matthewwalsh0
matthewwalsh0 marked this pull request as ready for review August 15, 2026 07:04
@matthewwalsh0
matthewwalsh0 requested review from a team as code owners August 15, 2026 07:04
@matthewwalsh0
matthewwalsh0 deployed to default-branch August 15, 2026 07:04 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant