-
Notifications
You must be signed in to change notification settings - Fork 55
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
pallet-initializer new session is applied immediately #288
Merged
girazoki
merged 5 commits into
moondance-labs:master
from
fgamundi:fg-initializer-new-session
Oct 17, 2023
Merged
pallet-initializer new session is applied immediately #288
girazoki
merged 5 commits into
moondance-labs:master
from
fgamundi:fg-initializer-new-session
Oct 17, 2023
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
Oct 16, 2023
girazoki
approved these changes
Oct 17, 2023
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.
LGTM
tmpolaczyk
approved these changes
Oct 17, 2023
tmpolaczyk
added a commit
that referenced
this pull request
Oct 17, 2023
Because since #288 collator rotation is handled in on_initialize, and we can only read the relay randomness after the set_validation_data inherent, which happens after on_initialize. The solution is to read the randomness on the on_finalize hook of the previous block, store it in pallet_collator_assignment, and delete it when reading it.
tmpolaczyk
added a commit
that referenced
this pull request
Oct 19, 2023
* Add randomness to pallet-collator-assignment * Mock randomness inherent in tests * Do not shuffle collators if seed is 0 * Merge the functions to add and fill new container chains into one * Rotate collators according to config param * Use per-block randomness instead of per-epoch randomness * Dont check collator2002-01 dbpath Because a different collator may be assigned to container 2002 * Add zombie_tanssi_rotation test suite * Unit test collator assignment rotation * Fix integration test by killing storage value * Rename para-rotation suite to avoid moonwall bug * Increase zombienet test timeout * Mix subject with relay randomness, and fix bug all seeds starting with 1 There was a bug because we tried to read an Option<Hash> as a Hash, and this results in the first byte of the [u8; 32] being always 1, which is the marker for "Some" * Fix collators rotating 1 block too early * Add event CollatorAssignment::NewPendingAssignment * Fix tests after 1.1.0 upgrade * Make full_rotation_period configurable, defined in pallet_configuration * Use fast_or_prod macro to set full_rotation_period = 5 for tests * Store randomness from previous relay block in pallet storage Because since #288 collator rotation is handled in on_initialize, and we can only read the relay randomness after the set_validation_data inherent, which happens after on_initialize. The solution is to read the randomness on the on_finalize hook of the previous block, store it in pallet_collator_assignment, and delete it when reading it. * Change para-rotation test to rotate every 5 sessions instead of every 1 Rotating every session does not leave enough time for collators to detect their assignment, and some tests result in timeout * Rewrite migration using get_raw and put_raw * Rotation period of 0 disables rotation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Delaying the application of a new session until
on_finalize
was producing unwanted behavior. This changes it to be applied immediately onapply_new_session
, and removesBufferedSessionChange
as it was only used to temporarily save the session change untilon_finalize