Hyperparameters

commit_reveal_period

Epochs between committing a weights hash and revealing the weights, when commit-reveal is enabled.

View as Markdown

commit_reveal_period (on chain: RevealPeriodEpochs) is how long committed weights stay hidden before they are revealed, measured in epochs (tempos), not blocks. With the default of 1 and a 360-block tempo, weights committed in one epoch become public roughly one tempo (~72 minutes) later. Subnet owners tune it to balance copy-resistance (longer hiding) against how stale weights are when they finally land.

How it works

Each commit is tagged with the subnet's current epoch index. The reveal is valid in exactly one epoch: is_reveal_block_range (pallets/subtensor/src/subnets/weights.rs) requires current_epoch == commit_epoch + commit_reveal_period. Revealing earlier fails with RevealTooEarly; once the current epoch moves past that target, is_commit_expired drops the commit and a late reveal fails with ExpiredWeightCommit. A hotkey may hold at most 10 unrevealed commits.

The value is bounded on-chain: set_reveal_period accepts 1 to 100 epochs.

In practice validators rarely reveal by hand. btcli tx set-weights (the set_weights intent) uses timelocked commits: it reads RevealPeriodEpochs and the subnet's epoch schedule, computes the drand round whose randomness becomes available in the reveal epoch, and encrypts the payload to that round — the chain then decrypts and applies the weights itself, with no reveal transaction.

Commit-reveal timeline

Slide the period: the reveal is valid in exactly one epoch — commit epoch + commit_reveal_period. Earlier fails with RevealTooEarly; later, the commit is expired and dropped.

e+0

commit

e+1

reveal

e+2

expired

e+3

expired

e+4

expired

e+5

expired

e+6

expired

e+7

expired

Reveal epoch

commit epoch + 1

valid in exactly this epoch

Hidden for

≈ 360 blocks

≈ 72 min at tempo 360, 12s blocks

Allowed range

1 – 100 epochs

enforced by set_reveal_period

1 epoch

Reading and setting

btcli sudo get --netuid N --name commit_reveal_period

Owner-settable; the value is an epoch (tempo) count:

btcli sudo set --netuid N --name commit_reveal_period --value 2