Skip to content

Conversation

@iovoid
Copy link
Contributor

@iovoid iovoid commented Oct 8, 2025

Motivation

We want a path-based database:

  • To reduce database size, because updates nodes replace old ones instead of coexisting
  • As preparation for pruning, which reduces database size even further

Description

Support for "archive mode" (keeping indefinitely old state) is dropped.

To handle reorgs we use in-memory layers that exist on top of the db.

@jrchatruc jrchatruc requested a review from a team as a code owner October 14, 2025 22:20
@github-actions
Copy link

Benchmark for 956ca77

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 34.8±0.17ms 34.8±0.18ms 0.00%
Trie/cita-trie insert 1k 3.6±0.02ms 3.6±0.11ms 0.00%
Trie/ethrex-trie insert 10k 54.4±0.35ms 61.6±0.58ms +13.24%
Trie/ethrex-trie insert 1k 6.1±0.07ms 8.1±0.05ms +32.79%

@github-actions
Copy link

Benchmark for dad1d71

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 38.5±2.53ms 38.3±2.47ms -0.52%
Trie/cita-trie insert 1k 3.5±0.06ms 3.5±0.02ms 0.00%
Trie/ethrex-trie insert 10k 57.5±1.15ms 62.6±1.03ms +8.87%
Trie/ethrex-trie insert 1k 6.2±0.28ms 8.3±0.51ms +33.87%

@github-actions
Copy link

Benchmark for 17a5540

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.3±1.18ms 37.0±0.36ms +4.82%
Trie/cita-trie insert 1k 3.5±0.04ms 3.8±0.02ms +8.57%
Trie/ethrex-trie insert 10k 55.0±0.51ms 62.4±0.75ms +13.45%
Trie/ethrex-trie insert 1k 6.1±0.01ms 8.1±0.37ms +32.79%

@github-actions
Copy link

Benchmark for 5bfd315

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 34.6±0.14ms 34.7±0.14ms +0.29%
Trie/cita-trie insert 1k 3.6±0.23ms 3.6±0.19ms 0.00%
Trie/ethrex-trie insert 10k 54.4±0.37ms 61.6±1.90ms +13.24%
Trie/ethrex-trie insert 1k 6.1±0.03ms 8.0±0.02ms +31.15%

// Insert into self
self.update(value);
} else {
// Value in branches don't happen in our use-case.
Copy link
Collaborator

Choose a reason for hiding this comment

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

then below it should be unreachable!?

Copy link
Collaborator

@MegaRedHand MegaRedHand Oct 15, 2025

Choose a reason for hiding this comment

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

It can't happen in our use-case, but a user of ethrex-trie can still trigger this. We should first decide if we want to support this use-case: if we don't want to, then we can mark it as unreachable! and add a couple of checks to avoid reaching this branch, or we can add an unimplemented!, but we should document the lack of support for values in branches. I think leaving it as todo! for now would also be OK.

jrchatruc and others added 2 commits October 15, 2025 16:04
**Motivation**

Fixes devp2p tests on the path based branch

**Description**

<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves #111, Resolves #222 -->

Closes #issue_number

---------

Co-authored-by: Tomás Grüner <[email protected]>
@github-actions
Copy link

Benchmark for 0511e66

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 34.7±0.23ms 34.6±0.32ms -0.29%
Trie/cita-trie insert 1k 3.5±0.02ms 3.5±0.02ms 0.00%
Trie/ethrex-trie insert 10k 54.5±1.37ms 61.7±0.40ms +13.21%
Trie/ethrex-trie insert 1k 6.1±0.06ms 8.0±0.11ms +31.15%

@github-actions
Copy link

Benchmark for bc689a9

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.1±0.72ms 34.6±0.40ms -1.42%
Trie/cita-trie insert 1k 3.6±0.02ms 3.5±0.02ms -2.78%
Trie/ethrex-trie insert 10k 54.6±0.55ms 61.3±1.64ms +12.27%
Trie/ethrex-trie insert 1k 6.1±0.12ms 8.0±0.02ms +31.15%

@github-actions
Copy link

Benchmark for 1fefeea

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 36.0±1.27ms 35.7±1.37ms -0.83%
Trie/cita-trie insert 1k 3.6±0.03ms 3.5±0.01ms -2.78%
Trie/ethrex-trie insert 10k 54.7±0.67ms 61.9±0.66ms +13.16%
Trie/ethrex-trie insert 1k 6.1±0.11ms 8.0±0.20ms +31.15%

@github-actions
Copy link

Benchmark for 1afccbd

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.6±1.36ms 37.6±1.45ms +5.62%
Trie/cita-trie insert 1k 3.6±0.01ms 3.6±0.25ms 0.00%
Trie/ethrex-trie insert 10k 55.6±0.58ms 64.7±0.81ms +16.37%
Trie/ethrex-trie insert 1k 6.1±0.07ms 8.1±0.30ms +32.79%

@github-actions
Copy link

Benchmark for 9dd9887

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 34.9±0.77ms 34.6±0.56ms -0.86%
Trie/cita-trie insert 1k 3.5±0.01ms 3.6±0.14ms +2.86%
Trie/ethrex-trie insert 10k 54.6±0.70ms 61.7±1.14ms +13.00%
Trie/ethrex-trie insert 1k 6.1±0.04ms 8.0±0.12ms +31.15%

@github-actions
Copy link

Benchmark for 74f907d

Click to view benchmark
Test Base PR %
Trie/cita-trie insert 10k 35.3±0.27ms 35.2±0.60ms -0.28%
Trie/cita-trie insert 1k 3.5±0.01ms 3.5±0.15ms 0.00%
Trie/ethrex-trie insert 10k 54.8±0.75ms 61.8±0.59ms +12.77%
Trie/ethrex-trie insert 1k 6.1±0.07ms 7.9±0.02ms +29.51%

@jrchatruc jrchatruc added this pull request to the merge queue Oct 15, 2025
Merged via the queue into main with commit a97d6f0 Oct 15, 2025
42 checks passed
@jrchatruc jrchatruc deleted the path_based branch October 15, 2025 20:57
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l1 Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants