You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to modify our commit/reveal mechanism to allow validators to submit multiple weight commits without overwriting previous ones. The nonce for each commit will be generated by the Python client rather than on-chain.
Acceptance Criteria
Validators should be able to submit multiple weight commits without overwriting previous pending commits.
Each commit should be identified by a client-generated nonce.
Validators should be able to reveal any of their pending commits within the reveal period.
The system should maintain the existing time constraints for the reveal period.
If a reveal is successful, only the revealed commit should be removed from the pending commits.
Tasks
Modify the storage structure to allow multiple pending commits per validator.
my_subnet=awaitsubtensor.get_subnet(12)
commit=awaitmy_subnet.commit_weights(uid_to_weight_dict)
# save the commit object to a database in case the validator restarts or something before it can reveal weightstarget_block=commit.block+my_subnet.hyperparameters.min_reveal_delayawaitsubtensor.wait_untiL_block(target_block)
whilesubtensor.get_current_block() <commit.block+my_subnet.hyperparameters.max_reveal_delayreturnawaitcommit.reveal_weights()
awaitasyncio.sleep(5)
returnFalse
then a coroutine which runs after start should see if there are any weights in the db that need to be revealed
Should there be a limit on the number of pending commits per validator to prevent potential spam or DoS attacks? max_reveal_delay should be set to a couple days, that should be enough to secure it. If subnets will abuse it, we'll see it, though with the O(1) cost of fetching the hash this shouldn't be a big problem.
Description
We need to modify our commit/reveal mechanism to allow validators to submit multiple weight commits without overwriting previous ones. The nonce for each commit will be generated by the Python client rather than on-chain.
Acceptance Criteria
Tasks
do_commit_weights
function to add new commits with client-provided nonces.do_reveal_weights
function to work with the new multi-commit system, allowing reveal of any valid pending commit.Additional Considerations
The text was updated successfully, but these errors were encountered: