-
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
cmd/geth: add hbss to pbss convert tool #1882
Conversation
2c99dfe
to
82fe65e
Compare
d21a74a
to
ac1779a
Compare
ac71133
to
85097dd
Compare
bff171f
to
ad0d995
Compare
85097dd
to
f60e666
Compare
f60e666
to
cd8817c
Compare
cmd/geth/dbcmd.go
Outdated
config := trie.HashDefaults | ||
triedb := trie.NewDatabase(db, config) | ||
triedb.Cap(0) | ||
fmt.Println("triedb scheme: ", triedb.Scheme()) |
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.
log is better, consistent with other cmds.
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.
and ditto to other fmt.Println
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.
db := utils.MakeChainDatabase(ctx, stack, false, false) | ||
defer db.Close() | ||
|
||
scheme := ctx.String(utils.StateSchemeFlag.Name) |
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.
change to ParseStateScheme?
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.
This tool may be used in the scenarios that the database which both the HBSS and PBSS trienode exist, so flags are required
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.
ParseStateScheme is uesed to handle utils.StateSchemeFlag.
4145f32
to
e4b69f7
Compare
e928905
to
b260cc9
Compare
6d75830
to
5c6dd3e
Compare
cmd/geth/dbcmd.go
Outdated
} | ||
|
||
func ancientInspect(ctx *cli.Context) error { | ||
func inspect(ctx *cli.Context) 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.
why change the function of inspect
?
from code logic, new logic is totally for different usage
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. Made a mistake when rebase code.
5c6dd3e
to
e3a7214
Compare
e3a7214
to
b8bad31
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
LGTM |
LGTM |
Description
add hbss to pbss convert tool for generate bsc snapshot more quickly.
Rationale
If starts from the genesis block to make the bsc snaoshot, it will takes 1.5~2 months.
if using the convert tools and convert hbss trie node to pbss trie node, it will takes 2~3 days.
Example
NOTICE: it will take a long time to iterate the entrie databse.
Changes
Notable changes: