Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

outdated bittensor app-config #11001

Closed
1 of 4 tasks
alpay-falconx opened this issue Oct 11, 2024 · 5 comments · Fixed by #11008
Closed
1 of 4 tasks

outdated bittensor app-config #11001

alpay-falconx opened this issue Oct 11, 2024 · 5 comments · Fixed by #11008
Labels
Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance.

Comments

@alpay-falconx
Copy link

alpay-falconx commented Oct 11, 2024

The app-config for the bittensor spec seems to be outdated so this issue is being opened for a updated version to be added.

  • Bug report
  • Feature request
  • Support request
  • Other

When using the bittensor spec in a typesBundle used to run the substrate sidecar, the sidecar is not able to decode (all) blocks from the subtensor network - some blocks can be decoded without any typesBundle. The expected behavior is that when the spec is used for the typesBundle in the sidecar config, the sidecar application is able to decode blocks from the node RPC.

The types bundle would like the following based on the current spec in app-config:

{
  "spec": {
    "subtensor": {
      "types": [
        {
          "minmax": [0, null],
          "types": {
            "Balance": "u64",
            "NeuronMetadata": {
              "version": "u32",
              "ip": "u128",
              "port": "u16",
              "ipType": "u8",
              "uid": "u32",
              "netuid": "u16",
              "modality": "u8",
              "hotkey": "AccountId",
              "coldkey": "AccountId",
              "active": "u32",
              "lastUpdate": "u64",
              "priority": "u64",
              "stake": "u64",
              "rank": "u64",
              "trust": "u64",
              "consensus": "u64",
              "incentive": "u64",
              "dividends": "u64",
              "emission": "u64",
              "bonds": "Vec<(u32, u64)>",
              "weights": "Vec<(u32, u32)>"
            }
          }
        }
      ]
    }
  }
}

Updating the bittensor spec will allow custodial service providers to run subtensor nodes, retrieve block data from the sidecar via REST APIs and index the chain which will enable custodial/multi-sig wallet support for the tao asset.

Relevant links:

@piggydoughnut piggydoughnut added the Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance. label Oct 14, 2024
@TarikGul
Copy link
Member

The following PR is up which resolves this issue! Should be released tomorrow

@alpay-falconx
Copy link
Author

@TarikGul When I used this typesBundle in a sidecar, decoding a block fails if it contains extrinsics with balances and/or subtensorModule pallet events.

Example error

{
"code": 500,
"message": "createType(SignedBlock):: Struct: failed on block: {\"header\":\"Header\",\"extrinsics\":\"Vec<Extrinsic>\"}:: Struct: failed on extrinsics: Vec<Extrinsic>:: createType(ExtrinsicV4):: createType(Call):: Call: failed decoding system.killStorage:: Struct: failed on args: {\"keys\":\"Vec<Bytes>\"}:: decodeU8aStruct: failed at 0x0300801927120516e378941811b605fe… on keys (index 1/1): Vec<Bytes>:: Vec length 655982592 exceeds 65536",
"stack": "Error: createType(SignedBlock):: Struct: failed on block: {\"header\":\"Header\",\"extrinsics\":\"Vec<Extrinsic>\"}:: Struct: failed on extrinsics: Vec<Extrinsic>:: createType(ExtrinsicV4):: createType(Call):: Call: failed decoding system.killStorage:: Struct: failed on args: {\"keys\":\"Vec<Bytes>\"}:: decodeU8aStruct: failed at 0x0300801927120516e378941811b605fe… on keys (index 1/1): Vec<Bytes>:: Vec length 655982592 exceeds 65536\n    at createTypeUnsafe (/usr/src/app/node_modules/@polkadot/types-create/cjs/create/type.js:54:22)\n    at TypeRegistry.createTypeUnsafe (/usr/src/app/node_modules/@polkadot/types/cjs/create/registry.js:230:52)\n    at RpcCore._formatOutput (/usr/src/app/node_modules/@polkadot/rpc-core/cjs/bundle.js:331:25)\n    at RpcCore._formatResult (/usr/src/app/node_modules/@polkadot/rpc-core/cjs/bundle.js:169:20)\n    at callWithRegistry (/usr/src/app/node_modules/@polkadot/rpc-core/cjs/bundle.js:190:25)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
"level": "error"
}

@TarikGul
Copy link
Member

@TarikGul When I used this typesBundle in a sidecar, decoding a block fails if it contains extrinsics with balances and/or subtensorModule pallet events.

Example error

{
"code": 500,
"message": "createType(SignedBlock):: Struct: failed on block: {\"header\":\"Header\",\"extrinsics\":\"Vec<Extrinsic>\"}:: Struct: failed on extrinsics: Vec<Extrinsic>:: createType(ExtrinsicV4):: createType(Call):: Call: failed decoding system.killStorage:: Struct: failed on args: {\"keys\":\"Vec<Bytes>\"}:: decodeU8aStruct: failed at 0x0300801927120516e378941811b605fe… on keys (index 1/1): Vec<Bytes>:: Vec length 655982592 exceeds 65536",
"stack": "Error: createType(SignedBlock):: Struct: failed on block: {\"header\":\"Header\",\"extrinsics\":\"Vec<Extrinsic>\"}:: Struct: failed on extrinsics: Vec<Extrinsic>:: createType(ExtrinsicV4):: createType(Call):: Call: failed decoding system.killStorage:: Struct: failed on args: {\"keys\":\"Vec<Bytes>\"}:: decodeU8aStruct: failed at 0x0300801927120516e378941811b605fe… on keys (index 1/1): Vec<Bytes>:: Vec length 655982592 exceeds 65536\n    at createTypeUnsafe (/usr/src/app/node_modules/@polkadot/types-create/cjs/create/type.js:54:22)\n    at TypeRegistry.createTypeUnsafe (/usr/src/app/node_modules/@polkadot/types/cjs/create/registry.js:230:52)\n    at RpcCore._formatOutput (/usr/src/app/node_modules/@polkadot/rpc-core/cjs/bundle.js:331:25)\n    at RpcCore._formatResult (/usr/src/app/node_modules/@polkadot/rpc-core/cjs/bundle.js:169:20)\n    at callWithRegistry (/usr/src/app/node_modules/@polkadot/rpc-core/cjs/bundle.js:190:25)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
"level": "error"
}

Can you create an issue in sidecar then, with a reproducible example using sidecar?

@alpay-falconx
Copy link
Author

Created issue paritytech/substrate-api-sidecar#1513

@polkadot-js-bot
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants