Skip to content

Conversation

@MegaRedHand
Copy link
Collaborator

@MegaRedHand MegaRedHand commented Nov 12, 2025

Motivation

Description

This PR changes the account_codes CF to use RocksDB BlobDB functionality, which moves values outside from the tree, to independent files. We expect this to increase the read performance, since bytecodes can have vastly different sizes, and some occupy multiple page lines.

@github-actions github-actions bot added L1 Ethereum client performance Block execution throughput and performance in general labels Nov 12, 2025
@github-actions
Copy link

github-actions bot commented Nov 12, 2025

Lines of code report

Total lines added: 11
Total lines removed: 0
Total lines changed: 11

Detailed view
+-------------------------------------------+-------+------+
| File                                      | Lines | Diff |
+-------------------------------------------+-------+------+
| ethrex/crates/storage/store_db/rocksdb.rs | 1648  | +11  |
+-------------------------------------------+-------+------+

@github-actions
Copy link

github-actions bot commented Nov 12, 2025

Benchmark Block Execution Results Comparison Against Main

Command Mean [s] Min [s] Max [s] Relative
base 59.733 ± 0.383 59.174 60.616 1.00 ± 0.01
head 59.680 ± 0.308 59.311 60.096 1.00

@MegaRedHand MegaRedHand marked this pull request as ready for review November 13, 2025 15:39
Copilot AI review requested due to automatic review settings November 13, 2025 15:39
@MegaRedHand MegaRedHand requested a review from a team as a code owner November 13, 2025 15:39
@ethrex-project-sync ethrex-project-sync bot moved this to In Review in ethrex_l1 Nov 13, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables RocksDB BlobDB functionality for the account_codes column family to improve read performance by storing bytecodes in separate blob files rather than in the LSM tree. This is particularly beneficial for bytecodes of varying sizes.

  • Enables BlobDB for account_codes CF with Lz4 compression
  • Sets minimum blob size to 32 bytes to keep small bytecodes inline
  • Adds lz4 feature to rocksdb dependency

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
crates/storage/store_db/rocksdb.rs Separates CF_ACCOUNT_CODES configuration from CF_RECEIPTS and enables BlobDB with Lz4 compression and 32-byte minimum blob size
Cargo.toml Adds lz4 feature to rocksdb dependency to support blob compression
Cargo.lock Adds lz4-sys dependency required by rocksdb lz4 feature
CHANGELOG.md Documents the BlobDB feature addition for account_codes column family

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +311 to +312
// Small bytecodes should go inline (mainly for delegation indicators)
cf_opts.set_min_blob_size(32);
Copy link
Contributor

Choose a reason for hiding this comment

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

Good call.

Copy link
Contributor

@Oppen Oppen left a comment

Choose a reason for hiding this comment

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

LGTM. I'll try it in ethrex-sync-3 as a smoke test. If it syncs and runs Hoodi OK for while it's green on my side.

@iovoid iovoid changed the title perf(l1): enable BlobDB for account bytecodes perf(l1)!: enable BlobDB for account bytecodes Nov 13, 2025
@github-actions github-actions bot removed performance Block execution throughput and performance in general L1 Ethereum client labels Nov 13, 2025
@jrchatruc jrchatruc added this pull request to the merge queue Nov 13, 2025
Merged via the queue into main with commit 27be096 Nov 13, 2025
55 checks passed
@jrchatruc jrchatruc deleted the bytecodes-use-blob-db branch November 13, 2025 19:05
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l1 Nov 13, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in ethrex_performance Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done
Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants