Skip to content

Conversation

@MaksymMalicki
Copy link
Contributor

@MaksymMalicki MaksymMalicki commented Nov 20, 2025

It introduces rawDB engine for the trie2, which is used by the new state. In this PR:

  • The new package with rawDB is created. The structure of the package is quite simple and follows the pattern of pathdb and hashdb both in structure and interfaces.
  • Contract, Class and Contract Storages are written directly to the pebbleDB and read directly from it. The writing is done in the Update() method, which takes the nodesets generated by trie2.Commit(), flattens them and writes them to the DB. For reading, the readNode() method was introduced.
  • For the new State, Juno defaults to rawdb as a triedb engine

Next PR to review: #3283

@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 64.10256% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.17%. Comparing base (d1a8930) to head (2168fca).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
core/trie2/triedb/rawdb/database.go 68.33% 16 Missing and 3 partials ⚠️
core/trie2/triedb/database.go 28.57% 5 Missing ⚠️
core/trie2/triedb/hashdb/database.go 0.00% 2 Missing ⚠️
core/trie2/triedb/pathdb/database.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3282      +/-   ##
==========================================
- Coverage   76.20%   76.17%   -0.03%     
==========================================
  Files         338      340       +2     
  Lines       32575    32611      +36     
==========================================
+ Hits        24823    24842      +19     
- Misses       5958     5970      +12     
- Partials     1794     1799       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@rodrodros rodrodros left a comment

Choose a reason for hiding this comment

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

Looks good overall

Copy link
Contributor

@EgeCaner EgeCaner left a comment

Choose a reason for hiding this comment

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

Looks good! Some nitpicks

Copy link
Collaborator

@rodrodros rodrodros left a comment

Choose a reason for hiding this comment

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

I just realized that the code has no tests. If it is something that was done before, it's ok, but we should change it starting from this PR

Copy link
Contributor

@EgeCaner EgeCaner left a comment

Choose a reason for hiding this comment

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

Some minor comments, rest looks good to me!

Copy link
Contributor

@infrmtcs infrmtcs left a comment

Choose a reason for hiding this comment

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

I finished my first round, please ping me after you address the comments, thanks

@rodrodros rodrodros enabled auto-merge (squash) December 2, 2025 14:02
@rodrodros rodrodros merged commit 6fed3dc into main Dec 2, 2025
16 checks passed
@rodrodros rodrodros deleted the maksym/rawdb-clean branch December 2, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants