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

update nonce via rpc before producing a new sidechain block #1640

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

brenzi
Copy link
Collaborator

@brenzi brenzi commented Nov 7, 2024

hopefully this will fix #1639

reasoning:

Now that enclave extrinsics are mortal, it can happen that any extrinsic is purged from the tx pool without being executed. Previously, we initialized the nonce at startup and then kept track of it within our enclave only. This will break as soon as one mortality hits because nonces will leave a gap

With this PR we re-sync the nonce before attempting to execute a new block of TOPs using the node rpc function system_accountNextIndex which takes into account the pending extrinsics in the pool. As all extrinsics can only be signed by our local enclave and all are sent to our own local node, the local node always knows the correct next nonce. q.e.d.

@brenzi brenzi added A0-core Affects a core part B1-releasenotes C1-low 📌 Does not elevate a release containing this beyond "low priority" E0-breaksnothing labels Nov 7, 2024
@brenzi brenzi requested a review from clangenb November 7, 2024 16:42
Copy link
Contributor

@clangenb clangenb left a comment

Choose a reason for hiding this comment

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

LGTM

core-primitives/types/src/lib.rs Show resolved Hide resolved
@brenzi brenzi merged commit 7cfeaa5 into master Nov 8, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0-core Affects a core part B1-releasenotes C1-low 📌 Does not elevate a release containing this beyond "low priority" E0-breaksnothing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enclave extrinsic sent with invalid mortality checkpoint
2 participants