Builds transaction result from cached receipt and state data.
(
&mut self,
transaction: Recovered<BaseTxEnvelope>,
cached_execution: CachedTransactionExecution,
idx: usize,
effective_gas_price: u128,
)
| 206 | |
| 207 | /// Builds transaction result from cached receipt and state data. |
| 208 | fn execute_with_cached_data( |
| 209 | &mut self, |
| 210 | transaction: Recovered<BaseTxEnvelope>, |
| 211 | cached_execution: CachedTransactionExecution, |
| 212 | idx: usize, |
| 213 | effective_gas_price: u128, |
| 214 | ) -> Result<ExecutedPendingTransaction, StateProcessorError> { |
| 215 | let CachedTransactionExecution { receipt, state, result, execution_time_us } = |
| 216 | cached_execution; |
| 217 | |
| 218 | let (deposit_receipt_version, deposit_nonce) = if transaction.is_deposit() { |
| 219 | let BaseReceipt::Deposit(deposit_receipt) = &receipt.inner.inner.receipt else { |
| 220 | return Err(ExecutionError::DepositReceiptMismatch.into()); |
| 221 | }; |
| 222 | |
| 223 | (deposit_receipt.deposit_receipt_version, deposit_receipt.deposit_nonce) |
| 224 | } else { |
| 225 | (None, None) |
| 226 | }; |
| 227 | |
| 228 | let rpc_transaction = Transaction { |
| 229 | inner: alloy_rpc_types_eth::Transaction { |
| 230 | inner: transaction, |
| 231 | block_hash: None, |
| 232 | block_number: Some(self.pending_block.number), |
| 233 | block_timestamp: Some(self.pending_block.timestamp), |
| 234 | transaction_index: Some(idx as u64), |
| 235 | effective_gas_price: Some(effective_gas_price), |
| 236 | }, |
| 237 | deposit_nonce, |
| 238 | deposit_receipt_version, |
| 239 | }; |
| 240 | |
| 241 | self.cumulative_gas_used = self |
| 242 | .cumulative_gas_used |
| 243 | .checked_add(receipt.inner.gas_used) |
| 244 | .ok_or(ExecutionError::GasOverflow)?; |
| 245 | self.next_log_index += receipt.inner.logs().len(); |
| 246 | |
| 247 | for address in state.keys() { |
| 248 | self.evm.db_mut().basic(*address).map_err(|err| { |
| 249 | StateProcessorError::Execution(ExecutionError::EvmEnv(err.to_string())) |
| 250 | })?; |
| 251 | } |
| 252 | self.evm.db_mut().commit(state.clone()); |
| 253 | |
| 254 | Ok(ExecutedPendingTransaction { |
| 255 | rpc_transaction, |
| 256 | receipt, |
| 257 | state, |
| 258 | result, |
| 259 | execution_time_us, |
| 260 | }) |
| 261 | } |
| 262 | |
| 263 | fn jovian_da_footprint_estimation( |
| 264 | &mut self, |
no test coverage detected