Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
remove error handling for failed deposits; handle in revm
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby committed Oct 16, 2023
1 parent 4e7cdfb commit 0f2ea91
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 38 deletions.
17 changes: 0 additions & 17 deletions crates/payload/basic/src/optimism.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,6 @@ where
let ResultAndState { result, state } = match evm.transact() {
Ok(res) => res,
Err(err) => {
if sequencer_tx.is_deposit() {
if is_regolith || !sequencer_tx.is_system_transaction() {
cumulative_gas_used += sequencer_tx.gas_limit();
}

receipts.push(Some(Receipt {
tx_type: sequencer_tx.tx_type(),
success: false,
cumulative_gas_used,
logs: vec![],
#[cfg(feature = "optimism")]
deposit_nonce: depositor.map(|account| account.nonce),
}));
executed_txs.push(sequencer_tx.into_signed());
continue
}

match err {
EVMError::Transaction(err) => {
if matches!(err, InvalidTransaction::NonceTooLow { .. }) {
Expand Down
22 changes: 1 addition & 21 deletions crates/revm/src/optimism/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,27 +98,7 @@ impl<'a> BlockExecutor for EVMProcessor<'a> {
.transpose()?;

// Execute transaction.
let ResultAndState { result, state } = match self.transact(transaction, sender) {
Ok(res) => res,
Err(err) => {
if transaction.is_deposit() {
if is_regolith || !transaction.is_system_transaction() {
cumulative_gas_used += transaction.gas_limit();
}

receipts.push(Receipt {
tx_type: transaction.tx_type(),
success: false,
cumulative_gas_used,
logs: vec![],
#[cfg(feature = "optimism")]
deposit_nonce: depositor.map(|account| account.nonce),
});
continue
}
return Err(err)
}
};
let ResultAndState { result, state } = self.transact(transaction, sender)?;
trace!(
target: "evm",
?transaction, ?result, ?state,
Expand Down

0 comments on commit 0f2ea91

Please sign in to comment.