feat: support separate trie database#2021
Merged
flywukong merged 18 commits intobnb-chain:developfrom Mar 8, 2024
Merged
Conversation
25f8873 to
c1b812c
Compare
sysvm
reviewed
Dec 7, 2023
sysvm
reviewed
Dec 7, 2023
sysvm
reviewed
Dec 7, 2023
sysvm
reviewed
Dec 7, 2023
4fe0ab8 to
523ed87
Compare
8b18c3d to
2b7cb26
Compare
fynnss
reviewed
Jan 18, 2024
5f01167 to
5672be8
Compare
sysvm
reviewed
Jan 19, 2024
jingjunLi
reviewed
Jan 22, 2024
8a4198b to
aa616b6
Compare
sysvm
reviewed
Jan 31, 2024
sysvm
reviewed
Jan 31, 2024
sysvm
reviewed
Jan 31, 2024
Contributor
|
Can users merge separate trie db? |
Contributor
Author
not needed for now |
fynnss
reviewed
Feb 1, 2024
e9f15b2 to
1622f54
Compare
fynnss
reviewed
Mar 5, 2024
| bodies.Add(size) | ||
| case bytes.HasPrefix(key, blockReceiptsPrefix) && len(key) == (len(blockReceiptsPrefix)+8+common.HashLength): | ||
| receipts.Add(size) | ||
| case IsLegacyTrieNode(key, it.Value()): |
Contributor
There was a problem hiding this comment.
Why move it from 668-669 to 693-694?
Contributor
Author
There was a problem hiding this comment.
it is a known issue of inspect db , the precondition of the judgment conditions is used to avoid identifying some header metadata as hash trie data.
38e115d to
8c13f99
Compare
fynnss
previously approved these changes
Mar 6, 2024
core/rawdb/ancient_utils.go
Outdated
| case StateFreezerName: | ||
| if ReadStateScheme(db) != PathScheme { | ||
| if | ||
| ReadStateScheme(db) != PathScheme { |
| bodies.Add(size) | ||
| case bytes.HasPrefix(key, blockReceiptsPrefix) && len(key) == (len(blockReceiptsPrefix)+8+common.HashLength): | ||
| receipts.Add(size) | ||
| case IsLegacyTrieNode(key, it.Value()): |
1ff5ef1 to
53f32a1
Compare
53f32a1 to
32159eb
Compare
This was referenced Mar 12, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces the functionality to run node with a separate trie database on a distinct disk or directory. This proposal aims to alleviate the bandwidth strain on the current key-value database, while also streamlining and simplifying the log-structured merge (LSM) of the database. These enhancements are anticipated to improve the read performance of the database and subsequently enhance the performance of geth.
Specifically, the PR includes the following features:
The inspected data below pertains to the execution of a fullnode in PBSS+Pebble mode across two separate disks.
This one shows the separate trie db

This one the db without trie data and ancient state

Rationale
Blow is the test result using different disk resource for trie.

avg import cost geth with single db is 324 ms while the cost of geth with seprated db is 291 ms.
The performance using seprated db has improve 10% (95 percent )
Example
Changes
Notable changes: