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

Method commit_transaction

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

Source from the content-addressed store, hash-verified

226 }
227
228 fn commit_transaction(&mut self, output: Self::Result) -> GasOutput {
229 let BaseTxResult {
230 inner: EthTxResult { result: ResultAndState { result, state }, blob_gas_used, tx_type },
231 is_deposit,
232 sender: _,
233 depositor,
234 } = output;
235
236 let tx_gas_used = result.tx_gas_used();
237 let state_gas_used = result.gas().block_state_gas_used();
238
239 self.gas_used += tx_gas_used;
240
241 if self.spec.is_jovian_active_at_timestamp(self.evm.block().timestamp().saturating_to())
242 && !is_deposit
243 {
244 self.da_footprint_used = self.da_footprint_used.saturating_add(blob_gas_used);
245 }
246
247 self.receipts.push(
248 match self.receipt_builder.build_receipt(ReceiptBuilderCtx {
249 tx_type,
250 result,
251 cumulative_gas_used: self.gas_used,
252 evm: &self.evm,
253 state: &state,
254 }) {
255 Ok(receipt) => receipt,
256 Err(ctx) => {
257 let receipt = alloy_consensus::Receipt {
258 status: Eip658Value::Eip658(ctx.result.is_success()),
259 cumulative_gas_used: ctx.cumulative_gas_used,
260 logs: ctx.result.into_logs(),
261 };
262
263 self.receipt_builder.build_deposit_receipt(DepositReceipt {
264 inner: receipt,
265 deposit_nonce: depositor.map(|account| account.nonce),
266 deposit_receipt_version: (is_deposit
267 && self.spec.is_canyon_active_at_timestamp(
268 self.evm.block().timestamp().saturating_to(),
269 ))
270 .then_some(1),
271 })
272 }
273 },
274 );
275
276 self.evm.db_mut().commit(state);
277
278 GasOutput::with_state_gas(tx_gas_used, state_gas_used)
279 }
280
281 fn finish(
282 mut self,

Callers

nothing calls this directly

Calls 11

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