Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add dispute_period and random_seed to SessionInfo #3227

Closed
rphmeier opened this issue Jun 13, 2021 · 2 comments · Fixed by #4547
Closed

Add dispute_period and random_seed to SessionInfo #3227

rphmeier opened this issue Jun 13, 2021 · 2 comments · Fixed by #4547
Labels
I8-refactor Code needs refactoring.

Comments

@rphmeier
Copy link
Contributor

rphmeier commented Jun 13, 2021

This will let us refactor the rolling session window based on dispute_period of the highest session, and change its uses in approval voting and the dispute coordinator to avoid hardcoded window sizes.

Alternatively, expose dispute_period by some other runtime API. However, the cleanest would be to use SessionInfo.

cc @ordian

@rphmeier rphmeier added the I8-refactor Code needs refactoring. label Jun 13, 2021
@ordian
Copy link
Member

ordian commented Jun 17, 2021

We could also add random_seed from initializer to SessionInfo, that would be useful #3270.

@rphmeier rphmeier changed the title Add dispute_period to SessionInfo Add dispute_period and random_seed to SessionInfo Jun 17, 2021
@rphmeier
Copy link
Contributor Author

rphmeier commented Jun 17, 2021

I also recommend a new type for SessionInfo within the session_info runtime module so that changes in primitives don't silently invalidate runtime storage. I expect an Into<primitives::SessionInfo> for runtime::session_info::SessionInfo> would make the implementation of the runtime API easy.

We also have to account for the changing of the return type of the runtime API. This should be done with runtime API versioning and the #[changed_in] attribute as documented here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I8-refactor Code needs refactoring.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants