Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,3 @@ repos:
rev: 7.1.2
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
hooks:
- id: mypy
exclude: ^(docs/|example-plugin/)
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ validator_coldkey_name = validator-base
validator_hotkey_name = default

ewma_window_days = 10
ewma_cutoff_days = 10

# Python virtual environment
venv_python=bt_venv/bin/python3
Expand All @@ -34,4 +33,3 @@ validator:
--logging.$(logging_level) \
--neuron.axon_off true \
--ewma.window_days $(ewma_window_days) \
--ewma.cutoff_days $(ewma_cutoff_days)
30 changes: 30 additions & 0 deletions alembic/versions/2b28a1b95303_add_column_rewards_prompt_name.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""add column rewards prompt_name

Revision ID: 2b28a1b95303
Revises: a9227b0cb10b
Create Date: 2025-11-27 17:57:01.394792

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "2b28a1b95303"
down_revision: Union[str, None] = "a9227b0cb10b"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
op.add_column(
"miner_rewards",
sa.Column("prompt_name", sa.Text, server_default="low"),
)


def downgrade() -> None:
op.drop_column("miner_rewards", "prompt_name")
33 changes: 0 additions & 33 deletions docs/miner_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,39 +166,6 @@ pm2 start miner.config.js -- --blacklist.validator_min_stake 1000

<sup>[Back to top ^][table-of-contents]</sup>

#### `--blacklist.validator_exceptions INTEGER INTEGER INTEGER ...`

Optional list of validator exceptions (e.g., --blacklist.validator_exceptions 0 1 128 162 34 49 38).

Default: `[]`

Example:

```js
// miner.config.js
module.exports = {
apps: [
{
name: "miner",
interpreter: "python3",
script: "./neurons/miner.py",
args: "--blacklist.validator_exceptions 0 1 128 162 34 49 38",
env: {
PYTHONPATH: ".",
},
},
],
};
```

Alternatively, you can add the args directly to the command:

```shell
pm2 start miner.config.js -- --blacklist.validator_exceptions 0 1 128 162 34 49 38
```

<sup>[Back to top ^][table-of-contents]</sup>

#### `--logging.debug`

Turn on bittensor debugging information.
Expand Down
99 changes: 13 additions & 86 deletions docs/validator_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
- [5. Options](#5-options)
- [5.1. Common Options](#51-common-options)
- [`--axon.port INTEGER`](#--axonport-integer)
- [`--ewma.cutoff_days INTEGER`](#--ewmacutoff_days-integer)
- [`--ewma.window_days INTEGER`](#--ewmawindow_days-float)
- [`--ewma.window_days INTEGER`](#--ewmawindow_days-integer)
- [`--softmax.beta FLOAT`](#--softmaxbeta-float)
- [`--logging.debug`](#--loggingdebug)
- [`--logging.info`](#--logginginfo)
- [`--logging.trace`](#--loggingtrace)
Expand All @@ -25,7 +25,6 @@
- [`--neuron.sample_size INTEGER`](#--neuronsample_size-integer)
- [`--neuron.timeout INTEGER`](#--neurontimeout-integer)
- [`--neuron.nprocs INTEGER`](#--neuronnprocs-integer)
- [`--neuron.use_multiprocess INTEGER`](#--neuronuse_multiprocess-integer)
- [`--neuron.vpermit_tao_limit INTEGER`](#--neuronvpermit_tao_limit-integer)
- [`--wallet.hotkey TEXT`](#--wallethotkey-text)
- [`--wallet.name TEXT`](#--walletname-text)
Expand Down Expand Up @@ -284,45 +283,6 @@ pm2 start validator.test.config.js -- --axon.port 8091

<sup>[Back to top ^][table-of-contents]</sup>

#### `--ewma.cutoff_days INTEGER`

The number of days against which to run the moving average, (e.g. 1).

Default: `2`

Example:

```js
// validator.config.js
module.exports = {
apps: [
{
name: "validator",
interpreter: "python3",
script: "./neurons/validator.py",
args: "--ewma.cutoff_days 10",
env: {
PYTHONPATH: ".",
},
},
],
};
```

Alternatively, you can add the args directly to the command:

```shell
pm2 start validator.config.js -- --ewma.cutoff_days 10
```

for testnet it's:

```shell
pm2 start validator.test.config.js -- --ewma.cutoff_days 10
```

<sup>[Back to top ^][table-of-contents]</sup>

#### `--ewma.window_days INTEGER`

The window in days for the rolling average, (e.g. 10).
Expand Down Expand Up @@ -358,9 +318,9 @@ pm2 start validator.config.js -- --ewma.window_days 10

#### `--softmax.beta FLOAT`

Negative beta to give higher weight to lower scores.
Negative beta to give higher weight to lower scores for the 1h prompt

Default: `-0.002`
Default: `-0.05`

Example:

Expand All @@ -372,7 +332,7 @@ module.exports = {
name: "validator",
interpreter: "python3",
script: "./neurons/validator.py",
args: "--softmax.beta -0.003",
args: "--softmax.beta -0.05",
env: {
PYTHONPATH: ".",
},
Expand All @@ -384,7 +344,7 @@ module.exports = {
Alternatively, you can add the args directly to the command:

```shell
pm2 start validator.config.js -- --softmax.beta -0.003
pm2 start validator.config.js -- --softmax.beta -0.05
```

<sup>[Back to top ^][table-of-contents]</sup>
Expand Down Expand Up @@ -808,9 +768,9 @@ pm2 start validator.config.js -- --neuron.timeout 120

#### `--neuron.nprocs INTEGER`

The number of processes to run for the validator dendrite, (e.g. 8).
The number of processes to run for the validator dendrite, (e.g. 2).

Default: `8`
Default: `2`

Example:

Expand All @@ -819,10 +779,10 @@ Example:
module.exports = {
apps: [
{
name: "validator",
interpreter: "python3",
script: "./neurons/validator.py",
args: "--neuron.nprocs 8",
name: 'validator',
interpreter: 'python3',
script: './neurons/validator.py',
args: '--neuron.nprocs 2',
env: {
PYTHONPATH: ".",
},
Expand All @@ -834,7 +794,7 @@ module.exports = {
Alternatively, you can add the args directly to the command:

```shell
pm2 start validator.config.js -- --neuron.nprocs 8
pm2 start validator.config.js -- --neuron.nprocs 2
```

<sup>[Back to top ^][table-of-contents]</sup>
Expand Down Expand Up @@ -872,39 +832,6 @@ pm2 start validator.config.js -- --neuron.vpermit_tao_limit 1000

<sup>[Back to top ^][table-of-contents]</sup>

#### `--neuron.use_multiprocess INTEGER`

Wether to use multiple processes for the validator dendrite.

Default: `1`

Example to disable multiprocess:

```js
// validator.config.js
module.exports = {
apps: [
{
name: "validator",
interpreter: "python3",
script: "./neurons/validator.py",
args: "--neuron.use_multiprocess 0",
env: {
PYTHONPATH: ".",
},
},
],
};
```

Alternatively, you can add the args directly to the command:

```shell
pm2 start validator.config.js -- --neuron.nprocs 8
```

<sup>[Back to top ^][table-of-contents]</sup>

#### `--wallet.hotkey TEXT`

The hotkey of the wallet.
Expand Down
4 changes: 1 addition & 3 deletions entrypoint-validator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ validator_coldkey_name=validator
validator_hotkey_name=default

ewma_window_days=10
ewma_cutoff_days=10
softmax_beta=-0.1
softmax_beta=-0.05

log_id_prefix=my_validator_name

Expand All @@ -23,7 +22,6 @@ python3.10 ./neurons/validator.py \
--logging.debug \
--neuron.axon_off true \
--ewma.window_days $ewma_window_days \
--ewma.cutoff_days $ewma_cutoff_days \
--softmax.beta $softmax_beta \
--neuron.vpermit_tao_limit $vpermit_tao_limit \
--gcp.log_id_prefix $log_id_prefix \
19 changes: 5 additions & 14 deletions neurons/miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,12 @@ async def blacklist(self, synapse: Simulation) -> typing.Tuple[bool, str]:
uid = self.metagraph.hotkeys.index(synapse.dendrite.hotkey)
stake = self.metagraph.S[uid]
bt.logging.info(f"Requesting UID: {uid} | Stake at UID: {stake}")
bt.logging.debug(
f"Whitelisted validators: {self.config.blacklist.validator_exceptions}"
)

if uid in self.config.blacklist.validator_exceptions:
if stake <= self.config.blacklist.validator_min_stake:
# Ignore requests if the stake is below minimum
bt.logging.info(
f"Requesting UID: {uid} whitelisted as a validator"
f"Hotkey: {synapse.dendrite.hotkey}: stake below minimum threshold of {self.config.blacklist.validator_min_stake}"
)
else:
if stake <= self.config.blacklist.validator_min_stake:
# Ignore requests if the stake is below minimum
bt.logging.info(
f"Hotkey: {synapse.dendrite.hotkey}: stake below minimum threshold of {self.config.blacklist.validator_min_stake}"
)
return True, "Stake below minimum threshold"
return True, "Stake below minimum threshold"

if self.config.blacklist.force_validator_permit:
# If the config is set to force validator permit, then we should only allow requests from validators.
Expand Down Expand Up @@ -182,7 +173,7 @@ def load_state(self):
def set_weights(self):
pass

async def forward_validator(self):
def forward_validator(self):
pass

def print_info(self):
Expand Down
Loading