docs(subtensor): fix stale faucet() docstring + remove dead cfg branch#2600
Open
ArtificialXai wants to merge 1 commit intoopentensor:mainfrom
Open
docs(subtensor): fix stale faucet() docstring + remove dead cfg branch#2600ArtificialXai wants to merge 1 commit intoopentensor:mainfrom
ArtificialXai wants to merge 1 commit intoopentensor:mainfrom
Conversation
Closes opentensor#2591. The `faucet()` dispatchable in `pallets/subtensor/src/macros/dispatches.rs` carries a docstring that states: /// Just deployed in testnet and devnet for testing purpose This is no longer accurate. The call is gated behind `#[cfg(feature = "pow-faucet")]`, and the `pow-faucet` feature is only enabled in the `local_builder` Docker stage (`Dockerfile` L86). The public testnet and devnet runtimes are built without that feature, so the dispatchable is genuinely absent from the on-chain `Call` enum on both networks. Downstream tooling that trusts the docstring builds a working PoW pipeline only to fail at submission time with a `pallet-call-not-found` error (the issue cites a concrete instance in `ErgodicLabs/btt` where the faucet command had to be reverted after the docstring sent reviewers in the wrong direction). Replaces the docstring with an accurate description of when the call is compiled in, and explicitly notes that the public testnet/devnet images do not include it. While here, remove the `if cfg!(feature = "pow-faucet") { ... } else { Err(FaucetDisabled) }` wrapper inside the function body: the function is already `#[cfg(feature = "pow-faucet")]` at the item level, so the `cfg!` check is unconditionally true and the `Err` arm is unreachable. `FaucetDisabled` remains defined in `Error<T>` for backward-compatible error handling (also referenced in a commented-out guard in `subnets/registration.rs`). No behavioral change: builds without `pow-faucet` are unaffected (the dispatchable does not exist in the `Call` enum); builds with the feature flag behave identically since the only reachable path was always `Self::do_faucet(...)`. The `pallet::call_index(60)` and weight attribute are preserved, so on-chain extrinsic compatibility is unchanged.
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.
Closes #2591.
Context
The
faucet()dispatchable inpallets/subtensor/src/macros/dispatches.rscarries this docstring:The last line is stale. The call is
#[cfg(feature = \"pow-faucet\")]-gated, and thepow-faucetfeature is only enabled in thelocal_builderDocker stage (DockerfileL86). The public testnet and devnet runtimes are built without it, so the dispatchable is absent from the on-chainCallenum on both networks (per the metadata evidence in #2591). Downstream tooling that trusts the docstring builds a working PoW pipeline only to fail at submission time with apallet-call-not-founderror.Changes
Docstring rewrite — replaces the stale last line with an explicit note that the call is only compiled into runtimes built with
--features pow-faucet, that the public testnet/devnet images do not include it, and that it is intended for local development runtimes.Dead-code removal inside the function body:
The function is already
#[cfg(feature = \"pow-faucet\")]at the item level, socfg!(feature = \"pow-faucet\")inside the body is unconditionally true and theErrarm is unreachable. Simplified to a directSelf::do_faucet(...)call.FaucetDisabledis left inError<T>for backward compatibility — it is also referenced by a commented-out guard insubnets/registration.rsand removing it could break downstream error-decoding clients.Behavioral impact
None. Builds without
pow-faucetdon't see the dispatchable; builds with it exercise the sameSelf::do_faucet(...)path that was always reached.#[pallet::call_index(60)]and the weight attribute are preserved, so on-chain extrinsic compatibility is unchanged.Out of scope
Option (b) from #2591 (enabling
pow-fauceton the testnet Docker build) is not addressed here — that's a policy call about whether the public testnet runtime should ship a dispatchable that mints TAO, and the filer explicitly said either fix is acceptable. Happy to follow up in a separate PR if maintainers want to restore the historicalbtcli wallet faucetUX against testnet.