-
Notifications
You must be signed in to change notification settings - Fork 371
Introduce CollectCollationInfo runtime api
#443
Conversation
Instead of using well known keys to communicate information about a collation between the runtime and the collator, we now use a runtime api for this.
pepyakin
left a comment
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. I really love this change.
A couple of nits and typos.
| sp_api::decl_runtime_apis! { | ||
| /// Runtime api to collect information about a collation. | ||
| pub trait CollectCollationInfo { | ||
| /// Collect information about a collation. |
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.
Can we write a proper docs on this? I.e. what's is expected from the implementer? When this is supposed to be called? etc
Can push to a follow up as well
| ValidationResult { | ||
| head_data, | ||
| new_validation_code, | ||
| new_validation_code: new_validation_code.map(Into::into), |
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.
What's are the types that particupate in this conversion? Is it convenient to switch to Type::from here?
pallets/parachain-system/src/lib.rs
Outdated
|
|
||
| /// New validation code that was set in a block. | ||
| /// | ||
| /// This will be cleared in `on_initialize` of each new block. |
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.
It's not so simple here due to the DidSetValidationCode check.
Co-authored-by: Sergei Shulepov <[email protected]>
* Introduce `CollectCollationInfo` runtime api Instead of using well known keys to communicate information about a collation between the runtime and the collator, we now use a runtime api for this. * Fixes bug * Apply suggestions from code review Co-authored-by: Sergei Shulepov <[email protected]> * Doc update Co-authored-by: Sergei Shulepov <[email protected]>
Instead of using well known keys to communicate information about a
collation between the runtime and the collator, we now use a runtime api
for this.
Fixes: #344