-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
A-dbRelated to the databaseRelated to the databaseC-enhancementNew feature or requestNew feature or requestinhouseOnly for reth teamOnly for reth team
Description
Update provider methods to use EitherReader/EitherWriter so they can read from/write to RocksDB when the feature is enabled.
In crates/storage/provider/src/providers/database/provider.rs:
-
TransactionsProvider::transaction_id():- Currently:
self.tx.get::<tables::TransactionHashNumbers>(tx_hash) - Change to: Use
EitherReader::new_transaction_hash_numbers()and callget_transaction_hash_number()
- Currently:
-
insert_block()transaction hash writes:- Currently:
self.tx.put::<tables::TransactionHashNumbers>(*hash, tx_num) - Change to: Use
EitherWriter::new_transaction_hash_numbers()and callput_transaction_hash_number()
- Currently:
-
remove_blocks_above()transaction hash deletes:- Currently:
self.tx.delete::<tables::TransactionHashNumbers>(hash, None) - Change to: Use
EitherWriter::new_transaction_hash_numbers()and calldelete_transaction_hash_number()
- Currently:
-
HistoryWriter::unwind_storage_history_indices():- Currently: Uses
self.tx.cursor_write::<tables::StoragesHistory>() - Change to: Use
EitherWriter::new_storages_history()for delete operations - Note: This method uses
unwind_history_shardshelper which walks the cursor - may need refactoring
- Currently: Uses
-
HistoryWriter::unwind_account_history_indices():- Currently: Uses
self.tx.cursor_write::<tables::AccountsHistory>() - Change to: Use
EitherWriter::new_accounts_history()for delete operations - Note: Same pattern as storage history - uses
unwind_history_shardshelper
- Currently: Uses
In crates/storage/provider/src/providers/state/historical.rs:
-
- Currently: Uses
history_info::<tables::StoragesHistory, _>()which internally uses DB cursor - Change to: Use
EitherReader::new_storages_history()and callget_storage_history() - Note: The
history_infohelper uses cursor walking - may need a RocksDB-specific code path
- Currently: Uses
-
account_history_lookup():- Currently: Uses
history_info::<tables::AccountsHistory, _>()which internally uses DB cursor - Change to: Use
EitherReader::new_accounts_history()and callget_account_history() - Note: Same pattern as storage history - uses
history_infohelper
- Currently: Uses
Helper methods that may need refactoring for RocksDB:
unwind_history_shards()- Uses backward cursor walking (seek_exact,delete_current,prev)append_history_index()- Usestake_shard()+ chunked inserthistory_info()- Uses cursorseek()andprev()
Metadata
Metadata
Assignees
Labels
A-dbRelated to the databaseRelated to the databaseC-enhancementNew feature or requestNew feature or requestinhouseOnly for reth teamOnly for reth team
Type
Projects
Status
Backlog