From a2444bedef510269b812657e76a8576b1e4c15f5 Mon Sep 17 00:00:00 2001 From: pinardZ Date: Sat, 20 Dec 2025 17:33:07 +0800 Subject: [PATCH] fix: Add system caller notification for post-block staking distribution state changes --- crates/evm/src/block/state_hook.rs | 2 ++ crates/evm/src/eth/block.rs | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/evm/src/block/state_hook.rs b/crates/evm/src/block/state_hook.rs index cd749799..13bc19fb 100644 --- a/crates/evm/src/block/state_hook.rs +++ b/crates/evm/src/block/state_hook.rs @@ -37,6 +37,8 @@ pub enum StateChangePostBlockSource { WithdrawalRequestsContract, /// EIP-7251 consolidation requests contract ConsolidationRequestsContract, + /// Staking distribution from block rewards and withdrawals + StakingDistribution, } impl OnStateHook for F diff --git a/crates/evm/src/eth/block.rs b/crates/evm/src/eth/block.rs index e1039c4b..c5ec9691 100644 --- a/crates/evm/src/eth/block.rs +++ b/crates/evm/src/eth/block.rs @@ -229,10 +229,16 @@ where Bytes::from(data), ) { Ok(res) => { + self.system_caller.on_state( + StateChangeSource::PostBlock( + StateChangePostBlockSource::StakingDistribution, + ), + &res.state, + ); self.evm.db_mut().commit(res.state); }, Err(e) => { - print!("execution failed: {e}"); + print!("failed to apply staking distribution: {e}"); } };