You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Performance: we're executing the block twice when we only need to do it once
Cosistency: As we never check the contents of the block we finalize and seal we don't actually know if its valid. See Gas mismatch on Hoodi #17363 for a practical example if the implications of this.
I think the reason for this double execution is the fact that
Once we have finished the BAL & Parallel execution development we can extract this so it can be called directly from block building. Once we have done this we can just call Apply and then compute the state trie.
Note we will also need to call post execution validation to ensure we have a valid block before publishing as we do in the execution flow:
At the moment
SpawnMiningExecStageexecutes all transactions twice:Once when it initially builds the block here:
erigon/execution/stagedsync/stage_mining_exec.go
Line 135 in 2604257
and a second time when it has a complete block here:
erigon/execution/stagedsync/stage_mining_exec.go
Line 244 in 2604257
This has 2 unfortunate side effects:
I think the reason for this double execution is the fact that
erigon/execution/state/rw_v3.go
Line 182 in 2604257
erigon/execution/stagedsync/exec3.go
Line 122 in 2604257
Once we have finished the BAL & Parallel execution development we can extract this so it can be called directly from block building. Once we have done this we can just call Apply and then compute the state trie.
Note we will also need to call post execution validation to ensure we have a valid block before publishing as we do in the execution flow:
erigon/execution/stagedsync/exec3_serial.go
Line 442 in 2604257