Skip to content
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

sync: update stage bodies validation rules #2347

Open
battlmonstr opened this issue Sep 12, 2024 · 0 comments
Open

sync: update stage bodies validation rules #2347

battlmonstr opened this issue Sep 12, 2024 · 0 comments
Labels
bug Something isn't working pos sync Syncing PoS beacon chain

Comments

@battlmonstr
Copy link
Contributor

battlmonstr commented Sep 12, 2024

BodiesStage was meant to check rule_set_->pre_validate_block_body to perform a "full body validation", but for optimization reasons the root hash checks were skipped, because they are expensive and are already done in https://github.com/erigontech/silkworm/blob/master/silkworm/sync/internals/body_sequence.cpp#L70-L71 . The remaining checks were performed (pre_validate_transactions, validate_ommers).

Since then pre_validate_block_body has grown to include more checks (block.withdrawals, header.withdrawals_root, blob_gas_used).

We need to ensure that these checks are performed either at the time of block consumption in sync, or in BodiesStage.
It would be nice to refactor the code in such a way that future updates to the rules are automatically applied in the BodiesStage.

Note: a header corresponding to the body is not available in sync, but becomes available in the stage.

@battlmonstr battlmonstr added bug Something isn't working pos sync Syncing PoS beacon chain labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pos sync Syncing PoS beacon chain
Projects
None yet
Development

No branches or pull requests

1 participant