-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support separate trie database #2021
Conversation
25f8873
to
c1b812c
Compare
4fe0ab8
to
523ed87
Compare
8b18c3d
to
2b7cb26
Compare
5f01167
to
5672be8
Compare
8a4198b
to
aa616b6
Compare
Can users merge separate trie db? |
not needed for now |
e9f15b2
to
1622f54
Compare
@@ -659,14 +690,14 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error { | |||
bodies.Add(size) | |||
case bytes.HasPrefix(key, blockReceiptsPrefix) && len(key) == (len(blockReceiptsPrefix)+8+common.HashLength): | |||
receipts.Add(size) | |||
case IsLegacyTrieNode(key, it.Value()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why move it from 668-669 to 693-694?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
38e115d
to
8c13f99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
core/rawdb/ancient_utils.go
Outdated
@@ -91,7 +91,8 @@ func inspectFreezers(db ethdb.Database) ([]freezerInfo, error) { | |||
infos = append(infos, info) | |||
|
|||
case StateFreezerName: | |||
if ReadStateScheme(db) != PathScheme { | |||
if | |||
ReadStateScheme(db) != PathScheme { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the lint error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -659,14 +690,14 @@ func InspectDatabase(db ethdb.Database, keyPrefix, keyStart []byte) error { | |||
bodies.Add(size) | |||
case bytes.HasPrefix(key, blockReceiptsPrefix) && len(key) == (len(blockReceiptsPrefix)+8+common.HashLength): | |||
receipts.Add(size) | |||
case IsLegacyTrieNode(key, it.Value()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
1ff5ef1
to
53f32a1
Compare
53f32a1
to
32159eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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: