@@ -3,7 +3,7 @@ use std::collections::{HashMap, HashSet};
33use alloy:: consensus:: BlockHeader ;
44use alloy:: eips:: BlockId ;
55use alloy:: network:: { BlockResponse , ReceiptResponse , TransactionBuilder } ;
6- use alloy:: primitives:: { keccak256 , Address , B256 , U256 } ;
6+ use alloy:: primitives:: { Address , B256 , U256 } ;
77use alloy:: rlp;
88use alloy:: rpc:: types:: { EIP1186AccountProofResponse , Filter , FilterChanges , Log } ;
99use async_trait:: async_trait;
@@ -21,7 +21,8 @@ use crate::execution::constants::{
2121} ;
2222use crate :: execution:: errors:: ExecutionError ;
2323use crate :: execution:: proof:: {
24- ordered_trie_root_noop_encoder, verify_account_proof, verify_storage_proof,
24+ ordered_trie_root_noop_encoder, verify_account_proof, verify_code_hash_proof,
25+ verify_storage_proof,
2526} ;
2627use crate :: execution:: rpc:: ExecutionRpc ;
2728use crate :: execution:: state:: State ;
@@ -255,17 +256,10 @@ impl<N: NetworkSpec, R: ExecutionRpc<N>> ExecutionInnerRpcClient<N, R> {
255256 let code = self
256257 . rpc
257258 . get_code ( proof. address , block. header ( ) . number ( ) . into ( ) )
258- . await ?;
259- let code_hash = keccak256 ( & code) ;
260- if proof. code_hash != code_hash {
261- return Err ( ExecutionError :: CodeHashMismatch (
262- proof. address ,
263- code_hash,
264- proof. code_hash ,
265- )
266- . into ( ) ) ;
267- }
268- Some ( code. into ( ) )
259+ . await ?
260+ . into ( ) ;
261+ verify_code_hash_proof ( proof, & code) ?;
262+ Some ( code)
269263 } else {
270264 None
271265 } ;
@@ -510,7 +504,11 @@ mod tests {
510504 async fn test_create_access_list ( ) {
511505 let client = get_client ( ) . await ;
512506 let address = rpc_proof ( ) . address ;
513- let tx = TransactionRequest :: default ( ) . from ( address) . to ( address) ;
507+ let block_beneficiary = rpc_block ( ) . header . beneficiary ;
508+ let tx = TransactionRequest :: default ( )
509+ . from ( address)
510+ . to ( block_beneficiary)
511+ . value ( U256 :: ZERO ) ;
514512
515513 let response = client
516514 . create_access_list ( & tx, BlockId :: latest ( ) . into ( ) )
@@ -519,6 +517,10 @@ mod tests {
519517
520518 assert_eq ! ( response. len( ) , 2 ) ;
521519 assert_eq ! ( response. get( & address) . unwrap( ) , & rpc_account( ) ) ;
520+ assert_eq ! (
521+ response. get( & block_beneficiary) . unwrap( ) ,
522+ & rpc_block_miner_account( )
523+ ) ;
522524 }
523525
524526 #[ tokio:: test]
0 commit comments