Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions crates/storage/backend/rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ impl RocksDBBackend {
RECEIPTS,
TRANSACTION_LOCATIONS,
FULLSYNC_HEADERS,
ACCOUNT_TRIE_NODES,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scope difference vs #6529 worth surfacing: this PR expands point_lookup_cfs to include ACCOUNT_TRIE_NODES, STORAGE_TRIE_NODES, ACCOUNT_FLATKEYVALUE, STORAGE_FLATKEYVALUE. #6529 doesn't touch this array. The point_lookup_cfs set drives other optimizations (the optimize_for_point_lookup path elsewhere in this file) — adding trie/FKV CFs here changes their broader RocksDB tuning, not just the binary-hash index.

Worth a brief justification in the PR description for why these four CFs belong in the point-lookup set. Trie nodes and flat KV are both keyed lookups (32-byte keys), so the choice is sound, but it's a non-trivial config change that's separate from the binary-hash index addition. Could be split into its own PR if the team wants surgical perf work.

STORAGE_TRIE_NODES,
ACCOUNT_FLATKEYVALUE,
STORAGE_FLATKEYVALUE,
];

// opts.enable_statistics();
Expand Down Expand Up @@ -121,6 +125,9 @@ impl RocksDBBackend {
let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(16 * 1024); // 16KB
block_opts.set_bloom_filter(10.0, false);
block_opts
.set_data_block_index_type(rocksdb::DataBlockIndexType::BinaryAndHash);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Direct conflict point with #6529 — both add .set_data_block_index_type(BinaryAndHash) + .set_data_block_hash_ratio(0.75) here (and at five other identical blocks below: lines 145, 161, 179, 192, 206). Code is identical; the merge will be a textual conflict that resolves to one copy.

No functional disagreement to resolve — just merge order. The author teams (you and @dicethedev) might want to pick one PR as the canonical landing for this index change and close the other, instead of letting the merge race decide which becomes the no-op rebase.

block_opts.set_data_block_hash_ratio(0.75);
block_opts.set_block_cache(&block_cache);
cf_opts.set_block_based_table_factory(&block_opts);
}
Expand All @@ -134,6 +141,9 @@ impl RocksDBBackend {
let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(16 * 1024); // 16KB
block_opts.set_bloom_filter(10.0, false); // 10 bits per key
block_opts
.set_data_block_index_type(rocksdb::DataBlockIndexType::BinaryAndHash);
block_opts.set_data_block_hash_ratio(0.75);
block_opts.set_block_cache(&block_cache);
cf_opts.set_block_based_table_factory(&block_opts);
}
Expand All @@ -147,6 +157,9 @@ impl RocksDBBackend {
let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(16 * 1024); // 16KB
block_opts.set_bloom_filter(10.0, false); // 10 bits per key
block_opts
.set_data_block_index_type(rocksdb::DataBlockIndexType::BinaryAndHash);
block_opts.set_data_block_hash_ratio(0.75);
block_opts.set_block_cache(&block_cache);
cf_opts.set_block_based_table_factory(&block_opts);
}
Expand All @@ -162,6 +175,9 @@ impl RocksDBBackend {

let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(32 * 1024); // 32KB
block_opts
.set_data_block_index_type(rocksdb::DataBlockIndexType::BinaryAndHash);
block_opts.set_data_block_hash_ratio(0.75);
block_opts.set_block_cache(&block_cache);
cf_opts.set_block_based_table_factory(&block_opts);
}
Expand All @@ -172,6 +188,9 @@ impl RocksDBBackend {

let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(32 * 1024); // 32KB
block_opts
.set_data_block_index_type(rocksdb::DataBlockIndexType::BinaryAndHash);
block_opts.set_data_block_hash_ratio(0.75);
block_opts.set_block_cache(&block_cache);
cf_opts.set_block_based_table_factory(&block_opts);
}
Expand All @@ -183,6 +202,9 @@ impl RocksDBBackend {

let mut block_opts = BlockBasedOptions::default();
block_opts.set_block_size(16 * 1024);
block_opts
.set_data_block_index_type(rocksdb::DataBlockIndexType::BinaryAndHash);
block_opts.set_data_block_hash_ratio(0.75);
block_opts.set_block_cache(&block_cache);
cf_opts.set_block_based_table_factory(&block_opts);
}
Expand Down
Loading