Skip to content

Commit

Permalink
Fix BAD Block when syncing to Baklava
Browse files Browse the repository at this point in the history
Geth runs statedb.IntermediateRoot() after each tx. And it seems
we should do the same after running the Randomness (which is done
before the tx).

This seems to modify statedb and the state root. If we don't do that
we had an error with block 500 & 971 with invalidad stateRoot.
  • Loading branch information
Mariano Cortesi committed Jan 31, 2020
1 parent 8521e13 commit 9dcb899
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
if err != nil {
return nil, nil, 0, err
}
statedb.IntermediateRoot(p.config.IsEIP158(header.Number))
}
// Iterate over and process the individual transactions
for i, tx := range block.Transactions() {
Expand Down

0 comments on commit 9dcb899

Please sign in to comment.