Skip to content

Verify prev block root in the executor and not only in the importer #2961

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

Open
rymnc opened this issue Apr 21, 2025 · 0 comments
Open

Verify prev block root in the executor and not only in the importer #2961

rymnc opened this issue Apr 21, 2025 · 0 comments
Labels
tech-debt The issue is to improve the current code and make it more clear/generic/reusable/pretty/avoidable.

Comments

@rymnc
Copy link
Member

rymnc commented Apr 21, 2025

pub fn verify_block_fields(
&self,
consensus: &Consensus,
block: &Block,
) -> anyhow::Result<()> {
match consensus {
Consensus::Genesis(_) => {
let expected_genesis_height = self.config.block_height;
let expected_genesis_da_height = self.config.da_block_height;
verify_genesis_block_fields(
expected_genesis_height,
expected_genesis_da_height,
block.header(),
)
}
Consensus::PoA(_) => {
let view = self.view_provider.latest_view()?;
fuel_core_poa::verifier::verify_block_fields(&view, block)
}
_ => Err(anyhow::anyhow!("Unsupported consensus: {:?}", consensus)),
}
}

defines the verify_block_fields function that is ran whenever a block is imported by a validator/node. We want to include this verification in the executor as well.

@rymnc rymnc added the tech-debt The issue is to improve the current code and make it more clear/generic/reusable/pretty/avoidable. label Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt The issue is to improve the current code and make it more clear/generic/reusable/pretty/avoidable.
Projects
None yet
Development

No branches or pull requests

1 participant