XLabs / portal-bridge-ui

Portal Bridge UI
https://www.portalbridge.com/
25 stars 38 forks source link

[bug] Balance for KLAY on Kaia is loading only after asset is selected, balances for other assets are not loading #1119

Closed tsadovska closed 1 month ago

tsadovska commented 1 month ago

Is there an existing issue for this?

Current Behavior

Balance for KLAY is displayed.

https://github.com/user-attachments/assets/9ceb6e6d-ecdf-404f-b0d9-1d2cd4bdcdfd

Expected Behavior

Balance for KLAY is displayed when user selects Kaia network for the first time.

Steps To Reproduce

  1. Open https://portalbridge.com/
  2. Select Kaia network in "From" section (MetaMask wallet was auto-connected)
  3. Check that balance for KLAY is not loaded
  4. Select KLAY token
  5. Open "From" section again

Environment

- OS: macOS Sonoma 14.5
- Wallet: MetaMask 
- Browser: Google Chrome Version 129.0.6668.71 (Official Build) (arm64)

Anything else?

Issue is also reproducible on https://wormhole-connect-mainnet.netlify.app/.

tsadovska commented 1 month ago

Please see Emre's comment: https://github.com/wormhole-foundation/wormhole-connect/issues/2724#issuecomment-2385376525

The problem is the error from RPC about the batch size when requesting token balances:

Error: could not coalesce error (
  error={ "code": -32062, "message": "Batch size too large" },
  payload={
    "id": 2,
    "jsonrpc": "2.0",
    "method": "eth_getBalance",
    "params": [ "0x49887a216375fded17dc1aaad4920c3777265614", "latest" ]
  },
  code=UNKNOWN_ERROR,
  version=6.13.2
)

The default Kaia RPC in Connect and (if any) the override in Portal Bridge is not accepting larger RPC payloads to get the token balances. When I replaced it with our paid RPC in 1Password, it started working.

I think Portal Bridge needs to use another RPC for klaytn. I see that it's using the free one: https://rpc.ankr.com/klaytn

tsadovska commented 1 month ago

Issue is no longer reproducible on https://portalbridge.com/, but is still reproducible on https://wormhole-connect-mainnet.netlify.app/ (ticket https://github.com/wormhole-foundation/wormhole-connect/issues/2834).

https://github.com/user-attachments/assets/6effb7f9-4a20-4b05-968a-6a16f663c05b

Ticket is closed.