mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(executor): call hook with state changes after post block balance increments (#13050)
This commit is contained in:
@ -10,8 +10,9 @@ use reth_chainspec::EthereumHardforks;
|
||||
use reth_consensus::ConsensusError;
|
||||
use reth_evm::{
|
||||
execute::{
|
||||
BasicBlockExecutorProvider, BlockExecutionError, BlockExecutionStrategy,
|
||||
BlockExecutionStrategyFactory, BlockValidationError, ExecuteOutput, ProviderError,
|
||||
balance_increment_state, BasicBlockExecutorProvider, BlockExecutionError,
|
||||
BlockExecutionStrategy, BlockExecutionStrategyFactory, BlockValidationError, ExecuteOutput,
|
||||
ProviderError,
|
||||
},
|
||||
state_change::post_block_balance_increments,
|
||||
system_calls::{OnStateHook, SystemCaller},
|
||||
@ -260,8 +261,11 @@ where
|
||||
post_block_balance_increments(&self.chain_spec.clone(), block, total_difficulty);
|
||||
// increment balances
|
||||
self.state
|
||||
.increment_balances(balance_increments)
|
||||
.increment_balances(balance_increments.clone())
|
||||
.map_err(|_| BlockValidationError::IncrementBalanceFailed)?;
|
||||
// call state hook with changes due to balance increments.
|
||||
let balance_state = balance_increment_state(&balance_increments, &mut self.state)?;
|
||||
self.system_caller.on_state(&balance_state);
|
||||
|
||||
Ok(Requests::default())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user