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

No balance found after a dry-run shielded IBC with disposable gas payer #2750

Closed
Rigorously opened this issue Feb 27, 2024 · 1 comment · Fixed by #2775
Closed

No balance found after a dry-run shielded IBC with disposable gas payer #2750

Rigorously opened this issue Feb 27, 2024 · 1 comment · Fixed by #2775
Assignees
Labels
bug Something isn't working client MASP SDK

Comments

@Rigorously
Copy link

Rigorously commented Feb 27, 2024

TL;DR: after a specific type of dry-run transaction it is necessary to shielded-sync. Ideally the chain nor the client state should be affected after a dry-run.

First prepare:

$ namadac shielded-sync
Syncing finished

$ namadac balance -- owner aspendingkey
Last committed epoch: 21
naan : 33.028

Now we run the following admittedly slightly awkward contraption.

$ namadac ibc-transfer --token naan --amount 1 --source aspendingkey --receiver the1quickbrownfox --channel-id channel-420 --disposable-gas-payer --gas-spending-key aspendingkey --dry-run-wrapper (or --dry-run)

I know, it is kind of a ridiculous transaction, but hear me out.

The result is a complaint that the Internal MASP balance is empty.

Enter your decryption password: 
Error: 
   0: The balance of the source tnam1pcqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzmefah is lower than the amount to be transferred. Amount to transfer is 1.000000 tnam1qxvg64psvhwumv3mwrrjfcz0h3t3274hwggyzcee
   1: The balance of the source tnam1pcqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzmefah is lower than the amount to be transferred. Amount to transfer is 1.000000 tnam1qxvg64psvhwumv3mwrrjfcz0h3t3274hwggyzcee

Remember this was a dry-run, so the transaction should have no permanent effect.

$ namadac balance --owner aspendingkey
Last committed epoch: 21
No shielded balance found for given key

No balance? That is strange!

We sync again and check the balance afterwards.

$ namadac shielded-sync
Syncing finished

$ namadac balance -- owner aspendingkey
Last committed epoch: 21
naan : 33.028

Indeed, nothing permanent happened on-chain. I guess the client was suffering from impermanent loss. ;)

@Rigorously Rigorously added the bug Something isn't working label Feb 27, 2024
@grarco
Copy link
Contributor

grarco commented Feb 28, 2024

Hi @Rigorously, thanks for bringing this up! It looks indeed like we call pre_cache_transaction all the times when generating a masp tx which causes a (possible) update of the context. We should avoid calling it in a dry run

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

Successfully merging a pull request may close this issue.

2 participants