polkadot-js / api

Promise and RxJS APIs around Polkadot and Substrate based chains via RPC calls. It is dynamically generated based on what the Substrate runtime provides in terms of metadata.
Apache License 2.0
1.07k stars 354 forks source link

api generate invalid tx on Basilisk #6036

Open xlc opened 5 days ago

xlc commented 5 days ago

I am investigating why this failed: https://github.com/open-web3-stack/polkadot-ecosystem-tests/actions/runs/11964539727/job/33357037908?pr=112

It is generating a signed tx with hex of 0x9902840088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0001a4c8b0e0e88d68b8e1a990e3bc0b539d95be71c071e27241e16b9217a27a000b88f67541243c434cb87a1e825a04926d60d286c8da706b3737c2657fa7f108450300009a00000000000080c6a47e8d0300000000000000000004010200411f0100d17c2d7823ebf260fd138f2d7e27d114c0145d968b5ff5006125f2414fadae6900, which pjs apps failed to decode it and runtime rejects it as invalid tx

This is a valid one generated from pjs apps: 0x95028488dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0001a4c8b0e0e88d68b8e1a990e3bc0b539d95be71c071e27241e16b9217a27a000b88f67541243c434cb87a1e825a04926d60d286c8da706b3737c2657fa7f108450300009a00000000000080c6a47e8d0300000000000000000004010200411f0100d17c2d7823ebf260fd138f2d7e27d114c0145d968b5ff5006125f2414fadae6900

The invalid one have a extra 00 after extrinsic version byte (84). No idea where it is coming from. And it only happens to Basilisk, not other parachains including hydration. Any ideas?

TarikGul commented 1 day ago

It is generating a signed tx with hex of 0x9902840088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0001a4c8b0e0e88d68b8e1a990e3bc0b539d95be71c071e27241e16b9217a27a000b88f67541243c434cb87a1e825a04926d60d286c8da706b3737c2657fa7f108450300009a00000000000080c6a47e8d0300000000000000000004010200411f0100d17c2d7823ebf260fd138f2d7e27d114c0145d968b5ff5006125f2414fadae6900, which pjs apps failed to decode it and runtime rejects it as invalid tx

How is this invalid tx being generated? Any snippet would be super helpful.

xlc commented 1 day ago

to reproduce:

and you should see the bad tx logged from https://github.com/open-web3-stack/polkadot-ecosystem-tests/blob/c963d6f2242dd197afc1f729cb7270f1c3658a00/packages/shared/src/xcm/runXtokenstHorizontal.ts#L45