Skip to content

Comments

Ensure rpc-core can correctly decode types, even if multiple types share the same name#6089

Merged
valentinfernandez1 merged 1 commit intopolkadot-js:masterfrom
martin-chainflip:mr-fix-decoding-with-duplicate-typenames
Oct 14, 2025
Merged

Ensure rpc-core can correctly decode types, even if multiple types share the same name#6089
valentinfernandez1 merged 1 commit intopolkadot-js:masterfrom
martin-chainflip:mr-fix-decoding-with-duplicate-typenames

Conversation

@martin-chainflip
Copy link
Contributor

Currently, rpc-core tries to decode the results of a storage query by using the type name. However, it is perfectly valid to have multiple, different types in the type registry that share the same name. In this case rpc-core will fail to decode. This change uses the unique type id for decoding if available instead.
This change fixes polkadot-js/apps#10432

… avoid issues with multiple types that share the same name
@TarikGul
Copy link
Member

TarikGul commented Feb 7, 2025

Hey thanks for the PR. Were you able to check in apps if it works?

The way you can link the api with your changes is by having apps share the same root directory as the api - and running yarn polkadot-dev-copy-to apps.

@TarikGul
Copy link
Member

TarikGul commented Feb 7, 2025

I checked this blockhash: 0xf7d516bd72ee1d76903e692157fc2a5260788faa6c9b6a369c3006b19413b6d2 given in the issue and still received the same decoding error as earlier with the applied changes above.

@martin-chainflip martin-chainflip marked this pull request as draft February 7, 2025 15:19
@martin-chainflip
Copy link
Contributor Author

you are correct. this only fixes the issue that storage items with the same type name could not be decoded. for calls/extrinsics, more work is needed.

@martin-chainflip
Copy link
Contributor Author

would it still be possible to merge this fix?

@TarikGul
Copy link
Member

cc: @ap211unitech @valentinfernandez1

@ap211unitech ap211unitech marked this pull request as ready for review September 10, 2025 13:32
@valentinfernandez1 valentinfernandez1 merged commit 0fe618e into polkadot-js:master Oct 14, 2025
4 checks passed
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Oct 16, 2025
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 this pull request may close these issues.

PolkaJS unable to decode valid block

5 participants