1919
2020use crate :: {
2121 evm:: {
22- eip7702:: authorization_intrinsic_gas,
2322 fees:: { compute_max_integer_quotient, InfoT } ,
2423 runtime:: SetWeightLimit ,
2524 TYPE_EIP7702 , TYPE_LEGACY ,
@@ -72,7 +71,7 @@ impl GenericTransaction {
7271 {
7372 let is_dry_run = matches ! ( mode, CreateCallMode :: DryRun ) ;
7473 let base_fee = <Pallet < T > >:: evm_base_fee ( ) ;
75-
74+
7675 // EIP-7702: Store the authorization list for later processing
7776 let authorization_list = self . authorization_list . clone ( ) ;
7877
@@ -86,11 +85,12 @@ impl GenericTransaction {
8685 // * Here's Nick's article: https://weka.medium.com/how-to-send-ether-to-11-440-people-187e332566b7
8786 match ( self . chain_id , self . r#type . as_ref ( ) ) {
8887 ( None , Some ( super :: Byte ( TYPE_LEGACY ) ) ) => { } ,
89- ( Some ( chain_id) , ..) =>
88+ ( Some ( chain_id) , ..) => {
9089 if chain_id != <T as Config >:: ChainId :: get ( ) . into ( ) {
9190 log:: debug!( target: LOG_TARGET , "Invalid chain_id {chain_id:?}" ) ;
9291 return Err ( InvalidTransaction :: Call ) ;
93- } ,
92+ }
93+ } ,
9494 ( None , ..) => {
9595 log:: debug!( target: LOG_TARGET , "Invalid chain_id None" ) ;
9696 return Err ( InvalidTransaction :: Call ) ;
@@ -101,25 +101,22 @@ impl GenericTransaction {
101101 log:: debug!( target: LOG_TARGET , "No gas provided" ) ;
102102 return Err ( InvalidTransaction :: Call ) ;
103103 } ;
104-
104+
105105 // EIP-7702: Validate that type 0x04 transactions have a non-null destination
106106 // Per spec: "Note, this implies a null destination is not valid."
107107 if let Some ( super :: Byte ( TYPE_EIP7702 ) ) = self . r#type . as_ref ( ) {
108108 if self . to . is_none ( ) {
109109 log:: debug!( target: LOG_TARGET , "EIP-7702 transactions require non-null destination" ) ;
110110 return Err ( InvalidTransaction :: Call ) ;
111111 }
112-
112+
113113 // EIP-7702: Validate that type 0x04 transactions have non-empty authorization list
114114 // Per spec: "The transaction is considered invalid if the length of authorization_list is zero."
115- if authorization_list. is_empty ( ) {
115+ if self . authorization_list . is_empty ( ) {
116116 log:: debug!( target: LOG_TARGET , "EIP-7702 transactions require non-empty authorization list" ) ;
117117 return Err ( InvalidTransaction :: Call ) ;
118118 }
119119 }
120-
121- // EIP-7702: Calculate intrinsic gas for authorization list processing
122- let _auth_intrinsic_gas = authorization_intrinsic_gas ( authorization_list. len ( ) ) ;
123120
124121 // Currently, effective_gas_price will always be the same as base_fee
125122 // Because all callers of `into_call` will prepare `tx` that way. Some of the subsequent
@@ -174,7 +171,7 @@ impl GenericTransaction {
174171
175172 if !value. is_zero ( ) {
176173 log:: debug!( target: LOG_TARGET , "Runtime pallets address cannot be called with value" ) ;
177- return Err ( InvalidTransaction :: Call )
174+ return Err ( InvalidTransaction :: Call ) ;
178175 }
179176
180177 crate :: Call :: eth_substrate_call:: < T > { call : Box :: new ( call) , transaction_encoded }
0 commit comments