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

fix: make message signer nonce generation transactional #4165

Merged
merged 2 commits into from Oct 5, 2020

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented Oct 5, 2020

Fixes two problems with nonce generation:

  • nonce generation was not transactional, so if Mpool.Push failed, there would be a gap between nonces
  • there was no lock when generating a nonce, so two messages could end up with the same nonce

@dirkmc dirkmc force-pushed the fix/message-signer-nonce-generation branch from ee8998e to 1406715 Compare October 5, 2020 12:19
@dirkmc dirkmc requested a review from vyzo October 5, 2020 12:22
Copy link
Contributor

@vyzo vyzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when is the nonce incremented?

@magik6k
Copy link
Contributor

magik6k commented Oct 5, 2020

(testing manually)

@magik6k
Copy link
Contributor

magik6k commented Oct 5, 2020

(seems to work, with the right stuff in the datastore)

@magik6k magik6k merged commit fee84c4 into master Oct 5, 2020
@magik6k magik6k deleted the fix/message-signer-nonce-generation branch October 5, 2020 16:56
@Kubuxu
Copy link
Contributor

Kubuxu commented Oct 5, 2020

I don't think this will resolve the issue:
If people are nonce-gaped, on a restart, we will ask Mpool for Nonce. Mpool will return a nonce before the gap, after we fill the gap, we will try to push messages where there is already a message, which will fail due to RBF not being triggered.

@vyzo
Copy link
Contributor

vyzo commented Oct 5, 2020

they will have to manually clear the mpool with lotus mpool clear --local --really-do-it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants