bug: hash submission fails with 'key not found' when dest Terra wallet has no LUNC #54

Closed
opened 2026-03-11 05:18:45 +00:00 by PlasticDigits · 7 comments
PlasticDigits commented 2026-03-11 05:18:45 +00:00 (Migrated from gitlab.com)

Frontend Bug Report

Issue Title

  • bug: hash submission fails with 'key not found' when dest Terra wallet has no LUNC

Environment

  • Device Type: Desktop
  • Device Model: N/A
  • OS Version: Linux
  • Browser Version: N/A (reported via production use)
  • Wallet Used: Station (Terra) + MetaMask (EVM) — exact versions unknown
  • Network / Chain: BSC Mainnet → Terra Classic Mainnet
  • Page: Transfer Status (/transfer/:xchainHashId)

Steps to Reproduce

  1. Connect an EVM wallet (MetaMask) on BSC and a new Terra Classic wallet that has zero LUNC balance (account never funded)
  2. Initiate a bridge transfer of TestA token from BSC to Terra Classic
  3. Deposit completes on BSC; navigate to the Transfer Status page
  4. Wait for or click "RETRY SUBMIT" to submit the withdrawal hash on Terra Classic

Expected Behavior

  • The withdrawal submission should either succeed or display a clear, actionable error message explaining that the destination Terra wallet needs LUNC for gas fees

Actual Behavior

  • Hash submission fails with the error:
    Transaction failed: rpc error: code = NotFound desc = account terra1leq08z2calpup577jpmxq82yvr8hx924qe7ee5 not found: key not found
    
  • The UI shows a generic explanation: "This usually means the XChain Hash ID is invalid or was computed with incorrect parameters. The hash may need to be recomputed from the original deposit receipt."
  • This message is misleading — the actual cause appears to be that the Terra Classic account does not exist on-chain because it has never received any LUNC. Terra Classic requires an account to have funds before it can sign transactions.
  • Disconnecting and reconnecting both wallets does not resolve the issue.

Resolved Submit Params (from error panel)

  • destChain: Terra Classic (0x00000001)
  • bridge: terra18m02l2f43c2dagqnz3kfccpgz9pzzz5hk915mh5wvr6dcvv47zfqdfs7la
  • nonce: 13
  • amount: 995000000000000000000
  • token(address): 0x24c79c6a00cdedddb81377b0b98dbb0fdf917fce
  • destAccount(address): 0xfe40f38958efc3c0d3de9076601d4460cf731555

Severity

  • Medium — Transfer is stuck and the error message does not guide the user toward resolution. Funds are not at risk (deposit exists, hash can be resubmitted once the wallet is funded), but the UX is confusing. The Faucet page already shows "No LUNC for gas" for zero-balance Terra wallets (#21), so a similar pre-check or clearer error message could be applied to the submit flow.

Evidence (screenshots / recordings)

  • hash-submission-failed

Console Errors (if available)

# Not captured — reproduced from production

Transaction Hash (if applicable)

  • Not provided (nonce 13 on the bridge contract)

Source

  • Reported by a user

Suggested Improvements

  1. Before attempting hash submission on Terra Classic, check if the connected wallet account exists on-chain (has LUNC balance). If not, show a clear message like: "Your Terra Classic wallet has no LUNC. You need LUNC to pay gas fees for the withdrawal transaction. Fund your wallet and try again."
  2. When the RPC returns code = NotFound with key not found, catch this specific error and display a user-friendly message instead of the generic hash-recomputation suggestion.
  3. Consider linking to the Faucet page or providing instructions for obtaining LUNC for gas.
## Frontend Bug Report ### Issue Title - bug: hash submission fails with 'key not found' when dest Terra wallet has no LUNC ### Environment - Device Type: Desktop - Device Model: N/A - OS Version: Linux - Browser Version: N/A (reported via production use) - Wallet Used: Station (Terra) + MetaMask (EVM) — exact versions unknown - Network / Chain: BSC Mainnet → Terra Classic Mainnet - Page: Transfer Status (`/transfer/:xchainHashId`) ### Steps to Reproduce 1. Connect an EVM wallet (MetaMask) on BSC and a **new** Terra Classic wallet that has **zero LUNC balance** (account never funded) 2. Initiate a bridge transfer of TestA token from BSC to Terra Classic 3. Deposit completes on BSC; navigate to the Transfer Status page 4. Wait for or click "RETRY SUBMIT" to submit the withdrawal hash on Terra Classic ### Expected Behavior - The withdrawal submission should either succeed or display a clear, actionable error message explaining that the destination Terra wallet needs LUNC for gas fees ### Actual Behavior - Hash submission fails with the error: ``` Transaction failed: rpc error: code = NotFound desc = account terra1leq08z2calpup577jpmxq82yvr8hx924qe7ee5 not found: key not found ``` - The UI shows a generic explanation: _"This usually means the XChain Hash ID is invalid or was computed with incorrect parameters. The hash may need to be recomputed from the original deposit receipt."_ - This message is misleading — the actual cause appears to be that the Terra Classic account does not exist on-chain because it has never received any LUNC. Terra Classic requires an account to have funds before it can sign transactions. - Disconnecting and reconnecting both wallets does not resolve the issue. ### Resolved Submit Params (from error panel) - destChain: Terra Classic (0x00000001) - bridge: `terra18m02l2f43c2dagqnz3kfccpgz9pzzz5hk915mh5wvr6dcvv47zfqdfs7la` - nonce: 13 - amount: 995000000000000000000 - token(address): `0x24c79c6a00cdedddb81377b0b98dbb0fdf917fce` - destAccount(address): `0xfe40f38958efc3c0d3de9076601d4460cf731555` ### Severity - Medium — Transfer is stuck and the error message does not guide the user toward resolution. Funds are not at risk (deposit exists, hash can be resubmitted once the wallet is funded), but the UX is confusing. The Faucet page already shows "No LUNC for gas" for zero-balance Terra wallets (#21), so a similar pre-check or clearer error message could be applied to the submit flow. ### Evidence (screenshots / recordings) - ![hash-submission-failed](https://raw.githubusercontent.com/PlasticDigits/cl8y-qa-evidence/main/2026-03-11/1773206293-image-fd1888d5-ea6a-43b6-ac4a-9cd026815a05.png) ### Console Errors (if available) ```shell # Not captured — reproduced from production ``` ### Transaction Hash (if applicable) - Not provided (nonce 13 on the bridge contract) ### Source - [x] Reported by a user ### Suggested Improvements 1. Before attempting hash submission on Terra Classic, check if the connected wallet account exists on-chain (has LUNC balance). If not, show a clear message like: _"Your Terra Classic wallet has no LUNC. You need LUNC to pay gas fees for the withdrawal transaction. Fund your wallet and try again."_ 2. When the RPC returns `code = NotFound` with `key not found`, catch this specific error and display a user-friendly message instead of the generic hash-recomputation suggestion. 3. Consider linking to the Faucet page or providing instructions for obtaining LUNC for gas.
PlasticDigits commented 2026-03-11 06:11:17 +00:00 (Migrated from gitlab.com)

assigned to @Brouie

assigned to @Brouie
Brouie commented 2026-03-11 06:12:07 +00:00 (Migrated from gitlab.com)

Similar pattern to the zero-balance faucet fix in PR #34. The fix would be checking luncBalance from the wallet store before attempting hash submission on Terra. If zero, show a clear message like 'Your Terra wallet has no LUNC for gas — fund your wallet and retry' instead of the generic hash recomputation error. Can take this one.

Similar pattern to the zero-balance faucet fix in PR #34. The fix would be checking luncBalance from the wallet store before attempting hash submission on Terra. If zero, show a clear message like 'Your Terra wallet has no LUNC for gas — fund your wallet and retry' instead of the generic hash recomputation error. Can take this one.
Brouie commented 2026-03-11 06:31:20 +00:00 (Migrated from gitlab.com)

mentioned in merge request !141

mentioned in merge request !141
Brouie commented 2026-03-11 06:32:34 +00:00 (Migrated from gitlab.com)

mentioned in commit 89a066f720

mentioned in commit 89a066f720d9c81e407c457dab5794c934ccf6f0
PlasticDigits commented 2026-03-11 06:43:37 +00:00 (Migrated from gitlab.com)

mentioned in commit 4d9488425a

mentioned in commit 4d9488425ab9f868953f79803921e6b84b225406
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-03-11 06:43:38 +00:00
Brouie commented 2026-03-13 04:17:47 +00:00 (Migrated from gitlab.com)

mentioned in issue #55

mentioned in issue #55
Brouie commented 2026-03-18 02:42:48 +00:00 (Migrated from gitlab.com)

Verified fixed — MR !141 added LUNC balance check before hash submission on Terra. If wallet has no LUNC, shows clear error message instead of generic hash recomputation error.

Verified fixed — MR !141 added LUNC balance check before hash submission on Terra. If wallet has no LUNC, shows clear error message instead of generic hash recomputation error.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-bridge-monorepo#54
No description provided.