(
&self,
builder: &mut impl BlockBuilder<Primitives = Evm::Primitives>,
)
| 651 | /// so the historical skip-and-continue behavior is preserved. |
| 652 | #[instrument(skip_all, fields(phase = "sequencer_txs"))] |
| 653 | pub fn execute_sequencer_transactions( |
| 654 | &self, |
| 655 | builder: &mut impl BlockBuilder<Primitives = Evm::Primitives>, |
| 656 | ) -> Result<ExecutionInfo, PayloadBuilderError> { |
| 657 | let mut info = ExecutionInfo::new(); |
| 658 | let no_tx_pool = self.attributes().no_tx_pool(); |
| 659 | |
| 660 | for sequencer_tx in self.attributes().sequencer_transactions() { |
| 661 | // A sequencer's block should never contain blob transactions. |
| 662 | if sequencer_tx.value().is_eip4844() { |
| 663 | return Err(PayloadBuilderError::other( |
| 664 | BasePayloadBuilderError::BlobTransactionRejected, |
| 665 | )); |
| 666 | } |
| 667 | |
| 668 | // Convert the transaction to a [RecoveredTx]. This is |
| 669 | // purely for the purposes of utilizing the `evm_config.tx_env`` function. |
| 670 | // Deposit transactions do not have signatures, so if the tx is a deposit, this |
| 671 | // will just pull in its `from` address. |
| 672 | let sequencer_tx = sequencer_tx.value().try_clone_into_recovered().map_err(|_| { |
| 673 | PayloadBuilderError::other(BasePayloadBuilderError::TransactionEcRecoverFailed) |
| 674 | })?; |
| 675 | |
| 676 | let gas_output = match builder.execute_transaction(sequencer_tx.clone()) { |
| 677 | Ok(gas_output) => gas_output, |
| 678 | Err(BlockExecutionError::Validation(BlockValidationError::InvalidTx { |
| 679 | error, |
| 680 | .. |
| 681 | })) if !no_tx_pool => { |
| 682 | trace!(target: "payload_builder", %error, ?sequencer_tx, "Error in sequencer transaction, skipping."); |
| 683 | continue; |
| 684 | } |
| 685 | Err(err) => { |
| 686 | return Err(PayloadBuilderError::EvmExecutionError(Box::new(err))); |
| 687 | } |
| 688 | }; |
| 689 | |
| 690 | info.cumulative_gas_used += gas_output.tx_gas_used(); |
| 691 | } |
| 692 | |
| 693 | Ok(info) |
| 694 | } |
| 695 | |
| 696 | /// Executes the given best transactions and updates the execution info. |
| 697 | /// |
no test coverage detected