UX: Solana withdraw_execute should show minimum amount and block if below threshold #108
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#108
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?
When a Solana-destination transfer amount is below the configured withdraw rate limit minimum, the frontend lets the user click Execute Withdrawal and shows a raw simulation error (RateLimitBelowMin 6034). Instead, the frontend should:
Affects all inbound Solana paths (BSC, opBNB, Terra).
Replaces #105 (closed as expected behavior).
@PlasticDigits Checked on-chain -- the WithdrawRateLimit PDA for testa (2nZwMj7W9LkQb2erRcndbE7VtXzPCds6VVv9R9PAoWAL) does not exist on mainnet. The set-mainnet-withdraw-rate-limits script needs to be run before any Solana execute can work. Currently falling back to implicit cap (supply / 10000) which blocks all test amounts.
mentioned in commit
0a78fe7035Ran
set-mainnet-withdraw-rate-limits.tson mainnet-beta as bridge admin; explicitWithdrawRateLimitPDAs should now be set for testa / testb / tdec.Mainnet tx signatures
6XjWBbRJW5uhd8csCiDivXGPF42yYoyDARtxEtX3oP7E:3asxWyEB1A73Zcre4tn1pAfQS661dxxLupqspJM9YB2PkFx99fptcJZjXcKnK4chJmheUxpJmvtrzF51cpGsiLrLEvAWhkKQzX8om5VDWjg8oEvCw9jhGGKsn3rdrNXmQScX:2AMtvi3vet8oo7Uqib9tDzVdjtmefbZQitqCL8mCGLhxT3uBEmUUzmYsc8NYoqiGwvYeVcVAySi5Jcb3MLTC2ojp765GMcrKxfevfBhnJmZDhdyHDon2nTwGemcgqJApNBR:nAsvJoaWXTpm4XZ1tF9fRcRYQyvU8h2PW5rhBjp69BkfytV6rkV6RfCerdXhV69pGnNj1i8M6t8zTx9zUx7YSjj@Brouie can you verify on-chain (PDAs + a small Solana withdraw execute path) and confirm #108 from your side?
@PlasticDigits Partial verification on build v0.1.82 -
f227b6f(frontend bundle main-CvcBOh67), 4/20 mainnet.On-chain PASS
All 3 WithdrawRateLimit PDAs confirmed on mainnet-beta:
All owned by bridge program 4XX8ndYXupw4Sb4SsRgAPTmBJJjfZbg8rWjj87iKEhVt, 82 bytes each. Decoded testa limits match the set script: min 1.0, max/tx 1000, max/period 5000.
Live Solana inbound E2E transfers today (BSC->Solana n47, opBNB->Solana n26, Terra->Solana n59) all executed successfully at 1.99 testa above the 1.0 min.
UX FAIL
Tested BSC->Solana with 1.0 testa gross (net 0.995 after 0.5% fee, below the 1.0 Solana withdraw min):
b9c6d54)The #100 post-fee validation fix applies to EVM destinations only. Solana-destination routes still lack the minimum display and below-min block described in this issue's acceptance criteria. User can still deposit an amount that will fail at Solana withdraw_execute with RateLimitBelowMin 6034.
Leaving open. Onchain side done, frontend needs the same MIN label + button block logic extended to Solana destinations.
mentioned in issue #111
Frontend fix (Solana destination MIN + below-min block)
Root cause:
useTokenDetailswas never called for Solana as destination becausedestTokenIdForDetailsrelied ondestTokenAddr, which is only set for EVM destinations—so BSC→Solana / Terra→Solana never loaded withdraw min / rate limit data.Change: Derive the Solana TokenMapping PDA (
findTokenMappingPda+resolveWithdrawSrcTokenBytesForSolanafor evm-to-solana and terra-to-solana) and pass it touseTokenDetails. Set destDecimals for Solana destinations using mapping/registry decimals and destTokenDecimals from the parsed TokenMapping so post-fee min math uses SPL decimals.This enables the same MIN label, below-min block, and primary CTA disable behavior as other destination flows.
Verify: BSC→Solana with 1.0 testa gross (~0.995 net after fee): MIN should show and the bridge action should stay disabled until net meets the Solana withdraw minimum.
@Brouie please verify on a build with this fix when you can.
@PlasticDigits Fix verified on v0.1.82 -
2a127e6(mainnet).Route: BSC -> Solana, token testa
Behavior confirmed:
The TokenMapping PDA derivation via findTokenMappingPda + resolveWithdrawSrcTokenBytesForSolana now loads destTokenDecimals for Solana destinations, which surfaces the withdraw min + SPL decimals correctly.
Will validate the below-min block behavior more rigorously on the next session when I can test at an actual below-min amount against live PDA limits -- testa's existing 1.0 min makes this edge case hard to trigger without sub-1 testa transfers. Current evidence confirms the primary fix (MIN label + destDecimals loading) is working.
Closing.
Opened issue #112 for this task @brouie