erigontech / silkworm

C++ implementation of the Ethereum protocol
Apache License 2.0
277 stars 64 forks source link

capi: fork validator last_pre_validated_block #2363

Open battlmonstr opened 1 month ago

battlmonstr commented 1 month ago

silkworm_start_fork_validator C API creates an ExecutionEngine with a BodiesStageFactory that has last_pre_validated_block providing 0. It means that full body validation will be performed even for bodies that have preverified hashes compiled.

In silkworm these bodies are pre validated using these hashes at the time of ingestion via the engine/execution API. If this happens in erigon too, this value could perhaps be passed from erigon inside SilkwormForkValidatorSettings, and make the body stage faster for historical blocks.

battlmonstr commented 1 month ago

CC @JacekGlen