You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of the BTCLI redesign, we would like to improve the user experience by providing relevant and meaningful error messages to the user. We should translate error codes from signed extensions from Subtensor into a meaningful message that is relevant for the user request.
Error code mappings
These error code mappings were provided by Nucleus team:
Custom Error Variants in Subtensor Signed Extension
This document describes the custom error variants used in the subtensor signed extension. The errors are presented to the user in the following format:
Description: The number of registrations for the current interval exceeds the maximum allowed for the given netuid. This applies to the register and burned_register calls.
Custom error: 7 Description: The account (who) is attempting a balance transfer (either transfer_allow_death, transfer_keep_alive, or transfer_all) while under arbitration.
The Subtensor signed extension contains the logic for handling incoming extrinsics before the enter the pool. When we handle these in the signed extension, substrate requires that we return a TransactionValidity which is defined as
Since the TransactionValidityError type is implemented by substrate Nucleus team are not able to implement any additional variants this way. This is the original reasoning behind returning the generic errors, like Nucleus do now, from the signed extension.
There exists a custom variant of the TransactionValidityError which takes a u8 which we can use to provide error codes to BTCLI / BTSDK.
The signed extension basically filters incoming extrinsics before they enter the transaction pool. After the extrinsics enter the pool they are executed. If the extrinsic fails during execution it will return an error from our errors.rs. If it is filtered before entering the pool it will return TransactionValidityError with an error code.
Subtensor related changes
Custom Errors for Signed Extensions (PR #700)
Technical Change: Added labels to signed extension errors.
Impact: Improved error handling and debugging capabilities.
Action Required: CLI team needs to implement decoding for these new error labels.
User-Facing: Yes
URL: opentensor/subtensor#700
The text was updated successfully, but these errors were encountered:
arslan-ot
changed the title
Meaningful error messages in BTCLI
Decode TransactionValidationError messages in BTCLI
Aug 8, 2024
arslan-ot
changed the title
Decode TransactionValidationError messages in BTCLI
Decode TransactionValidityError messages in BTCLI
Aug 8, 2024
arslan-ot
changed the title
Decode TransactionValidityError messages in BTCLI
Translate Subtensor signed extension error codes in BTCLI & BTSDK
Aug 12, 2024
Task
As part of the BTCLI redesign, we would like to improve the user experience by providing relevant and meaningful error messages to the user. We should translate error codes from signed extensions from Subtensor into a meaningful message that is relevant for the user request.
Error code mappings
These error code mappings were provided by Nucleus team:
Custom Error Variants in Subtensor Signed Extension
This document describes the custom error variants used in the subtensor signed extension. The errors are presented to the user in the following format:
{'code': 1010, 'message': 'Invalid Transaction', 'data': 'Custom error: [Error Code]'}
.Custom error: 1
Description: The account (
who
) attempting thecommit_weights
call does not meet the minimum stake requirement for weights.{'code': 1010, 'message': 'Invalid Transaction', 'data': 'Custom error: 1'}
Custom error: 2
Description: The account (
who
) attempting thereveal_weights
call does not meet the minimum stake requirement for weights.{'code': 1010, 'message': 'Invalid Transaction', 'data': 'Custom error: 2'}
Custom error: 3
Description: The account (
who
) attempting theset_weights
call does not meet the minimum stake requirement for weights.{'code': 1010, 'message': 'Invalid Transaction', 'data': 'Custom error: 3'}
Custom error: 4
Description: The hotkey account passed to the
set_root_weights
call does not meet the minimum stake requirement for weights.{'code': 1010, 'message': 'Invalid Transaction', 'data': 'Custom error: 4'}
Custom error: 5
Description: The number of registrations for the current interval exceeds the maximum allowed for the given
netuid
. This applies to theregister
andburned_register
calls.{'code': 1010, 'message': 'Invalid Transaction', 'data': 'Custom error: 5'}
6 & 7 no longer needed
These were related to the hack and coldkey arbitration which is no longer required.
Custom error: 6
Description: An account (
who
) under arbitration is attempting to calldissolve_network
.{'code': 1010, 'message': 'Invalid Transaction', 'data': 'Custom error: 6'}
Custom error: 7
Description: The account (
who
) is attempting a balance transfer (eithertransfer_allow_death
,transfer_keep_alive
, ortransfer_all
) while under arbitration.{'code': 1010, 'message': 'Invalid Transaction', 'data': 'Custom error: 7'}
Background
The Subtensor signed extension contains the logic for handling incoming extrinsics before the enter the pool. When we handle these in the signed extension, substrate requires that we return a TransactionValidity which is defined as
Since the TransactionValidityError type is implemented by substrate Nucleus team are not able to implement any additional variants this way. This is the original reasoning behind returning the generic errors, like Nucleus do now, from the signed extension.
There exists a custom variant of the TransactionValidityError which takes a u8 which we can use to provide error codes to BTCLI / BTSDK.
The signed extension basically filters incoming extrinsics before they enter the transaction pool. After the extrinsics enter the pool they are executed. If the extrinsic fails during execution it will return an error from our errors.rs. If it is filtered before entering the pool it will return TransactionValidityError with an error code.
Subtensor related changes
Custom Errors for Signed Extensions (PR #700)
Technical Change: Added labels to signed extension errors.
Impact: Improved error handling and debugging capabilities.
Action Required: CLI team needs to implement decoding for these new error labels.
User-Facing: Yes
URL: opentensor/subtensor#700
Related Discord discussions
https://discord.com/channels/799672011265015819/1263701469110992989
https://discord.com/channels/799672011265015819/1267904639748280381
The text was updated successfully, but these errors were encountered: