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

Unable to Decode Block with polkadot.js API v14.2.1, Works with v12.4.2 #11062

Open
asiniscalchi opened this issue Nov 5, 2024 · 0 comments
Open

Comments

@asiniscalchi
Copy link
Contributor

asiniscalchi commented Nov 5, 2024

I'm encountering an issue when decoding blocks on LAOS parachain using polkadot.js API version 14.2.1. Specifically, when attempting to decode block 54522, the API throws an error. However, using version 12.4.2, the block decodes properly without any issues.

Error Message:
createType(SignedBlock):: Struct: failed on block: {"header":"Header","extrinsics":"Vec<Extrinsic>"}:: Struct: failed on extrinsics: Vec<Extrinsic>:: createType(ExtrinsicV4):: createType(ExtrinsicSignatureV4):: decodeU8aStruct: failed at 0xb7469c43535c826e29c30d25a9f3a035… on signer (index 1/5): {"_enum":{"Id":"AccountId","Index":"Compact<AccountIndex>","Raw":"Bytes","Address32":"H256","Address20":"H160"}}:: Unable to create Enum via index 183, in Id, Index, Raw, Address32, Address20

Steps to Reproduce:

  1. Use polkadot.js API version 14.2.1 to connect to the parachain node.
  2. Attempt to query and decode block 54522.
  3. Observe the decoding error as shown above.

Expected Behavior:

The block should decode successfully, returning the block data without any errors—consistent with the behavior in polkadot.js API version 12.4.2.

Actual Behavior:

An error occurs during the decoding process when using polkadot.js API version 14.2.1, preventing access to the block data.

Additional Information:

  • The issue seems to be related to the transition to metadata v15 in API version 14.2.1.
  • Downgrading to polkadot.js API version 12.4.2 resolves the issue.
  • The error indicates a problem with decoding the signer field of an extrinsic's signature, specifically an issue with an enum index that doesn't match expected variants.

Environment:

  • polkadot.js API versions tested:
    • Failing: 14.2.1
    • Working: 12.4.2
  • Parachain Node RPC Endpoint: wss://rpc.laos.laosfoundation.io
  • Block Number: 54522
@asiniscalchi asiniscalchi changed the title Unable to Decode Block with polkadot.js API v13.*, Works with v12.4.2 Unable to Decode Block with polkadot.js API v14.2.1, Works with v12.4.2 Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant