-
Notifications
You must be signed in to change notification settings - Fork 53
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
Starlight: Wire ContainerRegistrar
and Registrar
pallets
#653
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmpolaczyk
reviewed
Aug 21, 2024
Agusrodri
added
B7-runtimenoteworthy
Changes should be noted in any runtime-upgrade release notes
breaking
Needs to be mentioned in breaking changes
D5-nicetohaveaudit⚠️
PR contains trivial changes to logic that should be properly reviewed.
labels
Aug 22, 2024
Agusrodri
commented
Aug 23, 2024
tmpolaczyk
reviewed
Aug 23, 2024
girazoki
reviewed
Aug 30, 2024
girazoki
reviewed
Aug 30, 2024
girazoki
reviewed
Aug 30, 2024
girazoki
reviewed
Aug 30, 2024
girazoki
reviewed
Aug 30, 2024
girazoki
reviewed
Aug 30, 2024
solo-chains/runtime/starlight/src/tests/core_scheduling_tests.rs
Outdated
Show resolved
Hide resolved
girazoki
approved these changes
Sep 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job @Agusrodri
tmpolaczyk
reviewed
Sep 3, 2024
tmpolaczyk
reviewed
Sep 3, 2024
tmpolaczyk
reviewed
Sep 3, 2024
tmpolaczyk
reviewed
Sep 3, 2024
tmpolaczyk
approved these changes
Sep 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
B7-runtimenoteworthy
Changes should be noted in any runtime-upgrade release notes
breaking
Needs to be mentioned in breaking changes
D5-nicetohaveaudit⚠️
PR contains trivial changes to logic that should be properly reviewed.
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.
What does it do?
This PR combines the way in which
ContainerRegistrar
andRegistrar
pallets work together inside thestarlight
runtime.It does so by introducing a new config type to the
ContainerRegistrar
pallet calledInnerRegistrar
, which acts as a callback that executes different behaviors depending on the function context we are situating on.For instance:
ContainerRegistrar::register()
, theInnerRegistrar
internally callsRegistrar::register()
after performing the necessary checks and building the proper components (HeadData
andValidationCode
).ContainerRegistrar::deregister()
, theInnerRegistrar
takes care of also deregistering theparaId
insideRegistrar
pallet.ContainerRegistrar::mark_valid_for_collating()
, theInnerRegistrar
automatically upgrades theparaId
to a parachain (in case it was a parathread) at the end of the function execution.Other changes
head_data
parameter toContainerRegistrar::register
function and related ones that is used at the moment of registering a paraId inRegistrar
relay pallet.Note for reviewers
There are a lot of changes in different tests, but the most important are the ones related to starlight itself (inisde
solo-chains/runtime/starlight/src/tests
).The rest of the test changes are mostly to adapt to the new
head_data
parameter insideContainerRegistrar::register
and related functions.