Skip to content

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

Merged
matthewwalsh0 merged 5 commits into
mainfrom
feat/validation-enabled-per-tx-type
Aug 20, 2026
Merged

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

Conversation

@matthewwalsh0

@matthewwalsh0matthewwalsh0 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

Medium Risk
Breaking remote flag shape requires LaunchDarkly/client updates; behavior only affects whether Relay quotes are simulated, but misconfiguration could disable validation broadly or for specific types.

Overview
Breaking change:confirmations_pay_extended.payStrategies.relay.validationEnabled is no longer a boolean. It must be { default?: boolean; transactionTypes?: Partial<Record<TransactionType, boolean>> } (e.g. { default: true } instead of true).

isRelayValidationEnabled now takes an optional TransactionMeta and resolves the toggle from default, with per-TransactionType entries in transactionTypes overriding when the top-level or nested transaction type matches (hasTransactionType). validateRelayQuotes passes request.transaction into that check so simulation can be turned on or off per flow without a global flag flip.

Tests and the changelog document the new shape and override behavior.

Reviewed by Cursor Bugbot for commit 9082f35. Bugbot is set up for automated code reviews on this repo. Configure here.

@matthewwalsh0matthewwalsh0 changed the title feat(transaction-pay-controller): support per-TransactionType validationEnabled flagfeat!(transaction-pay-controller): per-TransactionType validationEnabled flagAug 15, 2026
@matthewwalsh0matthewwalsh0 changed the title feat!(transaction-pay-controller): per-TransactionType validationEnabled flagfeat!(transaction-pay-controller): enable validation per transaction typeAug 15, 2026
@matthewwalsh0matthewwalsh0 changed the title feat!(transaction-pay-controller): enable validation per transaction typefeat!(transaction-pay-controller): enable relay validation per transaction typeAug 15, 2026
@matthewwalsh0matthewwalsh0 changed the title feat!(transaction-pay-controller): enable relay validation per transaction typefeat(transaction-pay-controller): enable relay validation per transaction typeAug 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 ownersAugust 15, 2026 07:04
jpuri
jpuri previously approved these changes Aug 17, 2026
@matthewwalsh0
matthewwalsh0 added this pull request to the merge queueAug 19, 2026
@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to failed status checks Aug 19, 2026
… 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.
…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 added this pull request to the merge queueAug 20, 2026
Merged via the queue into main with commit 3498dbdAug 20, 2026
46 checks passed
@matthewwalsh0
matthewwalsh0 deleted the feat/validation-enabled-per-tx-type branch August 20, 2026 08:22
Sign up for freeto 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.

2 participants

@matthewwalsh0@jpuri