Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Runtime-exporter crashes on startup "TypeError: weight.normal.toNumber is not a function" #35

Open
PierreBesson opened this issue Sep 16, 2022 · 4 comments

Comments

@PierreBesson
Copy link
Contributor

The runtime-exporter crashes on startup with the following error:

 debug: no historical parachain settings for chain wss://westmint-rpc.polkadot.io config.json
runtime-exporter-polkadot-runtime-exporter-0 runtime-exporter [22-09-16 14:21:08] debug: error from main function Error: query.timestamp.now is not available in this version of the metadata
runtime-exporter-polkadot-runtime-exporter-0 runtime-exporter /usr/src/polkadot-prom-exporter/build/workers/systemWorker.js:181
runtime-exporter-polkadot-runtime-exporter-0 runtime-exporter             yield exporter.writeWeight(timestamp, chainName.toString(), weight.normal.toNumber(), 'normal', exporter.withProm);
runtime-exporter-polkadot-runtime-exporter-0 runtime-exporter                                                                                       ^
runtime-exporter-polkadot-runtime-exporter-0 runtime-exporter 
runtime-exporter-polkadot-runtime-exporter-0 runtime-exporter TypeError: weight.normal.toNumber is not a function
runtime-exporter-polkadot-runtime-exporter-0 runtime-exporter     at SystemExporter.<anonymous> (/usr/src/polkadot-prom-exporter/build/workers/systemWorker.js:181:87)
runtime-exporter-polkadot-runtime-exporter-0 runtime-exporter     at Generator.next (<anonymous>)
runtime-exporter-polkadot-runtime-exporter-0 runtime-exporter     at fulfilled (/usr/src/polkadot-prom-exporter/build/workers/systemWorker.js:28:58)
runtime-exporter-polkadot-runtime-exporter-0 runtime-exporter     at processTicksAndRejections (node:internal/process/task_queues:96:5)
- runtime-exporter-polkadot-runtime-exporter-0 › runtime-exporter

Config:

{
  "rpcs": [
    // Westend + Parachains
    "wss://westend-rpc.polkadot.io",
    "wss://westmint-rpc.polkadot.io",
    "wss://westend-collectives-rpc.polkadot.io",
    //Rococo + Parachains
    "wss://rococo-rpc.polkadot.io",
    "wss://rococo-statemint-rpc.polkadot.io",
    "wss://rococo-contracts-rpc.polkadot.io",
    "wss://rococo.api.encointer.org",
    "wss://rpc.composablefinance.ninja",
    "wss://nodle-paradis.api.onfinality.io/public-ws",
    "wss://rococo-rpc.snowbridge.network",
    "wss://rpc-01.basilisk-rococo.hydradx.io"
  ],
  "history": [
    {
        "chain": "wss://rococo-rpc.polkadot.io",
        "startingBlock": 11000000,
        "endingBlock": 10000000,
        "pallets": "",
        "distanceBetweenBlocks": []
    },
    {
        "chain": "wss://westend-rpc.polkadot.io",
        "startingBlock": 11000000,
        "endingBlock": 10000000,
        "pallets": "",
        "distanceBetweenBlocks": []
    }
  ]
}
@kianenigma
Copy link
Collaborator

this is due to the new weight update into a struct rather than a plain number.

paritytech/substrate#10918 (comment)
https://forum.polkadot.network/t/weight-v2-discussion-and-updates/227

gilles437 added a commit that referenced this issue Sep 19, 2022
@PierreBesson
Copy link
Contributor Author

This is now happening when connecting to Statemint RPC:


[22-10-18 12:30:44] info: connecting wss://rpc.polkadot.io to pallet nominationPools
[22-10-18 12:30:44] info: registering nominationPools exporter for chain Polkadot
[22-10-18 12:30:44] info: connecting to chain wss://statemint-rpc.polkadot.io
/usr/src/polkadot-prom-exporter/build/workers/systemWorker.js:181
            yield exporter.writeWeight(timestamp, chainName.toString(), weight.normal.toNumber(), 'normal', exporter.withProm);
                                                                                      ^

TypeError: weight.normal.toNumber is not a function
    at SystemExporter.<anonymous> (/usr/src/polkadot-prom-exporter/build/workers/systemWorker.js:181:87)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/src/polkadot-prom-exporter/build/workers/systemWorker.js:28:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at runNextTicks (node:internal/process/task_queues:65:3)
    at processImmediate (node:internal/timers:437:9)

@gilles437
Copy link
Contributor

There is a fix for that with PR35, going to merge it

@kianenigma
Copy link
Collaborator

I don't see a PR 35, is it created yet?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants