@@ -413,6 +413,10 @@ where
413413 Some ( ( receipt, state) )
414414 } ) ;
415415
416+ // If cached, we can fill out pending block data using previous execution results
417+ // If not cached, we need to execute the transaction and build pending block data from scratch
418+ // The `pending_blocks_builder.with*` calls should fill out the same data in both cases
419+ // We also need to update the cumulative gas used and next log index in both cases
416420 if let Some ( ( receipt, state) ) = cached_data {
417421 let ( deposit_receipt_version, deposit_nonce) = if transaction. is_deposit ( ) {
418422 let deposit_receipt = receipt
@@ -507,19 +511,13 @@ where
507511 } ) {
508512 Ok ( receipt) => receipt,
509513 Err ( ctx) => {
514+ // This is a deposit transaction, so build the receipt from the context
510515 let receipt = alloy_consensus:: Receipt {
511- // Success flag was added in `EIP-658: Embedding transaction status code
512- // in receipts`.
513516 status : Eip658Value :: Eip658 ( ctx. result . is_success ( ) ) ,
514517 cumulative_gas_used : ctx. cumulative_gas_used ,
515518 logs : ctx. result . into_logs ( ) ,
516519 } ;
517520
518- // Cache the depositor account prior to the state transition for the deposit nonce.
519- //
520- // Note that this *only* needs to be done post-regolith hardfork, as deposit nonces
521- // were not introduced in Bedrock. In addition, regular transactions don't have deposit
522- // nonces, so we don't need to touch the DB for those.
523521 let deposit_nonce = ( is_regolith_active
524522 && transaction. is_deposit ( ) )
525523 . then ( || {
@@ -535,11 +533,6 @@ where
535533 receipt_builder. build_deposit_receipt ( OpDepositReceipt {
536534 inner : receipt,
537535 deposit_nonce,
538- // The deposit receipt version was introduced in Canyon to indicate an
539- // update to how receipt hashes should be computed
540- // when set. The state transition process ensures
541- // this is only set for post-Canyon deposit
542- // transactions.
543536 deposit_receipt_version : is_canyon_active. then_some ( 1 ) ,
544537 } )
545538 }
0 commit comments