@@ -850,6 +850,49 @@ where
850850 }
851851}
852852
853+ /// Storage task for fetching Patricia paths in a single storage trie.
854+ #[ expect( dead_code) ]
855+ struct StoragePathsReadTask < ' indices , Layout : NodeLayoutFor < StarknetStorageValue > > {
856+ address : ContractAddress ,
857+ storage_root_hash : HashOutput ,
858+ sorted_leaf_indices : SortedLeafIndices < ' indices > ,
859+ _layout : PhantomData < Layout > ,
860+ }
861+
862+ impl < ' indices , S , Layout > StorageTaskOutput < S > for StoragePathsReadTask < ' indices , Layout >
863+ where
864+ S : ImmutableReadOnlyStorage ,
865+ Layout : NodeLayoutFor < StarknetStorageValue > + Send + ' static ,
866+ {
867+ type Output = TraversalResult < ( ContractAddress , PreimageMap ) > ;
868+ }
869+
870+ #[ async_trait]
871+ impl < ' indices , ' storage , S , Layout > StorageTask < ' storage , S >
872+ for StoragePathsReadTask < ' indices , Layout >
873+ where
874+ S : ImmutableReadOnlyStorage + ' storage ,
875+ Layout : NodeLayoutFor < StarknetStorageValue > + Send + ' static ,
876+ <Layout as NodeLayoutFor < StarknetStorageValue > >:: DbLeaf :
877+ HasStaticPrefix < KeyContext = ContractAddress > ,
878+ {
879+ async fn run_with_storage (
880+ self ,
881+ storage : & mut ReadsCollectorStorage < ' storage , S > ,
882+ ) -> Self :: Output {
883+ let leaves = None ;
884+ let proof = fetch_patricia_paths :: < Layout :: DbLeaf , Layout > (
885+ storage,
886+ self . storage_root_hash ,
887+ self . sorted_leaf_indices ,
888+ leaves,
889+ & self . address ,
890+ )
891+ . await ?;
892+ Ok ( ( self . address , proof) )
893+ }
894+ }
895+
853896async fn create_storage_tries_concurrently < ' a , S , Layout > (
854897 storage : & mut S ,
855898 actual_storage_updates : & HashMap < ContractAddress , LeafModifications < StarknetStorageValue > > ,
0 commit comments