-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Session Delayed Para Changes / Actions Queue #2406
Conversation
This reverts commit b2e9011.
This should not close #2300 unless it does something similar for |
I am happy to update for Probably best to do it in a follow up PR unless you want me to make this PR larger. |
One issue with this PR as it currently stands is that it is possible that a parachain cannot be queued to be offboarded. It is possible to imagine that some combinations of states could be used to grief the parachains system and prevent an offboarding. That being said, we will always return the result of trying to schedule offboarding, so it can always be handled, but maybe we need to create a more low level API to make sure that a parachain will be offboarded in the future. |
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.
Looks good to me! Thanks for the cleanup of tests and addition of Shared
module
) { | ||
<paras::Module<T>>::schedule_para_initialize(id, genesis); | ||
) -> Result<(), ()> { | ||
<paras::Module<T>>::schedule_para_initialize(id, genesis).map_err(|_| ()) |
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.
An API nit. When you want to do swapping I assume you'd call onboard()
on one and offboard()
on the other. The first might succeed and the second might fail. You could either have some kind of atomic updating API where you update multiple paras at once or you just expose the can_*
functions here. Something for a follow-up?
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.
ack, will follow up in another PR and with more consideration specifically with the swap integration in registrar
@@ -309,7 +308,7 @@ mod tests { | |||
parameter_types! { | |||
pub const BlockHashCount: u32 = 250; | |||
pub BlockWeights: limits::BlockWeights = | |||
limits::BlockWeights::with_sensible_defaults(4 * 1024 * 1024, NORMAL_RATIO); | |||
frame_system::limits::BlockWeights::simple_max(1024); |
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.
Just wondering: what was the motivation here?
Fixes: #2300
Design Notes: https://hackmd.io/XDkKzaYMSYumhNWzRMEvCQ
This PR introduces a full session delay to any changes to parachains and parathreads in the para module and any changes to the parachains runtime configuration.
Changes:
ActionQueue
which tracks all paras that need to be updated at the start of a specific session.ActionQueue
is a map fromSessionIndex -> Vec<ParaId>
so we can schedule the change of a para for a future session.current_session + 2
session index in the future, solving the problem in issue 2300.