Get Hyperparams v3#2699
Conversation
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE LOW scrutiny: established 2018 account with repo write permission, substantial contribution history, matching PR author/committer, and no trusted Gittensor allowlist hit; branch feat/thewhaleking/hyperparams-v4 -> devnet-ready. Static review covered the six-file diff adding a read-only FindingsNo findings. ConclusionNo malicious behavior or security vulnerability found in the static diff. 🔍 AI Review — Auditor (domain review)VERDICT: 👎 Gittensor UNKNOWN; author has write permission and substantial prior GitHub/subtensor history, so calibrated as an established contributor. Spec version is bumped to Findings
Prior-comment reconciliation
ConclusionThe V3 getter and tests are directionally sound, but the PR still does not expose the BTCLI-facing custom RPC method it describes. Add the custom RPC trait method and server implementation before merging. 📜 Previous run (superseded)
|
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👎 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👎 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
open-junius
left a comment
There was a problem hiding this comment.
Need update runtime version manually
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
Done. Thanks! |
l0r1s
left a comment
There was a problem hiding this comment.
Great, way better than having to add a new field struct everytime.
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👎 |
I'm a bit confused by this, as this works fine: from async_substrate_interface.sync_substrate import SubstrateInterface
with SubstrateInterface("ws://127.0.0.1:9945", chain_name="Bittensor") as substrate:
call = substrate.runtime_call(
"SubnetInfoRuntimeApi",
"get_subnet_hyperparams_v3",
[1]
)
print(call) # [{'name': 'rho', 'value': {'U16': 10}}, {'name': 'kappa', 'value': {'U16': 32767}}, {'name': 'immunity_period', 'value': {'U16': 4096}}, {'name': 'min_allowed_weights', 'value': {'U16': 0}}, {'name': 'max_weights_limit', 'value': {'U16': 65535}}, {'name': 'tempo', 'value': {'U16': 100}}, {'name': 'min_difficulty', 'value': {'U64': 10000000}}, {'name': 'max_difficulty', 'value': {'U64': 4611686018427387903}}, {'name': 'weights_version', 'value': {'U64': 0}}, {'name': 'weights_rate_limit', 'value': {'U64': 100}}, {'name': 'adjustment_interval', 'value': {'U16': 100}}, {'name': 'activity_cutoff', 'value': {'U16': 5000}}, {'name': 'registration_allowed', 'value': {'Bool': True}}, {'name': 'target_regs_per_interval', 'value': {'U16': 2}}, {'name': 'min_burn', 'value': {'TaoBalance': 500000}}, {'name': 'max_burn', 'value': {'TaoBalance': 100000000000}}, {'name': 'bonds_moving_avg', 'value': {'U64': 900000}}, {'name': 'max_regs_per_block', 'value': {'U16': 1}}, {'name': 'serving_rate_limit', 'value': {'U64': 50}}, {'name': 'max_validators', 'value': {'U16': 64}}, {'name': 'adjustment_alpha', 'value': {'U64': 0}}, {'name': 'difficulty', 'value': {'U64': 10000000}}, {'name': 'commit_reveal_period', 'value': {'U64': 1}}, {'name': 'commit_reveal_weights_enabled', 'value': {'Bool': True}}, {'name': 'alpha_high', 'value': {'U16': 58982}}, {'name': 'alpha_low', 'value': {'U16': 45875}}, {'name': 'liquid_alpha_enabled', 'value': {'Bool': False}}, {'name': 'alpha_sigmoid_steepness', 'value': {'I32F32': {'bits': 4294967296000}}}, {'name': 'yuma_version', 'value': {'U16': 2}}, {'name': 'subnet_is_active', 'value': {'Bool': False}}, {'name': 'transfers_enabled', 'value': {'Bool': True}}, {'name': 'bonds_reset_enabled', 'value': {'Bool': False}}, {'name': 'user_liquidity_enabled', 'value': {'Bool': False}}] |
JohnReedV
left a comment
There was a problem hiding this comment.
This is great but a few params are deprecated and should not be brought to v3.
These include:
adjustment_alphaadjustment_intervaldifficultymin_difficultymax_difficultyrho
| } | ||
| } | ||
|
|
||
| #[allow(deprecated)] |
There was a problem hiding this comment.
[MEDIUM] Expose get_subnet_hyperparams_v3 through custom RPC
The PR description says this is meant to make BTCLI hyperparam fetching easier, but the jsonrpsee custom RPC trait still exposes only subnetInfo_getSubnetHyperparams and subnetInfo_getSubnetHyperparamsV2. The new runtime API is implemented, but node RPC clients using this established surface still have no subnetInfo_getSubnetHyperparamsV3 method to call. Add a trait method, e.g. subnetInfo_getSubnetHyperparamsV3, plus a server implementation that delegates to api.get_subnet_hyperparams_v3(at, netuid) and SCALE-encodes the result like V1/V2.
There was a problem hiding this comment.
You're wrong. I was specifically advised not to do that.
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👎 |
Yes you can safely ignore, the AI reviewer is missing a bit of substrate knowledge. Using the |
Description
Adds a new runtime API: get_hyperparams_v3, which returns a Vec allowing us to much more easily add new hyperparams here for fetching.
This is mainly due to a frustration in BTCLI, where everyone wants new hyperparams, but these would require separate calls for each, which seems excessive, and defeats the purpose of the hyperparams runtime API in the first place.
Related Issue(s)
In my mind
Type of Change
Breaking Change
N/A
Checklist
./scripts/fix_rust.shto ensure my code is formatted and linted correctlyScreenshots (if applicable)
Please include any relevant screenshots or GIFs that demonstrate the changes made.
Additional Notes
V3 removes deprecated hyperparams:
and adds new ones: