MCPcopy Create free account
hub / github.com/base/base / commit_transaction

Method commit_transaction

crates/common/evm/src/executor/block_executor.rs:279–330  ·  view source on GitHub ↗
(&mut self, output: Self::Result)

Source from the content-addressed store, hash-verified

277 }
278
279 fn commit_transaction(&mut self, output: Self::Result) -> GasOutput {
280 let BaseTxResult {
281 inner: EthTxResult { result: ResultAndState { result, state }, blob_gas_used, tx_type },
282 is_deposit,
283 sender: _,
284 depositor,
285 } = output;
286
287 let tx_gas_used = result.tx_gas_used();
288 let state_gas_used = result.gas().block_state_gas_used();
289
290 self.gas_used += tx_gas_used;
291
292 if self.spec.is_jovian_active_at_timestamp(self.evm.block().timestamp().saturating_to())
293 && !is_deposit
294 {
295 self.da_footprint_used = self.da_footprint_used.saturating_add(blob_gas_used);
296 }
297
298 self.receipts.push(
299 match self.receipt_builder.build_receipt(ReceiptBuilderCtx {
300 tx_type,
301 result,
302 cumulative_gas_used: self.gas_used,
303 evm: &self.evm,
304 state: &state,
305 }) {
306 Ok(receipt) => receipt,
307 Err(ctx) => {
308 let receipt = alloy_consensus::Receipt {
309 status: Eip658Value::Eip658(ctx.result.is_success()),
310 cumulative_gas_used: ctx.cumulative_gas_used,
311 logs: ctx.result.into_logs(),
312 };
313
314 self.receipt_builder.build_deposit_receipt(DepositReceipt {
315 inner: receipt,
316 deposit_nonce: depositor.map(|account| account.nonce),
317 deposit_receipt_version: (is_deposit
318 && self.spec.is_canyon_active_at_timestamp(
319 self.evm.block().timestamp().saturating_to(),
320 ))
321 .then_some(1),
322 })
323 }
324 },
325 );
326
327 self.evm.db_mut().commit(state);
328
329 GasOutput::with_state_gas(tx_gas_used, state_gas_used)
330 }
331
332 fn finish(
333 mut self,

Callers

nothing calls this directly

Calls 12

gasMethod · 0.80
db_mutMethod · 0.80
timestampMethod · 0.45
blockMethod · 0.45
pushMethod · 0.45
build_receiptMethod · 0.45
is_successMethod · 0.45
into_logsMethod · 0.45
build_deposit_receiptMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected