Guides/EVM/Precompiles

Neuron

Reference for the deployed NeuronPrecompile.

View as Markdown
PropertyValue
Rust implementationNeuronPrecompile
Solidity interfaceINeuron
Address0x0000000000000000000000000000000000000804
StatusDeployed

Registers neurons, publishes serving endpoints, and submits weights. Every function is payable.

Functions

burnedRegister(uint16,bytes32)
registerLimit(uint16,bytes32,uint64)
serveAxon(uint16,uint32,uint128,uint16,uint8,uint8,uint8,uint8)
serveAxonTls(uint16,uint32,uint128,uint16,uint8,uint8,uint8,uint8,bytes)
servePrometheus(uint16,uint32,uint128,uint16,uint8)
setWeights(uint16,uint16[],uint16[],uint64)
commitWeights(uint16,bytes32)
revealWeights(uint16,uint16[],uint16[],uint16[],uint64)

Added weight operations

FunctionSource extrinsic
setMechanismWeightsSubtensorModule.set_mechanism_weights
batchSetWeightsSubtensorModule.batch_set_weights
commitMechanismWeightsSubtensorModule.commit_mechanism_weights
batchCommitWeightsSubtensorModule.batch_commit_weights
revealMechanismWeightsSubtensorModule.reveal_mechanism_weights
commitCrv3MechanismWeightsSubtensorModule.commit_crv3_mechanism_weights
batchRevealWeightsSubtensorModule.batch_reveal_weights
commitTimelockedWeightsSubtensorModule.commit_timelocked_weights
commitTimelockedMechanismWeightsSubtensorModule.commit_timelocked_mechanism_weights

Batch calls accept at most 16 outer items and at most 4,096 weight entries per inner array. Timelocked commits and registration work are bounded to 5,000 and 64 bytes respectively; none of these functions accepts SCALE-encoded runtime calls.

Added registration and key operations

FunctionSource extrinsic
registerSubtensorModule.register
rootRegisterSubtensorModule.root_register
swapHotkeySubtensorModule.swap_hotkey
swapHotkeyV2SubtensorModule.swap_hotkey_v2
setChildrenSubtensorModule.set_children
setIdentitySubtensorModule.set_identity
tryAssociateHotkeySubtensorModule.try_associate_hotkey
associateEvmKeySubtensorModule.associate_evm_key
announceColdkeySwapSubtensorModule.announce_coldkey_swap
executeAnnouncedColdkeySwapSubtensorModule.swap_coldkey_announced
disputeColdkeySwapSubtensorModule.dispute_coldkey_swap
clearColdkeySwapAnnouncementSubtensorModule.clear_coldkey_swap_announcement

Every added operation accepts a non-Root signed origin. The precompile dispatches the highest-level extrinsic as the mapped caller so runtime authorization remains in force. Root-only and deprecated compatibility calls are classified in the coverage audit.

Typed state views

getUid(uint16,bytes32)
isNetworkMember(bytes32,uint16)
getWeights(uint16,uint16)
getBonds(uint16,uint16)
getBlockAtRegistration(uint16,uint16)
getNeuronCertificate(uint16,bytes32)
getPrometheus(uint16,bytes32)
getChainIdentity(bytes32)
getSubnetIdentity(uint16)
getLoadedEmission(uint16)
getTransactionKeyLastBlock(bytes32,uint16,uint16)
getLegacyTransactionRateBlocks(bytes32)
getWeightCommitCount(uint16,bytes32)
getWeightCommit(uint16,bytes32,uint32)
getTimelockedWeightCommitCount(uint16,uint64)
getTimelockedWeightCommit(uint16,uint64,uint32)
getLegacyTimelockedWeightCommitCount(uint8,uint16,uint64)
getLegacyTimelockedWeightCommit(uint8,uint16,uint64,uint32)

The indexed commit readers expose stable metadata. Timelocked ciphertext is represented by its Keccak-256 hash and byte length instead of returning the runtime's encrypted payload type.

Proposed bulk runtime API

NeuronInfoRuntimeApi.get_neurons remains proposed. Its current result can grow with subnet size, so no Solidity selector is assigned in this change. Before implementation, it needs a bounded cursor-based or indexed interface with a stable typed result. Existing single-neuron and per-field views remain available through the deployed Neuron and Metagraph precompiles.

Source: neuron.sol