Debounce hybrid book leg for submit snapshot alignment (#360) #866
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic!866
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/360-hybrid-book-submit-snapshot"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Follow-up to #356: hybrid book leg and max makers now participate in the same debounced submit snapshot as pay amount.
bookInputHumanandhybridMaxMakers(350ms) for sim query keys on Swap and Trade marketisSubmitQuoteStale+assertSubmitHybridAlignedfor book leg / max makers stale detection and mutation defensebuildSubmitAlignedSimPayloadintouseSubmitAlignedSimQuote(single snapshot builder)submitDirectHybridfrom debounced inputs instead of livebookInputHumanAcceptance criteria
isSubmitReadyfalse while live book ≠ debounced book (pay stable)useSubmitAlignedSimQuote.test.ts, SwapPage + Trade market component testsmutationFnasserts hybrid alignment before broadcastassertSubmitHybridAlignedin Swap + Trade mutations;quoteDebounce.test.tsSwapPage.tsxsim key +submitDirectHybridbuildSubmitAlignedSimPayloadused by hook (not orphaned)rg buildSubmitAlignedSimPayload frontend-dapp/srcdocs/frontend.md,skills/AGENTS_FRONTEND_SWAP_ROUTE_DISPLAY.mdTest plan
All commands: PASS
Manual (LocalTerra +
make dev) — SKIP on agent VM10, book2→ change book to5→ submit disabled until refreshVerification checklist (third parties)
make test-frontendgreen on MR pipelinebook_inputmatches displayed hybrid splitrg buildSubmitAlignedSimPayload frontend-dapp/srcshows hook + tests only (plus definition)Closes #360
changed the description
changed the description
Security review
Commit reviewed:
c1bea72d0ca073739a682effb7aa8fbe92122781Scope: MR !866 — debounced hybrid book leg / max-makers submit snapshot alignment (
quoteDebounce.ts,useSubmitAlignedSimQuote,SwapPage,TradeMarketOrderPanel, tests, docs). Prior security-review threads: none on this MR.Method: Diff review + trace of attacker-controlled inputs (
bookInputHuman,hybridMaxMakers, pay amount) through sim query keys,isSubmitQuoteStale/isSubmitReadygates, andswapMutationsinks (assertSubmitHybridAligned,submitDirectHybrid,debouncedHybrid).Outcome:
FINDINGS: 0medium+Security review: no medium+ findings on this diff.
This change hardens submit–quote alignment for hybrid swaps: sim keys and on-chain submit now share debounced book/max-makers snapshots, UI blocks stale hybrid input, and
mutationFnre-checks live vs snapshotted hybrid params before broadcast. Reviewed paths include injection/XSS (controlled React inputs +isDecimalAmountDraft), TOCTOU between debounce settle and submit (assertSubmitHybridAlignedat mutation time), and indexer-hybrid precedence (hybridFromSingleHopIndexerOps) — the latter is unchanged trust model from #356, not a new exposure.Inline threads: none (no findings to anchor).
mentioned in commit
16e0656c37mentioned in merge request !868
mentioned in issue #360