GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(validator): say the chain preflight is skipped without a hotkey · CortexLM/cortex@f8f10a9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • deploy
    • README.md
  • docs/external-miner
    • validators.md
  • src/cortex/validator
    • __main__.py
  • tests/validator
    • test_main.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎deploy/README.md‎

Copy file name to clipboardExpand all lines: deploy/README.md
+14Lines changed: 14 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,20 @@ reports `validator outcome=verified` for the same root/vector from historical
196196
chain state. The unsealed UID0 fallback is a readiness failure, not a weight to
197197
submit.
198198

199+
`outcome=verified` from the hotkey-less role says nothing about the hotkey: it
200+
logs `preflight=skipped` and does not check hotkey registration, validator permit
201+
or the weight rate limit. There is no submission-off switch on the weight-setter,
202+
so check the hotkey before starting it, on the weight-setter host:
203+
204+
1. Run `WALLET_NAME=... WALLET_HOTKEY=... scripts/run-validator.sh --verify-only`
205+
(or `cortex validator --verify-only --once` with `--wallet-name`,
206+
`--wallet-hotkey` and `--wallet-path`). With a hotkey, verify-only runs the same
207+
chain preflight as a submission and never submits: the hotkey must be
208+
registered on the netuid, hold a validator permit, have its weight rate limit
209+
elapsed (`blocks_since_last_update > weights_rate_limit`) and the chain limits
210+
must accept the sealed vector. A refusal prints `chain_preflight_failed`.
211+
2. Only then start `role-weight-setter.yml`.
212+
199213
To run a validator without Compose, use `scripts/run-validator.sh` from a
200214
repository clone. It needs `WALLET_NAME` and `WALLET_HOTKEY` only to submit weights
201215
(`--verify-only` needs neither), reads the
Collapse file

‎docs/external-miner/validators.md‎

Copy file name to clipboardExpand all lines: docs/external-miner/validators.md
+11Lines changed: 11 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,17 @@ never claims its epoch in the journal and never creates an extrinsic. It exits
154154
successfully only for the exact `verified` outcome; unsealed, changed, degraded
155155
or peer-unavailable states return a nonzero process status.
156156

157+
Without a hotkey, verify-only logs `preflight=skipped`: it does **not** check
158+
hotkey registration, validator permit or the weight rate limit, so `verified`
159+
proves the seal, not that this hotkey can submit. Before the first submission,
160+
run verify-only once more with `--wallet-name` and `--wallet-hotkey` (both or
161+
neither; one alone is refused): it then runs the full chain preflight of a
162+
submission (registered on the netuid, validator permit, rate limit elapsed,
163+
chain weight limits) without submitting, and a refusal is
164+
`chain_preflight_failed`. Start the submitting validator only after that run is
165+
`verified`; it has no submission-off switch. A hotkey file that cannot be read
166+
stops the process at startup.
167+
157168
For Compose use the Python
158169
[validator environment example](../../deploy/env/python-validator.env.example)
159170
with the verify-only [validator role](../../deploy/compose/role-validator.yml) (no
Collapse file

‎src/cortex/validator/__main__.py‎

Copy file name to clipboardExpand all lines: src/cortex/validator/__main__.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@ def main(argv: list[str] | None = None) -> None:
272272
raise SystemExit(
273273
f"validator hotkey unreadable under --wallet-path: {type(error).__name__}"
274274
) from None
275+
elif arguments.verify_only:
276+
logging.warning(
277+
"validator preflight=skipped: no hotkey, so registration, validator permit "
278+
"and weight rate limit are not checked"
279+
)
275280
subtensor = Subtensor(
276281
network=arguments.network, fallback_endpoints=arguments.fallback_endpoints
277282
)
Collapse file

‎tests/validator/test_main.py‎

Copy file name to clipboardExpand all lines: tests/validator/test_main.py
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,17 @@ def test_weight_setter_with_a_missing_hotkey_file_fails_at_startup(monkeypatch,
247247
with pytest.raises(SystemExit, match="hotkey unreadable") as refused:
248248
validator_main.main(arguments)
249249
assert "default" not in str(refused.value) and "wallets" not in str(refused.value)
250+
251+
252+
def test_verify_only_without_hotkey_logs_that_the_chain_preflight_is_skipped(
253+
monkeypatch, tmp_path, caplog
254+
):
255+
fake_chain_modules(monkeypatch)
256+
257+
async def verified(arguments, subtensor, wallet):
258+
return TickResult("verified")
259+
260+
monkeypatch.setattr(validator_main, "run", verified)
261+
validator_main.main([*without_hotkey(tmp_path), "--verify-only", "--once"])
262+
assert "preflight=skipped" in caplog.text
263+
assert "validator permit" in caplog.text

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.