fix: calculate state root for auto-seal (#2744)

Co-authored-by: Roman Krasiuk <rokrassyuk@gmail.com>
This commit is contained in:
Dan Cline
2023-05-19 03:16:40 -04:00
committed by GitHub
parent e43b8aa92b
commit d9455d6bc2

View File

@ -200,6 +200,11 @@ where
BlockBody { transactions: body, ommers: vec![], withdrawals: None };
header.gas_used = gas_used;
// calculate the state root
let state_root =
executor.db().db.0.state_root(post_state.clone()).unwrap();
header.state_root = state_root;
storage.insert_new_block(header.clone(), body);
let new_hash = storage.best_hash;