-
Notifications
You must be signed in to change notification settings - Fork 339
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thewhaleking
requested changes
Dec 17, 2024
thewhaleking
requested changes
Dec 17, 2024
thewhaleking
approved these changes
Dec 17, 2024
ibraheem-opentensor
approved these changes
Dec 17, 2024
Merged
camfairchild
added a commit
that referenced
this pull request
Jan 17, 2025
* Updates tests for btwallet 3.0.0 * fix get_delegates result decoding * Feat/use tx pool for set weights (#2534) * use the tx pool for setting/committing weights * add supports rpc method with cache * handle when state call is not possible (unlikely) * increment next index by one for correct nonce * use for set sync set weights also * oops, define in subtensor for sync methods * make tests less specific * try e2e test for commit weights * modify comments on test * add root set test helper * try upping submit timeout * add set weights e2e test * use high timeout on tests * add awaits and log netuid * chore: ruff * use sudo_set_admin_utils instead * don't increment next index for nonce * dont await sudo_set_admin_utils * lower test ext timeout to 12 * enable reg during test * use set hyp values instead * sleep after setting reg allowed * fix test_set_weights_uses_next_nonce * Use asyncstdlib for lru_cache of `AsyncSubstrateInterface.supports_rpc_method` * Increases sleep for txs in test_set_weights_uses_next_nonce --------- Co-authored-by: Benjamin Himes <[email protected]> Co-authored-by: ibraheem-opentensor <[email protected]> Co-authored-by: Benjamin Himes <[email protected]> * fix tests * add connection limit error handler * add test * Backmerge master to staging post 851 (#2557) Bumps version and changelog * improve handler * add async commit reveal impl * add new logic to async_subtensor * add unit tests * ruff * add uid check before processing * fix test * Use apt-get instead of apt for scripts (#2571) apt --> apt-get * fix _do_stake incorrect arguments error in staking.py add_stake sdk (after pybytes error is fixed in delegate_info.py) another error occurs, because _do_stake is incorrectly called on line 124 in staking.py returning an invalid arguments error, must add self (subtensor) param to fix this error. * Updates subtensor branch for e2e * tests fix * Bumps cr3 ffi * Bumps version and changelog * Updates changelog --------- Co-authored-by: Roman <[email protected]> Co-authored-by: Cameron Fairchild <[email protected]> Co-authored-by: Benjamin Himes <[email protected]> Co-authored-by: Benjamin Himes <[email protected]> Co-authored-by: Roman <[email protected]> Co-authored-by: Assh-codes <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses an issue with
set_weights
calls where submitting transactions can error if there is already aset_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.