omni-node: add metadata checks for runtime/parachain compatibility #6450
+67
−18
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.
Description
Get runtime's metadata, parse it and verify pallets list for a pallet named
ParachainSystem
(for now). Ideally we'll add others pallets checks too, at least a small set of pallets we think right away as mandatory for parachain compatibility.Closes: #5565
Integration
Runtime devs must be made aware that to be fully compatible with Omni Node, certain naming conventions should be respected when defining pallets (e.g we verify parachain-system pallet existence by searching for a pallet with
name
ParachainSystem
in runtime's metadata). Not finding such a pallet will not influence the functionality yet, but by doing these checks we could provide useful feedback for runtimes that are clearly not implementing what's required for full parachain compatibility with Omni Node.Review Notes
frame_metadata::RuntimeMetadataPrefixed
), obtained from an opaque bytes array. The logic could reside inframe_metadata
, attached toRuntimeMetadataPrefixed
type. I'll consider better ways of encapsulating the logic after clarifying the other metadata checks we could add in this PR.