-
Notifications
You must be signed in to change notification settings - Fork 684
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
Looks like broadcast_tx_commit sometimes returns nonce error erroneously #3054
Comments
Looks like can fail on CI as well: |
There is global retry as well, so it's possible that the |
@vgrichina what @evgenykuzyakov described is certainly a possibility. |
@evgenykuzyakov retry with new nonce is only done for specific error: |
I've did another run and it looks like following is going on:
transaction takes a lot of time, so gets resubmitted because of timeout
nonce error gets returned erroneously, this log is only really possible for nonce error. Looks like race condition in determining whether transaction is the same that landed with given nonce? @bowenwang1996
on retry with new nonce we get this |
Looks like this happens for other transactions types as well, like adding a key: |
I have noticed a very similar error recently in the bridge Near-One/rainbow-bridge#229. It was not seen before, however I have attributed it to some bug in bridge or near-api-js. @vgrichina , @frol , @bowenwang1996 is it possible that we broke something in the nearcore or near-api-js ? CC @ailisp |
@vgrichina are you submitting transactions through the rpc endpoint or your own node? |
@bowenwang1996 I never use my own node. |
@nearmax in my testing I for sure do use different near-api-js ( But also my understanding is that before recent change from @bowenwang1996 in nearcore re-submitting same transaction would just always fail with wrong nonce error. Seems like now it sometimes fails with wrong nonce error. |
It seems that the following happens:
|
@nearmax @bowenwang1996 @frol I think this is actually a P0 as can easily result in double spends. Let's fix it for next release ideally. |
Resolves #3054. Test Plan ======= Manually confirmed that the benchmark works fine and the node does not report incorrect nonce.
Describe the bug
Getting following error:
For code which shouldn't ever try to create same account twice unless there is nonce error:
https://github.com/near-examples/listens-counter/blob/master/src/benchmark.js
To Reproduce
retry-nonce
branch.npm run build:contract
node src/benchmark.js 80 50
, sometimes it just happens.Expected behavior
/Transaction nonce \d+ must be larger than nonce of the used access key \d+/
errors should only be returned when transaction does indeed need to be re-tried with a different nonce.Right now it seems like there is some race condition and original transaction (for which error is returned) still lands:
https://explorer.testnet.near.org/accounts/listens-counter-test-user-1595989309496-47
Version:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: