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
"""Returns encrypted commit and target round for `commit_crv3_weights` extrinsic.
20
22
21
23
Arguments:
22
24
uids: The uids to commit.
23
25
weights: The weights associated with the uids.
24
26
version_key: The version key to use for committing and revealing. Default is `bittensor.core.settings.version_as_int`.
25
-
subnet_reveal_period_epochs: Number of epochs after which the revive will be performed. Corresponds to hyperparameter 'commit_reveal_weights_interval' of the subnet. In epochs.
26
-
block_time: Amount if seconds in one block. In seconds.
27
-
tempo: Amount of blocks in one Epoch.
28
-
27
+
tempo: Number of blocks in one epoch.
28
+
current_block: The current block number in the network.
29
+
netuid: The network unique identifier (NetUID) for the subnet.
30
+
subnet_reveal_period_epochs: Number of epochs after which the reveal will be performed. Corresponds to the hyperparameter `commit_reveal_weights_interval` of the subnet. In epochs.
31
+
block_time: Amount of time in seconds for one block. Defaults to 12 seconds.
32
+
29
33
Returns:
30
-
commit (bites): hex value of encrypted and compressed uids and weights values for setting weights.
34
+
commit (bytes): Raw bytes of the encrypted, and compressed uids & weights values for setting weights.
31
35
target_round (int): Drand round number when weights have to be revealed. Based on Drand Quicknet network.
32
-
"""
36
+
"""
33
37
# function logic
34
38
return commit, target_round
35
39
```
36
40
37
41
38
42
To test the function run in terminal:
43
+
1. Spin up a local subtensor branch which includes CR3
44
+
2. Create a subnet with netuid 1 (or replace the netuid with the one you create)
39
45
```bash
40
46
mkdir test
41
47
cdtest
@@ -54,10 +60,20 @@ then copy-past to ipython
54
60
import numpy as np
55
61
import bittensor_commit_reveal as crv3
56
62
from bittensor.utils.weight_utils import convert_weights_and_uids_for_emit
0 commit comments