feat(deposit-address): env-gated per-lane bridgeOverride on v3 executes - #3635
Closed
ashwinrava wants to merge 1 commit into
Closed
feat(deposit-address): env-gated per-lane bridgeOverride on v3 executes#3635ashwinrava wants to merge 1 commit into
ashwinrava wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The quote-api's
POST /deposit-addresses/executeaccepts an ops escape hatch,bridgeOverride: "cctp" | "spokepool" | "oft", but the sweeper never sends it — lane selection is always the API's amount-aware router. That leaves no operational lever to (a) force a healthy rail during a lane incident (e.g. an Iris outage failing CCTP quotes) or (b) exercise lanes the router never picks (the dedup rule prefers spokepool over oft for the same input, so OFT sweeps can only be tested by hand-broadcasting).Change
Per-lane forced bridge on v3 executes, dark by default and double-gated (the
ENABLE_*pattern used byENABLE_EXECUTE_INPUT_TOKEN/ENABLE_EXECUTE_ERC20_TRANSFER_METADATA):ENABLE_EXECUTE_BRIDGE_OVERRIDE=true— master gate; off ⇒ requests are byte-identical to today.EXECUTE_BRIDGE_OVERRIDES— JSON map"originChainId:inputToken:destinationChainId" → "cctp" | "spokepool" | "oft"(input token lowercased, origin-chain-native encoding). Config parsing fails fast on malformed JSON, malformed lane keys, or unknown bridge values._getExecuteTxlooks up the funded lane and, on a hit, includesbridgeOverridein the execute request (debug-logged). No entry ⇒ field omitted ⇒ the API's router decides, exactly as today.Safe by construction: the API clamps
bridgeOverrideto the committed executable lane set for(origin, inputToken, destination)— a stale or wrong entry produces a typed 400, never a mis-signed or wrong-lane sweep. The bot adds no routing logic of its own.Tests
Three new cases in
test/DepositAddressHandler.ts: override applied on a lane match, omitted on a miss, omitted when the gate is off despite a match. 51 passing locally; the 3 pre-existingexecutionFeeRecipientchecksum-casing failures reproduce identically on clean master and are untouched.Rollout
Intended for the test bot first (flag on + a single OFT lane entry to validate the Arbitrum USDT → HyperEVM lane through the production path), default-off everywhere else. Requires no API change — the endpoint already accepts the field.
🤖 Generated with Claude Code