perf: stabilize swap quote, Stock cold-start, and execution lifecycle#12513
Closed
zhaono1 wants to merge 29 commits into
Closed
perf: stabilize swap quote, Stock cold-start, and execution lifecycle#12513zhaono1 wants to merge 29 commits into
zhaono1 wants to merge 29 commits into
Conversation
# Conflicts: # packages/kit/src/views/Swap/pages/components/SwapHeaderContainer.tsx
Contributor
Author
|
Closing as superseded by a narrower A+ implementation rebuilt from x. The replacement will focus on Swap/Stock cold-start presentation, one quote lifecycle owner, stable action state, and an immutable Review handoff; build/sign/send, Market, Private Send, and reset/storage hardening are intentionally deferred. The existing branch is retained as a read-only implementation reference. |
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.
Summary
This Draft hardens the Swap V2 quote, Stock cold-start, and execution lifecycle. It prevents stale or cross-owner data from becoming visible or executable, preserves V1 rollback contracts, and keeps display continuity separate from transaction authority.
finallyhandlers from overwriting current stateReview and execution hardening
The commercial review follow-up closes execution-sensitive gaps in the committed V2 path:
bgbetween a multi-tx approval broadcast and the later swap signing; an explicit market close blocks the swap while preserving the already-broadcast approval checkpointxfail-open contract when market-detail transport is unavailable; only an authoritativeisOpen === falseblocks executionStock closed-market and cold-start behavior
--instead of showing a fake skeleton when no quote request is activeRuntime ownership
mainJS owns readiness, semantic intent, visible quote commit, balance ownership, frozen Review state, and the current execution lease.bgJS independently owns EventSource/AbortController resources, per-surface session registries, and the final multi-transaction signing boundary.Verification
origin/x@8913f5a5253c40dd52ae7c07bce92999b1fc809da02659ee259f921125cac4a2fd82f7b91aa2471dx, including BUY/SELL, wrong-owner, ordinary Swap isolation, stale async results, exact TTL boundaries, and real component wiringx-compatible fail-open behavior is removedyarn agent:check --profile commit: PASS for lint, format, agent context, staged lint, and staged TypeScriptgit diff --check: PASSiOS runtime validation
/swap/v1/quote/events,/swap/v1/quote/speed, and/swap/v1/quote-market/speed--without a skeletonReview status and remaining release gates
The implementation has no known P0/P1 review findings and all latest-head checks pass, but the PR remains Draft / Review Required. Remaining commercial release gates:
AssetCatalogSimulatorAgenthandshake failure, while the already-installed simulator runtime was validated successfullyuseSwapBuiltTxowner to reduce maintenance and rollback riskReview score after the final fixes: 8.7/10 for the implementation approach and 8.4/10 for commercial merge readiness.