leather-io / extension

Leather browser extension
https://leather.io
MIT License
289 stars 138 forks source link

Resolve issue with nonce set 1 too high #2716

Closed Nabeel-javaid closed 1 year ago

Nabeel-javaid commented 1 year ago

Its been more then 48 hours since my transaction is stuck in mempool even tho i used high gas, idk why is this happening, but whatever reason is its very frustrating. I know you guys can't do anything but pls let me know how to cancel it and what's the approximate time that it will be cancelled. And what can i do next time so that my transaction won't be stuck like this

Please don't close the issue

markmhendrickson commented 1 year ago

Can you provide the transaction ID so we can take a look?

There's no method yet for canceling transactions, though we're looking into adding it soon: https://github.com/hirosystems/stacks-wallet-web/issues/1834

Nabeel-javaid commented 1 year ago

Can you provide the transaction ID so we can take a look?

There's no method yet for canceling transactions, though we're looking into adding it soon: #1834

https://explorer.stacks.co/txid/0x8ce91aaea056b220d4de22707d469a1a04769f31b5e5425ff855c08df2a3fa56?chain=mainnet https://explorer.stacks.co/txid/0xbff543ead1aa0903e825cdad0a83e8836af5dce0fc13d834db23194c880af514?chain=mainnet

here are both TXNs

sorry I mistakenly closed it ig, but i would be good if u can still answer

markmhendrickson commented 1 year ago

It appears both of these transactions are using the wrong nonce (3 when they should be using 2).

@fbwoolf @rafaelcr any idea whether the work on https://github.com/hirosystems/stacks-blockchain-api/issues/1342 might have helped prevent this?

@Nabeel-javaid You should be able to resolve your issue here by resending both of this transactions, but before submitting, select "Edit nonce" at the bottom of the wallet screen and change the value to 2.

markmhendrickson commented 1 year ago
Screen Shot 2022-10-13 at 10 50 40 Screen Shot 2022-10-13 at 10 50 46
rafaelcr commented 1 year ago

@fbwoolf @rafaelcr any idea whether the work on https://github.com/hirosystems/stacks-blockchain-api/issues/1342 might have helped prevent this?

I think so. The wallet could've detected the gap between the last mempool nonce and the last executed nonce to suggest the solution (RBF with nonce = 2)

fbwoolf commented 1 year ago

The logic in the wallet is not that simple. It can be reviewed here: https://github.com/hirosystems/stacks-wallet-web/blob/dev/src/app/query/stacks/nonce/account-nonces.utils.ts

@markmhx there is also a Notion doc that outlines the wallet logic as it was implemented. There are several edge cases it has had to address. We can scrap it if you want and start over.