Skip to content

Commit

Permalink
feat: fill eip 7702 tx env with auth list
Browse files Browse the repository at this point in the history
  • Loading branch information
meyer9 committed Jan 28, 2025
1 parent 4b00849 commit f52cccd
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions crates/executor/src/executor/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use maili_genesis::RollupConfig;
use op_alloy_consensus::OpTxEnvelope;
use op_alloy_rpc_types_engine::OpPayloadAttributes;
use revm::primitives::{
BlobExcessGasAndPrice, BlockEnv, CfgEnv, CfgEnvWithHandlerCfg, OptimismFields, SpecId,
TransactTo, TxEnv,
AuthorizationList, BlobExcessGasAndPrice, BlockEnv, CfgEnv, CfgEnvWithHandlerCfg,
OptimismFields, SpecId, TransactTo, TxEnv,
};

impl<P, H> StatelessL2BlockExecutor<'_, P, H>
Expand Down Expand Up @@ -213,6 +213,30 @@ where
};
Ok(env)
}
OpTxEnvelope::Eip7702(signed_tx) => {
let tx = signed_tx.tx();
env.caller = signed_tx.recover_signer().map_err(ExecutorError::SignatureError)?;
env.gas_limit = tx.gas_limit;
env.gas_price = U256::from(tx.max_fee_per_gas);
env.gas_priority_fee = Some(U256::from(tx.max_priority_fee_per_gas));
env.transact_to = TransactTo::Call(tx.to);
env.value = tx.value;
env.data = tx.input.clone();
env.chain_id = Some(tx.chain_id);
env.nonce = Some(tx.nonce);
env.access_list = tx.access_list.to_vec();
env.blob_hashes.clear();
env.max_fee_per_blob_gas.take();
env.authorization_list =
Some(AuthorizationList::Signed(tx.authorization_list.to_vec()));
env.optimism = OptimismFields {
source_hash: None,
mint: None,
is_system_transaction: Some(false),
enveloped_tx: Some(encoded_transaction.to_vec().into()),
};
Ok(env)
}
OpTxEnvelope::Deposit(tx) => {
env.caller = tx.from;
env.access_list.clear();
Expand Down

0 comments on commit f52cccd

Please sign in to comment.