This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Session Delayed Para Changes / Actions Queue (#2406)
* initial implementation of lifecycles and upgrades * clean up a bit * fix doc comment * more rigid lifecycle checks * include paras which are transitioning, and lifecycle query * format guide * update api * update guide * explicit outgoing state, fix genesis * handle outgoing with transitioning paras * do not include transitioning paras in identifier * Update roadmap/implementers-guide/src/runtime/paras.md * Update roadmap/implementers-guide/src/runtime/paras.md * Update roadmap/implementers-guide/src/runtime/paras.md * Apply suggestions from code review * Use matches macro * Correct terms * Apply suggestions from code review * actions queue * Revert "actions queue" This reverts commit b2e9011. * collapse onboarding state * starting actions queue * consolidate actions queue * schedule para initialize result * more actions queue for upgrade/downgrade * clean up with fully implemented actions queue * fix tests * fix scheduler tests * fix hrmp tests * fix test * doc fixes * fix hrmp test w/ valid para * Update paras.md * fix paras registrar * Update propose_parachain.rs * fix merge * Introduce "shared" module * fix rococo build * fix up and use shared * guide updates * add shared config to common tests * add shared to test-runtime * remove println * fix note Co-authored-by: Gavin Wood <gavin@parity.io>
- Loading branch information
1 parent
10b0d79
commit afb6daa
Showing
20 changed files
with
656 additions
and
700 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Shared Module | ||
|
||
This module is responsible for managing shared storage and configuration for other modules. | ||
|
||
It is important that other pallets are able to use the Shared Module, so it should not have a | ||
dependency on any other modules in the Parachains Runtime. | ||
|
||
For the moment, it is used exclusively to track the current session index across the Parachains | ||
Runtime system, and when it should be allowed to schedule future changes to Paras or Configurations. | ||
|
||
## Constants | ||
|
||
```rust | ||
// `SESSION_DELAY` is used to delay any changes to Paras registration or configurations. | ||
// Wait until the session index is 2 larger then the current index to apply any changes, | ||
// which guarantees that at least one full session has passed before any changes are applied. | ||
pub(crate) const SESSION_DELAY: SessionIndex = 2; | ||
``` | ||
|
||
## Storage | ||
|
||
```rust | ||
// The current session index within the Parachains Runtime system. | ||
CurrentSessionIndex: SessionIndex; | ||
``` | ||
|
||
## Initialization | ||
|
||
The Shared Module currently has no initialization routines. | ||
|
||
The Shared Module is initialized directly after the Configuration module, but before all other | ||
modules. It is important to update the Shared Module before any other module since its state may be | ||
used within the logic of other modules, and it is important that the state is consistent across | ||
them. | ||
|
||
## Session Change | ||
|
||
During a session change, the Shared Module receives and stores the current Session Index for that | ||
block through the Session Change Notification. | ||
|
||
This information is used in the: | ||
|
||
* Configuration Module: For delaying updates to configurations until at lease one full session has | ||
passed. | ||
* Paras Module: For delaying updates to paras until at least one full session has passed. | ||
|
||
## Finalization | ||
|
||
The Shared Module currently has no finalization routines. | ||
|
||
## Functions | ||
|
||
* `scheduled_sessions() -> SessionIndex`: Return the next session index where updates to the | ||
Parachains Runtime system would be safe to apply. | ||
* `set_session_index(SessionIndex)`: For tests. Set the current session index in the Shared Module. |
Oops, something went wrong.