Investigate: queue bridge txs when amount exceeds withdraw rate limits (per-tx and daily window) #132
Labels
No labels
agent:implement
agent:ready
backend
bug
cannot-reproduce
confirmed
desktop
docs
documentation
duplicate
enhancement
feature
frontend
good first issue
help wanted
high-risk
in-review
invalid
mobile
needs-triage
P0-critical
P1-high
P2-medium
P3-low
qa
QA
question
ready
report
responsive
security
security-escalate
smart-contract
solana
tablet
test-pass
ux
wallet-issue
wallet:keplr
wallet:metamask
wallet:station
wallet:walletconnect
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-bridge-monorepo#132
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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
Investigate user-initiated queuing when a bridge transfer (deposit and/or destination withdraw execute) would exceed destination withdraw rate limits:
maxPerTransaction/max_per_tx) — payout larger than a single allowed transfer.maxPerPeriod/max_per_period, 24h rolling window) — payout fits per-tx but remaining window headroom is insufficient, or cumulative usage would exceed the daily cap.Today the UI blocks or warns rather than offering a queue: users must wait for the window to reset, split into smaller transfers manually, or abandon the transfer.
Current behavior (reference)
withdrawRateLimit.remainingAmount,minPerTransaction, bridge caps (TransferForm.tsx, INV-UX1 GL-119).temporarily-blockedshows amber countdown;permanently-blockedwhen normalized payout >maxPerPeriod(EVM:computeEvmExecutionRateLimitStatus; Terra:queryTerraRateLimitStatus, INV-UX2-TERRA1 GL-130).TokenRateLimit, TerraRATE_LIMITS+period_usage, SolanaWithdrawRateLimitPDA enforce at withdraw execute (not at deposit). Seedocs/security-model.md,docs/FRONTEND_BRIDGE_INVARIANTS.md.Related issues: #127 (rate-limit UX visibility), #130 (Terra decimal parity for permanent block classification).
Investigation goals
Product / UX
periodEndsAt/ headroom available — show position, ETA, cancel?Technical options (non-exhaustive)
queuesmetrics inpackages/operator) to retrywithdraw_approve/ execute when limits allow — user still signs deposit once.Edge cases
maxPerPeriodandmaxPerTransaction(currently permanently-blocked in UI) — can any queue help, or only split/sub-cap transfers?normalizeBridgeAmountToDestDecimals) must match execute-time checks on all chains.Acceptance criteria (investigation phase)
Code pointers
packages/frontend/src/services/evmExecutionRateLimit.tspackages/frontend/src/services/terraBridgeQueries.ts(queryTerraRateLimitStatus)packages/frontend/src/components/transfer/TransferForm.tsxpackages/frontend/src/pages/TransferStatusPage.tsxdocs/FRONTEND_BRIDGE_INVARIANTS.md(INV-UX2)packages/contracts-solana/programs/cl8y-bridge/src/rate_limit.rs