Skip to content

docstring: pallets/subtensor/src/macros/dispatches.rs faucet() claims testnet deployment but is cfg-gated behind pow-faucet feature #2591

@moorkh

Description

@moorkh

Summary

pallets/subtensor/src/macros/dispatches.rs defines faucet() around lines 1256-1275 with a docstring that reads:

/// Facility extrinsic for user to get taken from faucet
/// It is only available when pow-faucet feature enabled
/// Just deployed in testnet and devnet for testing purpose

The docstring is stale. The call is gated behind #[cfg(feature = "pow-faucet")], and the feature is only enabled in the Docker local_builder stage. The deployed public testnet and devnet runtimes are built without it, so the faucet dispatchable is genuinely absent from the on-chain Call enum on both networks.

The line "Just deployed in testnet and devnet for testing purpose" actively misleads readers — any downstream tool that trusts the docstring will build a working PoW pipeline that then fails at submission time with a pallet-call-not-found error, not a helpful "wrong runtime" message.

Evidence

1. The cfg gate

pallets/subtensor/src/macros/dispatches.rs around line 1256:

/// Facility extrinsic for user to get taken from faucet
/// It is only available when pow-faucet feature enabled
/// Just deployed in testnet and devnet for testing purpose
#[pallet::call_index(60)]
#[pallet::weight((
    Weight::from_parts(91_000_000, 0)
        .saturating_add(T::DbWeight::get().reads(27))
        .saturating_add(T::DbWeight::get().writes(22)),
    DispatchClass::Normal,
    Pays::No
))]
#[cfg(feature = "pow-faucet")]
pub fn faucet(
    origin: OriginFor<T>,
    block_number: u64,
    nonce: u64,
    work: Vec<u8>,
) -> DispatchResult {
    Self::do_faucet(origin, block_number, nonce, work)
}

2. The Dockerfile only enables it in one stage

Dockerfile around line 86, local_builder stage:

RUN cargo build --workspace --profile release --features "pow-faucet"

No other cargo build in the Dockerfile passes --features pow-faucet. The subtensor production image therefore ships a runtime without the call.

3. Metadata dump proves the call is absent on deployed chains

On 2026-04-15, subxt metadata dumps were run against both public endpoints:

  • wss://test.finney.opentensor.ai:443 — no faucet / drip / tao dispatchable anywhere in the runtime metadata. A full cross-pallet scan for faucet|drip|tao returned only three unrelated AdminUtils::sudo_set_tao_flow_* parameter setters.
  • wss://dev.chain.opentensor.ai:443 — same result, no faucet dispatchable.

SubtensorModule (pallet 7) exposes 70+ calls on both chains (register, burned_register, root_register, add_stake, ...) but faucet is not among them on either network.

Proposed fixes

Either of the following would unstick downstream tooling. btt has no preference — either is fine from our perspective.

(a) Fix the docstring. Change the comment to accurately describe when the call is available, for example:

/// Facility extrinsic to acquire TAO from a proof-of-work faucet.
/// Only compiled into runtimes built with --features pow-faucet.
/// The production testnet and devnet images do NOT enable this feature;
/// it is only wired up in the Docker `local_builder` stage for local dev.

This costs nothing and prevents the next reader from hitting the same trap.

(b) Enable pow-faucet on the testnet build. Add --features pow-faucet to the testnet runtime's Docker build stage so the historical btcli / btt UX of "run the faucet command against testnet" works again on the real chain. This restores the workflow the docstring currently advertises.

Downstream impact

btt (https://github.com/ErgodicLabs/btt) merged a wallet faucet command in PR #66 on 2026-04-15 based on the upstream docstring and the btcli reference implementation. When the command was first exercised against wss://test.finney.opentensor.ai:443 hours later, it failed at extrinsic submission because the dispatchable does not exist on the deployed runtime. The command has now been removed from btt in ErgodicLabs/btt#80, with the local-only retarget tracked as a followup.

References

  • Gate: pallets/subtensor/src/macros/dispatches.rs ~L1256-L1275
  • Docker feature enable: Dockerfile ~L86 (local_builder stage)
  • Metadata absence: confirmed on wss://test.finney.opentensor.ai:443 and wss://dev.chain.opentensor.ai:443 on 2026-04-15

[cryptid]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions