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

Feat/use tx pool for set weights #2534

Merged
merged 30 commits into from
Dec 17, 2024
Merged

Conversation

camfairchild
Copy link
Collaborator

@camfairchild camfairchild commented Dec 12, 2024

This PR addresses an issue with set_weights calls where submitting transactions can error if there is already a set_weights transaction in the pool. This happens because the nonce and the call method match with a transaction already in the pool.

We usually grab the next account nonce using the chain's state, and we increment it, therefore submitting the same nonce to the pool before the existing transaction has been included.

We can fix this by using the RPC method account_nextIndex which takes into account all the transactions in the pool and gives you the next nonce that the account should use to not conflict with any pending transactions in the pool.

tests/e2e_tests/test_set_weights.py Outdated Show resolved Hide resolved
@camfairchild camfairchild merged commit 7cede0c into staging Dec 17, 2024
30 checks passed
@camfairchild camfairchild deleted the feat/use-tx-pool-for-set-weights branch December 17, 2024 20:52
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.

3 participants