Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] WalletConnect heavy request fail #1790

Open
Ganbin opened this issue May 25, 2023 · 3 comments
Open

[Bug] WalletConnect heavy request fail #1790

Ganbin opened this issue May 25, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Ganbin
Copy link
Contributor

Ganbin commented May 25, 2023

What happened?

Description

When making a WC request that may return a lot of data, the request get stack somewhere and we never get any result.

How to reproduce

There are 2 ways to reproduce the issue:

  1. We need to have at least 1 NFT that has its data stored on chain. AnnoyNation or SpaceMarmot. Then make a WC chia_getNFTs request with the wallet that contains the NFT. Having a wallet with hundreds of NFTs may also have the same issue if we don't paginate.
  2. We need a DID wallet with a coin that has a long history of parent_coin_info attribute when doing a chia rpc wallet get_wallets '{"include_data": true}' . Mine has more than 200 parent coins. Then do a WC chia_getWallets with include_data": true.

For both cases, I see the confirmation dialog, the issue occurs after accepting the request in the Chia wallet.

Actual result

Nothing happens both on Chia wallet and on the browser. The only error I get is when opening the developer tools on the Chia wallet, I see some ws.ts:94 WebSocket is already in CLOSING or CLOSED state. errors. On the browser, it just wait until a long timeout and throw an empty error. Nothing on the debug.log

Expected result

The data to be sent or an error message.

References

Discussion #14526
chia_getWallets Chia-Network/chia-blockchain#14526 (reply in thread)
chia_getNFTs Chia-Network/chia-blockchain#14526 (reply in thread)

Version

1.8.1

What platform are you using?

macOS

What ui mode are you using?

GUI

Relevant log output

ws.ts:94 WebSocket is already in CLOSING or CLOSED state.
ws.ts:94 WebSocket is already in CLOSING or CLOSED state.
ws.ts:94 WebSocket is already in CLOSING or CLOSED state.
...
@Ganbin Ganbin added the bug Something isn't working label May 25, 2023
@paninaro paninaro transferred this issue from Chia-Network/chia-blockchain May 25, 2023
@Ganbin
Copy link
Contributor Author

Ganbin commented Jun 6, 2023

After activating chia debug I can see that Chia Wallet seems to successfully send the data.
I got this log :

chia-gui:walletConnect result +57ms {status: 'fulfilled', endpointName: 'getWallets', requestId: ...

All the data are there. The object stringify is 107KB.

I didn't make investigations but I suppose the issue is on the webSocket connection when the data exceed a certain amount.

@Ganbin
Copy link
Contributor Author

Ganbin commented Jun 7, 2023

Here is the stack of the origin of the error:
WebbSocket is already in CLOSING or CLOSED state.
(anonymous) @ ws.ts:94
l @ ws.ts:2
(anonymous) @ ws.ts:2
(anonymous) @ ws.ts:2
ye @ ws.ts:2
a @ ws.ts:2
(anonymous) @ ws.ts:2
(anonymous) @ ws.ts:2
(anonymous) @ ws.ts:98
(anonymous) @ provider.ts:82
l @ provider.ts:2
(anonymous) @ provider.ts:2
(anonymous) @ provider.ts:2
se @ provider.ts:2
a @ provider.ts:2
(anonymous) @ provider.ts:2
(anonymous) @ provider.ts:2
(anonymous) @ provider.ts:86
(anonymous) @ provider.ts:66
l @ provider.ts:2
(anonymous) @ provider.ts:2
(anonymous) @ provider.ts:2
se @ provider.ts:2
a @ provider.ts:2
(anonymous) @ provider.ts:2
(anonymous) @ provider.ts:2
(anonymous) @ provider.ts:87
(anonymous) @ provider.ts:57
l @ provider.ts:2
(anonymous) @ provider.ts:2
(anonymous) @ provider.ts:2
se @ provider.ts:2
a @ provider.ts:2
(anonymous) @ provider.ts:2
(anonymous) @ provider.ts:2
(anonymous) @ provider.ts:58
(anonymous) @ ws.ts:31
l @ ws.ts:31
(anonymous) @ ws.ts:31
(anonymous) @ ws.ts:31
Ce @ ws.ts:31
a @ ws.ts:31
Promise.then (async)
Ce @ ws.ts:31
a @ ws.ts:31
(anonymous) @ ws.ts:31
(anonymous) @ ws.ts:31
(anonymous) @ ws.ts:31
value @ ws.ts:31
(anonymous) @ ws.ts:31
l @ ws.ts:31
(anonymous) @ ws.ts:31
(anonymous) @ ws.ts:31
Ce @ ws.ts:31
a @ ws.ts:31
(anonymous) @ ws.ts:31
(anonymous) @ ws.ts:31
(anonymous) @ ws.ts:31
(anonymous) @ ws.ts:31
l @ ws.ts:31
(anonymous) @ ws.ts:31
(anonymous) @ ws.ts:31
Ce @ ws.ts:31
a @ ws.ts:31
(anonymous) @ ws.ts:31
(anonymous) @ ws.ts:31
(anonymous) @ ws.ts:31
value @ ws.ts:31
(anonymous) @ ws.ts:31
emit @ node:events:525
value @ heartbeat.ts:56
(anonymous) @ heartbeat.ts:52

The error seems to origin from walletconnect-utils/misc/heartbeat/src/heartbeat.ts#L52

An additional information. The only way to make new request to work again, is to refresh the wallet (cmd+r)

@Ganbin
Copy link
Contributor Author

Ganbin commented Jun 28, 2023

In 1.8.2 the getWallets with include_data": true is now working for my wallet with a lot of data in my DID wallet. The on chain NFTs still make the chia_getNFTs method to fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants