Add Validate proxy support to runtime and Python SDK - #3041
Draft
cisterciansis wants to merge 4 commits into
Draft
Add Validate proxy support to runtime and Python SDK#3041cisterciansis wants to merge 4 commits into
cisterciansis wants to merge 4 commits into
Conversation
|
@cisterciansis is attempting to deploy a commit to the RaoFoundation Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ProxyType::Validatewith stable on-chain ID 18set_weightscall sites by reading the exact target hotkeys fromWEIGHT_TARGETSUtility.force_batch, so a stale, revoked, or otherwise failing proxy cannot interrupt valid targetsresult.data["weight_results"]Attribution
This work carries forward the original
ProxyType::Validateruntime design and test groundwork from #2543, authored by @ppolewicz. Thank you to Paweł Polewicz for proposing and implementing the original scoped validator proxy.This PR adapts that work to the current monorepo proxy-filter metadata model and adds the previously missing Python SDK integration.
Why
A validator operator may be authorized by several hotkeys to compute one weight vector and submit it for each validator. The runtime needs a narrow proxy role that cannot transfer value or manage stake. For commit-reveal subnets, the SDK must also preflight and timelock-encrypt against each real validator hotkey rather than the delegate key.
Unlike #2543, Validate proxies in this version cannot create additional proxies; each validator owner grants the delegate directly.
SDK behavior
Existing subnet weight-setting code does not change:
WEIGHT_TARGETS=5F...DELEGATE,5F...VALIDATOR_A,5F...VALIDATOR_BConfiguration semantics:
WEIGHT_TARGETS: preserve existing single-wallet behaviorWEIGHT_TARGETS: successful no-op without signing or submissionValidateproxyweight_targets=remains available and overrides the environmentEach target is built against its real validator identity, including commit-reveal registration, rate-limit, and timelock-encryption inputs. Target-specific SDK preflight failures are recorded without blocking other targets.
The SDK deliberately does not preverify the complete proxy configuration before submission. Each
Proxy.proxycall is authoritative on-chain, andUtility.force_batchcontinues after an invalid or revoked grant. This prevents one bad target from blocking a larger validator operation. The result preserves configured order:A single extrinsic has one signer, so the supplied wallet is the only direct signer in one execution. Other configured addresses are proxied targets.
Fees and weight refunds
set_mechanism_weightsisPays::No.Proxy.proxyinherits the inner call fee classification, and Utility keeps a batch fee-free when every child is fee-free. Runtime tests assert that direct, proxied, andforce_batchweight calls all remainPays::No.force_batchalso returns accumulated actual child weight. A Utility regression test verifies that successful children refund declared weight minus actual weight across the batch.Regression coverage
The existing live clone proxy-filter regression now creates a
Validaterelationship and exercises:It intentionally does not exercise drand. The live clone test was typechecked locally; execution requires a clone/localnet endpoint and runs in the repository clone regression job.
Validation
SKIP_WASM_BUILD=1 cargo test -p node-subtensor-runtime proxy_filters --lib: 14 passedSKIP_WASM_BUILD=1 cargo test -p node-subtensor-runtime transaction_payment_wrapper::tests --lib: 26 passedcargo fmt --check: passedLocal environment note
The native WASM build could not run locally because Apple clang lacks a wasm32 backend for the zstd C build.