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

Issues creating RuntimeDispatchInfo type when using queryInfo #5218

Closed
4 of 10 tasks
TarikGul opened this issue Sep 14, 2022 · 4 comments · Fixed by #5221
Closed
4 of 10 tasks

Issues creating RuntimeDispatchInfo type when using queryInfo #5218

TarikGul opened this issue Sep 14, 2022 · 4 comments · Fixed by #5221

Comments

@TarikGul
Copy link
Member

TarikGul commented Sep 14, 2022

  • I'm submitting a ...
  • Bug report
  • Feature request
  • Support request
  • Other
  • What is the current behavior and expected behavior?

When using rpc.payment.queryInfo against certain blocks on westend there is the following decoding error:

RPC-CORE: queryInfo(extrinsic: Bytes, at?: BlockHash): RuntimeDispatchInfo:: createType(RuntimeDispatchInfo):: Struct: failed on weight: u64:: Assertion failed

Reproduction

const main = async () => {
    const api = await ApiPromise.create({
        provider: new WsProvider('wss://westend-rpc.polkadot.io'),
    });

    // Extrinsic is from block 12604391, blockhash is for block 12604390
    const extrinsic = '0x310284009ba31d1bca2c1123f67c012b86cceef3c8333fa2370a7e9f3ba7fe88b8600082009849e1cd980414a560e310bed2b2d82e9a4392eac0dc52245fd9fce31eef126c9a984511d1e0dec3f9b20b4846a12fe9d1ca47b4886c4316fe04d61bf656980e2b3e4d05000403002f833023f0254be1362a880c1e74bd1d2e1348b216201749b4f8d5191b1d17b400'
    const blockHash = '0xecc5770387f776b64a73f3614666a41fc325a81f3e029bc45fe684cc84103cf5';
    const result = await api.rpc.payment.queryInfo(extrinsic, blockHash);
    console.log('queryInfo: ', result.toJSON());

};

main().finally(() => process.exit());

This is happening on westend currently as far as I know, and here are some additional blocks:
12604449
12604804

  • What is the motivation for changing the behavior?
  • Please tell us about your environment:
  • Version:
    @polkadot/api@9.3.3

  • Environment:

    • Node.js v17.1
    • Browser
    • Other (limited support for other environments)
  • Language:

    • JavaScript (I reproduced in Typescript and Javascript)
    • TypeScript (include tsc --version) 4.8.2
    • Other
@niklasad1
Copy link

niklasad1 commented Sep 15, 2022

This is probably because the weight type in substrate was changed from u64 -> struct Weight { ref_time: u64 }

See paritytech/substrate#12138

@lcovar
Copy link

lcovar commented Sep 15, 2022

Any update? We're unable to continue indexing blocks due to this.

@jacogr
Copy link
Member

jacogr commented Sep 16, 2022

I am looking at solutions - these are deceptively tricky since RPCs are not fully-specified with metadata/types and needs tweaks on a version basis without breaking compat for all chains. Hopefully a solution will present itself before a point release over the weekend.

@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 Sep 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants