thor icon indicating copy to clipboard operation
thor copied to clipboard

maindb v4

Open qianbin opened this issue 1 year ago • 8 comments

This PR upgrades maindb to v4. It greatly reduces the storage space occupied and significantly reduces the synchronization time.

  • For MPT
    • The encoding and storage format of nodes are comprehensively improved, reducing the storage space used to store the state trie by 30%. Moreover, the speed of encoding and decoding nodes has been greatly improved.
    • Introducing the concept of Version to identify nodes, which simplifies the implementation code.
    • Optimize the trie interface to make it easier to maintain.
    • Remove leafbank stuff.
    • Improve generation-based node cache to reduce the pressure of GC.
    • Improve node storage key encoding.
  • Optimize block indexing and storage format.

Check out commits for more detail.

qianbin avatar Dec 30 '23 05:12 qianbin

Codecov Report

Attention: Patch coverage is 71.67530% with 328 lines in your changes are missing coverage. Please review.

Project coverage is 57.36%. Comparing base (d1dcdea) to head (0ebf3e7). Report is 7 commits behind head on master.

Files Patch % Lines
muxdb/trie.go 44.96% 64 Missing and 7 partials :warning:
trie/node.go 83.07% 33 Missing and 10 partials :warning:
muxdb/cache.go 68.21% 39 Missing and 2 partials :warning:
muxdb/backend.go 51.78% 26 Missing and 1 partial :warning:
chain/chain.go 57.14% 21 Missing and 3 partials :warning:
state/state.go 66.66% 15 Missing and 5 partials :warning:
chain/repository.go 74.28% 4 Missing and 14 partials :warning:
trie/hasher.go 78.57% 13 Missing and 5 partials :warning:
trie/trie.go 89.62% 11 Missing and 3 partials :warning:
muxdb/muxdb.go 0.00% 10 Missing :warning:
... and 7 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #635      +/-   ##
==========================================
+ Coverage   52.49%   57.36%   +4.86%     
==========================================
  Files         156      154       -2     
  Lines       17218    16630     -588     
==========================================
+ Hits         9038     9539     +501     
+ Misses       7339     6181    -1158     
- Partials      841      910      +69     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Dec 30 '23 05:12 codecov-commenter

Please give more details of what testing is needed

  1. try sync with and without -disable-pruner, and record the time and disk space used.
  2. test correctness of APIs

qianbin avatar Feb 27 '24 12:02 qianbin

Hi @qianbin I was playing around with your changes and wanted to share some results about the sync performance.

image

daithihearn avatar Mar 22 '24 09:03 daithihearn

Hi @qianbin I was playing around with your changes and wanted to share some results about the sync performance.

image

That's good. How about turning on -skip-logs?

qianbin avatar Mar 25 '24 02:03 qianbin

Hi @qianbin I was playing around with your changes and wanted to share some results about the sync performance. image

That's good. How about turning on -skip-logs?

I'll re-run with this parameter and post the results

Hi @qianbin I was playing around with your changes and wanted to share some results about the sync performance. image

That's good. How about turning on -skip-logs?

I'll re-run with skip logs and post the results again

daithihearn avatar Mar 26 '24 12:03 daithihearn

image image

daithihearn avatar Mar 28 '24 08:03 daithihearn

This pull request has been marked as stale due to inactivity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 18 '24 01:08 github-actions[bot]