Skip to content
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

fix: adapt journal for cmd #2425

Merged
merged 2 commits into from
Apr 28, 2024
Merged

Conversation

jingjunLi
Copy link
Contributor

@jingjunLi jingjunLi commented Apr 26, 2024

Description

A new JournalFilePath configuration has been added to triedb.Config, fix some code to adapt this config to cmd;

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

@jingjunLi jingjunLi requested a review from zzzckck as a code owner April 26, 2024 03:47
@jingjunLi jingjunLi requested review from fynnss and sysvm April 26, 2024 03:59
@@ -2430,6 +2430,12 @@ func MakeBlockDatabase(ctx *cli.Context, stack *node.Node, readonly, disableFree
return blockDb
}

func PathDBConfigAddJournalFilePath(stack *node.Node, config *pathdb.Config) *pathdb.Config {
path := stack.ResolvePath("chaindata") + "/" + eth.JournalFileName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use fmt.Sprintf() is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -2593,6 +2599,7 @@ func MakeTrieDatabase(ctx *cli.Context, disk ethdb.Database, preimage bool, read
} else {
config.PathDB = pathdb.Defaults
}
config.PathDB.JournalFilePath = stack.ResolvePath("chaindata") + "/" + eth.JournalFileName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor

@sysvm sysvm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@RenRick RenRick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zzzckck zzzckck merged commit 6573254 into bnb-chain:develop Apr 28, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants