Skip to content

feat(vault): adds atomic swap feature flag#1251

Open
jonybur wants to merge 1 commit intomainfrom
jb-add-atomic-swap-ff
Open

feat(vault): adds atomic swap feature flag#1251
jonybur wants to merge 1 commit intomainfrom
jb-add-atomic-swap-ff

Conversation

@jonybur
Copy link
Contributor

@jonybur jonybur commented Mar 16, 2026

#1240

Greptile Summary

This PR adds a new opt-in feature flag isAtomicSwapPeginEnabled to the vault's feature flag registry, gating the atomic swap pegin deposit flow behind NEXT_PUBLIC_FF_ATOMIC_SWAP_PEGIN=true. The change is minimal, well-documented inline, and consistent with the existing opt-in flag pattern established by isSimplifiedTermsEnabled.

Key observations:

  • The implementation is correct — the flag safely defaults to false, so the existing deposit flow is unaffected until the env var is explicitly enabled.
  • README.md is not updated: all other feature flags are documented in the ### Feature Flags section of services/vault/README.md, but NEXT_PUBLIC_FF_ATOMIC_SWAP_PEGIN is missing from it. Consider adding an entry describing its purpose and how to enable it.
  • The module-level comment ("Default value for all feature flags is true") is outdated — both this flag and isSimplifiedTermsEnabled are opt-in (default false). Updating the comment to reflect both patterns would improve maintainability.

Confidence Score: 5/5

  • This PR is safe to merge — the change is isolated to a single getter that defaults to false, so no existing functionality is affected.
  • The change is a one-line getter addition following a well-established pattern in the codebase, with no side-effects and a safe default value. The only gaps are a missing README entry and a stale module comment, neither of which are blocking.
  • No files require special attention beyond the minor documentation gaps noted above.

Important Files Changed

Filename Overview
services/vault/src/config/featureFlags.ts Adds a new opt-in feature flag isAtomicSwapPeginEnabled (env var NEXT_PUBLIC_FF_ATOMIC_SWAP_PEGIN) defaulting to false; follows the same pattern as isSimplifiedTermsEnabled. Minor inconsistency with the module-level comment claiming all flags default to true.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Page renders deposit flow] --> B{isAtomicSwapPeginEnabled?}
    B -->|NEXT_PUBLIC_FF_ATOMIC_SWAP_PEGIN === 'true'| C[Render Atomic Swap Pegin deposit flow]
    B -->|env var unset or !== 'true'| D[Render existing deposit flow]
Loading

Last reviewed commit: 05dcf2d

Greptile also left 1 inline comment on this PR.

@github-actions
Copy link

🔐 Commit Signature Verification

All 1 commit(s) passed verification

Commit Author Signature Key Type Key Check
05dcf2dfc16e Jonathan Bursztyn sk-ssh-ed25519

Summary

  • Commits verified: 1
  • Signature check: ✅ All passed
  • Key type enforcement: ✅ All sk-ssh-ed25519

Required key type: sk-ssh-ed25519 (FIDO2 hardware key)

Last verified: 2026-03-16 17:10 UTC

Comment on lines +56 to +58
get isAtomicSwapPeginEnabled() {
return process.env.NEXT_PUBLIC_FF_ATOMIC_SWAP_PEGIN === "true";
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module-level documentation inconsistency

The file header comment on line 11 states: "Default value for all feature flags is true (feature is enabled)", but this flag (like isSimplifiedTermsEnabled before it) defaults to false. The module-level comment is no longer accurate for opt-in flags. Consider updating the header to reflect that there are two patterns — opt-out flags (default true, disable by setting to "false") and opt-in flags (default false, enable by setting to "true").

Copy link
Collaborator

@jrwbabylonlab jrwbabylonlab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonybur u need to put this flag in the right place as part of this PR tho.

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.

3 participants