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

Registrar has nonce issues if issuing two tx's without confirmation #49

Open
hstove opened this issue Mar 29, 2021 · 4 comments
Open

Registrar has nonce issues if issuing two tx's without confirmation #49

hstove opened this issue Mar 29, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@hstove
Copy link
Contributor

hstove commented Mar 29, 2021

The registrar uses a naive approach for getting the current nonce - which is just to call /v2/accounts and get the current nonce. This does not reflect any tx's in the mempool. If the registrar makes a name_update tx and then makes another one before the first was confirmed, the second tx will get rejected due to a conflicting nonce error.

This can be worked around with a longer "batch interval" configuration - but it's not ideal.

Two options to do a better job:

  • Get all pending tx's for the registrar payer, and if there is a pending tx, use the highest nonce + 1
  • Store tx nonce's in the database, and use the next highest one
@hstove hstove added the bug Something isn't working label Mar 29, 2021
@314159265359879
Copy link

Isn't this a more general problem with nonce's?
When I make a transaction in the Boom wallet (nonce 10), for example to transfer an NFT, then return to the hiro web wallet to make a transfer it will try to do so with the same nonce (10), if the Boom transaction was not yet confirmed.
Could the application simply count the number of pending transactions (x) and add those to nonce value (10+x) of the last confirmed transaction? Counting on there being only one transaction pending may not suffice anyway.

If all applications are experiencing these sort of issues should this be solved elsewhere, could it merit a SIP?

@markmhendrickson
Copy link

Does the registrar retry transactions upon failure for whatever reason, nonce or otherwise?

@asimm241
Copy link
Contributor

Does the registrar retry transactions upon failure for whatever reason, nonce or otherwise?

Yes, It periodically checks for subdomains with received status in the local DB and calls name-update, for them.

@markmhendrickson
Copy link

Great 💪 Given those retries, this doesn't appear urgent for resolution before we deploy the updated registrar for mainnet.

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

4 participants