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.

@codecov
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 62.76%. Comparing base (b4a1676) to head (48155ab).

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   62.63%   62.76%   +0.13%     
==========================================
  Files         353      354       +1     
  Lines       16943    17146     +203     
==========================================
+ Hits        10612    10762     +150     
- Misses       5480     5514      +34     
- Partials      851      870      +19     
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 3 files 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.

2 participants