fix: prevent recursion error with pallet_collective
metadata
#412
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
pop-cli
does not support extrinsics that take another call as a parameter (e.gUtility.batch
). Instead, when parsing the chain metadata, it returns aFunctionNotSupported
error for such extrinsics and notifies the user that the function is not supported:Bug
A bug was discovered when testing the Pop Network mainnet runtime (r0gue-io/pop-node#448), where metadata retrieval for the Council pallet (
pallet_collective
) caused a recursion error.The problem is because
pallet_collective
defines typeProposal = RuntimeCall;
(see) rather than referencingRuntimeCall
directly, as other pallets do (see).To Replicate:
It also can be tested in a live network (Mythos), that has a council governance.
Fix
A new check has been included when parsing metadata to properly identify
RuntimeCall
at any level within the namespace path. Instead of assuming a direct reference, the system now inspects all segments of the path to detect and handleRuntimeCall
correctly (link from scale-info library).Note
I've created a unit test for this issue using a live chain with the same implementation as the Pop Network mainnet. A
TODO
comment is included to update the test once the Pop Network goes live.[sc-2948]