Skip to content

Conversation

abi87
Copy link
Collaborator

@abi87 abi87 commented May 20, 2025

Introduce deposit store v2 which leverate a IAVL store to efficiently calculate deposits root.
While v1 needs to load all historical deposits and hash them together to get said root, which is a O(N) operation, the merkleDB allows doing it with O( log N) complexity (what it takes to recalculate the root of an append only tree), at the cost of somewhat larger storage (in a complete binary tree, there are as many intermediate nodes as leaves, so say double storage).
Data migration code is added, which allow a coordinate transfer of deposits from storeV1 to storeV2 but code is not hooked up to production code.

Copy link

codecov bot commented May 20, 2025

Codecov Report

❌ Patch coverage is 61.72249% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.59%. Comparing base (76f873f) to head (142d248).

Files with missing lines Patch % Lines
storage/deposit/v2/store.go 64.34% 34 Missing and 12 partials ⚠️
storage/deposit/store.go 58.10% 24 Missing and 7 partials ⚠️
node-core/components/deposit_store.go 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2779      +/-   ##
==========================================
+ Coverage   60.53%   60.59%   +0.05%     
==========================================
  Files         356      357       +1     
  Lines       16824    17027     +203     
==========================================
+ Hits        10185    10318     +133     
- Misses       5841     5891      +50     
- Partials      798      818      +20     
Files with missing lines Coverage Δ
node-core/components/deposit_store.go 71.42% <50.00%> (-8.58%) ⬇️
storage/deposit/store.go 66.05% <58.10%> (-19.32%) ⬇️
storage/deposit/v2/store.go 64.34% <64.34%> (ø)

... and 1 file with indirect coverage changes

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

@abi87 abi87 marked this pull request as ready for review May 20, 2025 11:05
@abi87 abi87 requested a review from a team as a code owner May 20, 2025 11:05
@abi87 abi87 self-assigned this May 20, 2025
Base automatically changed from consolidate-deposits-storage-pt1 to main May 30, 2025 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant