Verifies upgrade-gated post-execution rules against the supplied parent state. Authoritative implementation of all Base-specific post-execution checks that require access to parent state (currently: Isthmus' L2-to-L1 message-passer storage root). Callers supply `parent_state` explicitly so engine pipelines can pass in-memory-aware overlay providers when the parent block isn't canonical yet. To a
(
&self,
state_updates: &HashedPostState,
parent_state: DB,
header: H,
)
| 131 | /// To add a check for a future upgrade, extend the body with another |
| 132 | /// `if chain_spec.is_<X>_active_at_timestamp(...)` arm. |
| 133 | pub fn validate_block_post_execution_with_state<DB, H>( |
| 134 | &self, |
| 135 | state_updates: &HashedPostState, |
| 136 | parent_state: DB, |
| 137 | header: H, |
| 138 | ) -> Result<(), ConsensusError> |
| 139 | where |
| 140 | DB: StateProvider, |
| 141 | H: BlockHeader, |
| 142 | { |
| 143 | if !self.chain_spec().is_isthmus_active_at_timestamp(header.timestamp()) { |
| 144 | return Ok(()); |
| 145 | } |
| 146 | |
| 147 | let predeploy_storage_updates = state_updates |
| 148 | .storages |
| 149 | .get(&self.hashed_addr_l2tol1_msg_passer) |
| 150 | .cloned() |
| 151 | .unwrap_or_default(); |
| 152 | isthmus::verify_withdrawals_root_prehashed(predeploy_storage_updates, parent_state, header) |
| 153 | .map_err(|err| { |
| 154 | ConsensusError::Other(Arc::from(Box::<dyn core::error::Error + Send + Sync>::from( |
| 155 | format!("failed to verify block post-execution: {err}"), |
| 156 | ))) |
| 157 | }) |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | /// Extension trait that exposes [`BaseEngineValidator::validate_block_post_execution_with_state`] |