namada icon indicating copy to clipboard operation
namada copied to clipboard

namadac balance executes many requests

Open Rigorously opened this issue 1 year ago • 7 comments

namadac balance --owner me first returns a balance, then triggers a rate limiter set to 30 per 10 sec. namadac balance --token naan also triggers a rate limiter set to 30 per 10 sec, but does not return anything. namadac balance --owner me --token naan returns a list of balances, but does not trigger the rate limiter.

The implementation of balance appears to be inefficient and could put an unnecessarily large load on nodes.

Rigorously avatar Feb 20 '24 04:02 Rigorously

Same with a shielded transfer, but not a transparent to transparent transfer. Trigger was set to 100 requests per 10 seconds.

namadac transfer \ --source <your-established-account-alias> \ --target <your-payment-address-alias> \ --token <token> \ --amount <amount-to-shield>

Rigorously avatar Feb 20 '24 20:02 Rigorously

the problem is that both balance and shiedled transfer first are trying to sync the shiedled context and then they do the txs. Try to update to the latest release and use the shielded sync command first and the issue a balance query.

Fraccaman avatar Feb 22 '24 17:02 Fraccaman

Syncing is now decoupled from the commands, the user has to manually sync. However the source of problem remains, fetching and scanning all blocks, which gets worse as the chain grows. Depending on the computing power of the client, it could actually become impossible to catch up when not continually syncing.

Rigorously avatar Mar 11 '24 18:03 Rigorously

totally agree with you @Rigorously

HadesGuard avatar Mar 13 '24 10:03 HadesGuard

I had planned to improve syncing. Alas, I cannot make it in time for the end of the Shielded Event. I would have taken inspiration from Zcash BlazeSync and WarpSync:

https://forum.zcashcommunity.com/t/zecwallets-blazesync-sync-entire-chain-in-60s/

https://hhanh00.github.io/zcash-sync/

Rigorously avatar Apr 11 '24 15:04 Rigorously

A Good improvement.

phat-kafi avatar Apr 16 '24 03:04 phat-kafi

when you start it @Rigorously? , we need it in the mainnet

HadesGuard avatar Apr 16 '24 04:04 HadesGuard