Skip to content

Conversation

@yongkangc
Copy link
Member

@yongkangc yongkangc commented Dec 21, 2025

Add RocksDB infrastructure for history lookups without changing any behavior.

This is PR 2/3 of a stacked PR series that splits #20412 for easier review. Closes #20388

Depends on: #20542

Review focus:

  • Correctness of RocksTx history lookup methods
  • RocksDBBatch ownership change is safe

Changes

rocksdb/provider.rs

  • Change RocksDBBatch to own Arc<RocksDBProviderInner> instead of borrowing
    • Allows storing RocksDBBatch in DatabaseProvider without lifetime issues
  • Add RocksTx::account_history_info() method
  • Add RocksTx::storage_history_info() method
    • Both use the shared history_info_from_shard algorithm from PR1

rocksdb_stub.rs

  • Add RocksDBProvider::batch() stub method
  • Add RocksDBBatch::commit(), len(), is_empty() stub methods

Stack

@github-project-automation github-project-automation bot moved this to Backlog in Reth Tracker Dec 21, 2025
@yongkangc yongkangc changed the title feat(storage): add RocksDB history lookup methods and owned batch type feat(storage): add RocksDB history lookup methods and owned batch type [2/3] Dec 21, 2025
@yongkangc yongkangc force-pushed the yk/pr2-rocksdb-infrastructure branch from e45acf9 to 40f84f2 Compare December 21, 2025 02:12
Enhance RocksDB provider infrastructure for history lookups:

- Change RocksDBBatch to own Arc<RocksDBProviderInner> instead of borrowing
  This allows storing RocksDBBatch in DatabaseProvider without lifetime issues.

- Add RocksTx::account_history_info() and storage_history_info() methods
  These use the shared history_info_from_shard algorithm to lookup history
  in RocksDB with the same semantics as MDBX.

- Update rocksdb_stub.rs with matching API (batch(), commit(), len(), is_empty())

This prepares the infrastructure for PR3 which will wire RocksDB
into HistoricalStateProvider and DatabaseProvider HistoryWriter.
@yongkangc yongkangc force-pushed the yk/pr2-rocksdb-infrastructure branch from 7b937ec to 9aefeba Compare December 22, 2025 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants