Deprecate para_id Field from Chain Specification#7546
Deprecate para_id Field from Chain Specification#7546Stephenlawrence00 wants to merge 5 commits intoparitytech:masterfrom
para_id Field from Chain Specification#7546Conversation
|
User @Stephenlawrence00, please sign the CLA here. |
|
Hi @Stephenlawrence00 , just wondering if you're still interested in getting this ready for review. I glanced over the changes and thought you might find useful this info: #75 (comment). If you don't have time to still look into it, let us know. We're keen in assisting/owning the delivery of this in the next period. Let us know if you have questions! |
|
Thanks @iulianbarbu Still interested in getting this done. |
|
@Stephenlawrence00 if you have something to parallelise or I can pick up, let me know |
|
Hey @Stephenlawrence00 , how is going? I was wondering if you got a chance to continue the work. Feel free to reach out in case implementation details are not clear. For context, we want to have this functionality merged by mid of May so that it ends up in June release. FYI, the reviews and addressing them can take a few weeks, so IMO ideally we should kickstart the work this week/next week the latest. Does that sound doable on your end? |
|
Sounds good @iulianbarbu |
There was a problem hiding this comment.
I think this should be mostly it. Now I am wondering what's a good way to sunset parachain-info. @bkchr what are your thoughts?
LE: upsy, there is an issue for that: #2116. Based on it, I think we can start removing parachain info from our runtimes. What we need to double check though is if adding the para id in the runtimes' parameters is enough for downstream usage which might rely on the Get<ParaId> trait impl for Pallet<T> where T: Config.
LELE: once the above is done, we can start doing the actualy para_id field removal from chain specs, according to #7384
|
Getting rid of The runtime API should return the para id that is present in There we read the para_id from the chain_spec, which should not be the case anymore. |
|
Hey @Stephenlawrence00 ! Looks like we still need return the 'para_id' of the Separately, in addition to @skunert pointer to how to not use anymore the let para_id = client.runtime_api().id();. To be able to call GetParachainInfo::id() though you'd need to extend the NodeRuntimeApi here:
.
Once we have this, I think we should be good with deprecating this: . E.g. just add a #[deprecated] attribute, a comment that clarifies this is deprecated, and a link to a new issue which tracks its removal (for removal timeline, we can mention it will be removed in the next stable release, so by 25/09). Any objections on this deprecation notice @skunert ? |
Nope, makes sense to me. However, we should come up with a better name for the runtime api function than |
|
@Stephenlawrence00 Just checking in if you planning to continue with this. If not, we will internally find someone to work on this soon (end of week). |
|
Will have the changes in @skunert |
|
Would I need to add a test case in system chain runtimes? for instance #[test]
fn parachain_id_is_retrieved_from_runtime_api() {
ExtBuilder::<Runtime>::default()
.build()
.execute_with(|| {
// Get para_id from ParachainInfo pallet storage
let expected_para_id = parachain_info::Pallet::<Runtime>::parachain_id();
// Get para_id via runtime API
let actual_para_id = Runtime::parachain_id();
assert_eq!(
actual_para_id, expected_para_id,
"Runtime API para_id must match ParachainInfo storage"
);
});
}Don't think this tests much really cc: @skunert @iulianbarbu |
|
I agree, such test does not seem very useful |
What tests would you consider, regarding this pull request? @skunert |
|
Hey, thanks for driving this forward!
There is the As for testing, we have some tests that test the There it would be super easy to read the chain-spec, modify the In addition, we can have better test-coverage by removing the As a result, all chain-specs exported from |
|
Hey @Stephenlawrence00 , how is going? Was wondering how the testing goes. Once we'll get past that we'll have leeway to focus on the last bits, related to |
|
@iulianbarbu On it |
|
Hey @Stephenlawrence00 ! Hope you're well. We decided to take the work you started here and continue it with dedicated capacity internally. The continuation will be based on your work so that your effort is not lost. We will do this because we want to ship this sometime sooner, to align with the next release. You can push any in-flight work here and I'll try to consider it for a new PR I'll open based on the existing state of the branch. Hope this is understandable, and please don't hesistate to reach out if you want to contribute to other issues - hoppefully will mark better those that allow for a wider implementation/testing timespan. |
# Description Closes #7384 Closes #75 Closes #8692 Closes #8739 ## Integration Node developers, node operators & runtime developers will not need to generate chain specs that contain a `para_id` field starting with this PR, but they'll have to implement the `cumulus_primitives_core::GetParachainInfo` runtime API once they drop the `para_id` field, so that new nodes versions will be able to query the runtime for the parachain id. Starting with `2512` the nodes will not support anymore reading the parachain id from chain specs `para_id` field, so it will be mandatory for runtime to implement the `cumulus_primitives_core::GetParachainInfo` trait and be upgraded. ## Review Notes This PR is based on prior work here: #7546. It delivers the following: ### Deprecated `para_id` chain spec extension - nodes like `polkadot-omni-node`/`polkadot-parachain`) will still support running chainspecs with `para_id` extension for a while (until stable2512) - nodes like `test-parachain`/`parachain-template-node` are supporting only runtimes that implement the new runtime API. - `chain-spec-builder` will display that `para_id` is deprecated when calling `help`, or when using the flag. ### Additional cleanup/changes - fixed & renabled some omni-node/parachain-template-node tests from `polkadot-sdk-docs` & `templates/zombienet`, which rely on the newly added runtime API as wellI. Tests based on the `para_id` chain spec extension are not present anymore, since omni-node will favour taking the para id based on the runtime API if present. - removed the concept of running `minimal` with omni-node. I returned to an old idea of a few of us. At this moment we can't support it anymore with omni-node since we'd need to add `parachain_info` to `minimal-template-runtime`, which doesn't make much sense. - most of the parachains runtimes (hope I haven't missed any relevant) that run by using `polkadot-parachain/polkadot-omni-node/test-parachain/parachain-template-node` should fail to work with the previous nodes (that support them) after `stable2512`. Probably that will be caught in the CI if I missed them during this PR, but I doubt it. ## Reviewers request - if there are other nodes used to run parachains runtimes, this is a good moment to highlight them so that I can update them if needed in terms of picking up the `parachain_id` from the runtime. --------- Signed-off-by: Iulian Barbu <iulian.barbu@parity.io> Co-authored-by: Steven <stevenlawrence13e@gmail.com> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
# Description Closes #7384 Closes #75 Closes #8692 Closes #8739 ## Integration Node developers, node operators & runtime developers will not need to generate chain specs that contain a `para_id` field starting with this PR, but they'll have to implement the `cumulus_primitives_core::GetParachainInfo` runtime API once they drop the `para_id` field, so that new nodes versions will be able to query the runtime for the parachain id. Starting with `2512` the nodes will not support anymore reading the parachain id from chain specs `para_id` field, so it will be mandatory for runtime to implement the `cumulus_primitives_core::GetParachainInfo` trait and be upgraded. ## Review Notes This PR is based on prior work here: #7546. It delivers the following: ### Deprecated `para_id` chain spec extension - nodes like `polkadot-omni-node`/`polkadot-parachain`) will still support running chainspecs with `para_id` extension for a while (until stable2512) - nodes like `test-parachain`/`parachain-template-node` are supporting only runtimes that implement the new runtime API. - `chain-spec-builder` will display that `para_id` is deprecated when calling `help`, or when using the flag. ### Additional cleanup/changes - fixed & renabled some omni-node/parachain-template-node tests from `polkadot-sdk-docs` & `templates/zombienet`, which rely on the newly added runtime API as wellI. Tests based on the `para_id` chain spec extension are not present anymore, since omni-node will favour taking the para id based on the runtime API if present. - removed the concept of running `minimal` with omni-node. I returned to an old idea of a few of us. At this moment we can't support it anymore with omni-node since we'd need to add `parachain_info` to `minimal-template-runtime`, which doesn't make much sense. - most of the parachains runtimes (hope I haven't missed any relevant) that run by using `polkadot-parachain/polkadot-omni-node/test-parachain/parachain-template-node` should fail to work with the previous nodes (that support them) after `stable2512`. Probably that will be caught in the CI if I missed them during this PR, but I doubt it. ## Reviewers request - if there are other nodes used to run parachains runtimes, this is a good moment to highlight them so that I can update them if needed in terms of picking up the `parachain_id` from the runtime. --------- Signed-off-by: Iulian Barbu <iulian.barbu@parity.io> Co-authored-by: Steven <stevenlawrence13e@gmail.com> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
para_idfield from chain-specification #7384 and related Issues:GetParachainId#75Get rid offparachain-info#2116