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

analyzer/consensus: Do not bump nonce for consensus.Meta txs #651

Merged
merged 3 commits into from
Mar 4, 2024

Conversation

mitjat
Copy link
Contributor

@mitjat mitjat commented Mar 1, 2024

The consensus.Meta tx is special, and calling it does not increase the nonce. This PR fixes nexus's dead-reckoning of the nonce accordingly.

Implementation details in oasis-core:

  • consensus.Meta is special-handled here
  • The rest of txs bump the nonce in txAuthHandler.AuthenticateTx(), same file, line 77.
    • There is only one non-test implementation of AuthenticateTx(). It is set for "the abci app" (= all of oasis, as it presents itself to cometbft), not just for staking, here, and increases the nonce here

The PR also improves the documentation around nonces.

Testing: None post-fix. I discovered the bug when inspecting statecheck output.

@mitjat mitjat added the bug Something isn't working label Mar 1, 2024
Copy link
Collaborator

@pro-wh pro-wh left a comment

Choose a reason for hiding this comment

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

as discussed

@mitjat mitjat merged commit c8ffdf5 into main Mar 4, 2024
10 checks passed
@mitjat mitjat deleted the mitjat/nonce-on-meta branch March 4, 2024 19:01
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

Successfully merging this pull request may close these issues.

3 participants