@@ -8,7 +8,8 @@ use crate::{
88 metrics:: DbMetrics ,
99 options:: rocksdb_global_options,
1010 snapshots:: Snapshots ,
11- update_global_trie:: apply_to_global_trie,
11+ global_trie:: apply_to_global_trie,
12+ global_trie:: get_state_root
1213 } ,
1314 storage:: {
1415 ClassInfoWithBlockN , CompiledSierraWithBlockN , DevnetPredeployedKeys , EventFilter , MadaraStorageRead ,
@@ -47,7 +48,7 @@ mod state;
4748// TODO: remove this pub. this is temporary until get_storage_proof is properly abstracted.
4849pub mod trie;
4950// TODO: remove this pub. this is temporary until get_storage_proof is properly abstracted.
50- pub mod update_global_trie ;
51+ pub mod global_trie ;
5152
5253type WriteBatchWithTransaction = rocksdb:: WriteBatchWithTransaction < false > ;
5354type DB = DBWithThreadMode < MultiThreaded > ;
@@ -319,6 +320,9 @@ impl MadaraStorageRead for RocksDBStorage {
319320 fn get_latest_applied_trie_update ( & self ) -> Result < Option < u64 > > {
320321 self . inner . get_latest_applied_trie_update ( ) . context ( "Getting latest applied trie update info from db" )
321322 }
323+ fn get_snap_sync_latest_block ( & self ) -> Result < Option < u64 > > {
324+ self . inner . get_snap_sync_latest_block ( ) . context ( "Getting snap sync latest block from db" )
325+ }
322326
323327 // L1 to L2 messages
324328
@@ -452,6 +456,10 @@ impl MadaraStorageWrite for RocksDBStorage {
452456 tracing:: debug!( "Write latest applied trie update block_n={block_n:?}" ) ;
453457 self . inner . write_latest_applied_trie_update ( block_n) . context ( "Writing latest applied trie update block_n" )
454458 }
459+ fn write_snap_sync_latest_block ( & self , block_n : & Option < u64 > ) -> Result < ( ) > {
460+ tracing:: debug!( "Write snap sync latest block block_n={block_n:?}" ) ;
461+ self . inner . write_snap_sync_latest_block ( block_n) . context ( "Writing snap sync latest block" )
462+ }
455463
456464 fn remove_mempool_transactions ( & self , tx_hashes : impl IntoIterator < Item = Felt > ) -> Result < ( ) > {
457465 tracing:: debug!( "Remove mempool transactions" ) ;
@@ -465,6 +473,10 @@ impl MadaraStorageWrite for RocksDBStorage {
465473 . with_context ( || format ! ( "Writing mempool transaction from db for tx_hash={tx_hash:#x}" ) )
466474 }
467475
476+ fn get_state_root_hash ( & self ) -> Result < Felt > {
477+ get_state_root ( self )
478+ }
479+
468480 fn apply_to_global_trie < ' a > (
469481 & self ,
470482 start_block_n : u64 ,
0 commit comments