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

What inherent checking does the Verifier actually do? #287

@JoshOrndorff

Description

@JoshOrndorff

My question is about this code

let inherent_data = self
.inherent_data_providers
.create_inherent_data()
.map_err(|e| e.into_string())?;
let block = Block::new(header.clone(), inner_body);
let inherent_res = self
.client
.runtime_api()
.check_inherents(
&BlockId::Hash(*header.parent_hash()),
block.clone(),
inherent_data,
)
.map_err(|e| format!("{:?}", e))?;
if !inherent_res.ok() {
inherent_res.into_errors().try_for_each(|(i, e)| {
Err(self.inherent_data_providers.error_to_string(&i, &e))
})?;
}

The Verifier requires inherent data providers. When importing a block it seems to reconstruct the inherent data and confirm that it matches the block? Is that right?

Even if my explanation is right, I'm still confused. The rococo collator inserts a timestamp, but the timestamp inherent data provider is not even part of what is passed to the Verifier. We're running into a similar confusion about our author inherent that includes the address of the block author.

So I guess my questions are:

  1. Can you give an example of an inherent that would make sense to check in the Verifier?
  2. Can we remove that requirement for the Verifier to take inherent data providers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions