forked from bnb-chain/bsc
-
Notifications
You must be signed in to change notification settings - Fork 0
fast node verification #4
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
Open
kyrie-yl
wants to merge
4
commits into
separate-nodes
Choose a base branch
from
fastnode-v1
base: separate-nodes
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,6 +121,14 @@ var ( | |
| Name: "disablesnapprotocol", | ||
| Usage: "Disable snap protocol", | ||
| } | ||
| DisableDiffProtocolFlag = cli.BoolFlag{ | ||
| Name: "disablediffprotocol", | ||
| Usage: "Disable diff protocol", | ||
| } | ||
| EnableTrustProtocolFlag = cli.BoolFlag{ | ||
| Name: "enabletrustprotocol", | ||
| Usage: "Enable trust protocol", | ||
| } | ||
| DiffSyncFlag = cli.BoolFlag{ | ||
| Name: "diffsync", | ||
| Usage: "Enable diffy sync, Please note that enable diffsync will improve the syncing speed, " + | ||
|
|
@@ -259,9 +267,11 @@ var ( | |
| Usage: "The layer of tries trees that keep in memory", | ||
| Value: 128, | ||
| } | ||
| AllowInsecureNoTriesFlag = cli.BoolTFlag{ | ||
| Name: "allow-insecure-no-tries", | ||
| Usage: `Disable the tries state root verification, the state consistency is no longer 100% guaranteed, diffsync is not allowed if enabled. Do not enable it unless you know exactly what the consequence it will cause.`, | ||
| defaultVerifyMode = ethconfig.Defaults.TriesVerifyMode | ||
| TriesVerifyModeFlag = TextMarshalerFlag{ | ||
| Name: "tries-verify-mode", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better description is needed to let users understand the meaning of each mode |
||
| Usage: `tries verify mode: "local", "full", "insecure", "none"`, | ||
| Value: &defaultVerifyMode, | ||
| } | ||
| OverrideBerlinFlag = cli.Uint64Flag{ | ||
| Name: "override.berlin", | ||
|
|
@@ -1622,6 +1632,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { | |
| if ctx.GlobalIsSet(DisableSnapProtocolFlag.Name) { | ||
| cfg.DisableSnapProtocol = ctx.GlobalBool(DisableSnapProtocolFlag.Name) | ||
| } | ||
| if ctx.GlobalIsSet(DisableDiffProtocolFlag.Name) { | ||
| cfg.DisableDiffProtocol = ctx.GlobalIsSet(DisableDiffProtocolFlag.Name) | ||
| } | ||
| if ctx.GlobalIsSet(EnableTrustProtocolFlag.Name) { | ||
| cfg.EnableTrustProtocol = ctx.GlobalIsSet(EnableTrustProtocolFlag.Name) | ||
| } | ||
| if ctx.GlobalIsSet(DiffSyncFlag.Name) { | ||
| cfg.DiffSync = ctx.GlobalBool(DiffSyncFlag.Name) | ||
| } | ||
|
|
@@ -1652,8 +1668,13 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { | |
| if ctx.GlobalIsSet(TriesInMemoryFlag.Name) { | ||
| cfg.TriesInMemory = ctx.GlobalUint64(TriesInMemoryFlag.Name) | ||
| } | ||
| if ctx.GlobalIsSet(AllowInsecureNoTriesFlag.Name) { | ||
| cfg.NoTries = ctx.GlobalBool(AllowInsecureNoTriesFlag.Name) | ||
| if ctx.GlobalIsSet(TriesVerifyModeFlag.Name) { | ||
| cfg.TriesVerifyMode = *GlobalTextMarshaler(ctx, TriesVerifyModeFlag.Name).(*core.VerifyMode) | ||
| // If a node sets verify mode to full or light, it's a fast node and need | ||
| // to verify blocks from verify nodes, then it should enable trust protocol. | ||
| if cfg.TriesVerifyMode.NeedRemoteVerify() { | ||
| cfg.EnableTrustProtocol = true | ||
| } | ||
| } | ||
| if ctx.GlobalIsSet(CacheFlag.Name) || ctx.GlobalIsSet(CacheSnapshotFlag.Name) { | ||
| cfg.SnapshotCache = ctx.GlobalInt(CacheFlag.Name) * ctx.GlobalInt(CacheSnapshotFlag.Name) / 100 | ||
|
|
||
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
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
Oops, something went wrong.
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.
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.
I mean it is not proper to introduce such low level flag. Especially it is related with other flags.
For example: when
TriesVerifyModeFlagneed trust protocol whileEnableTrustProtocolFlagis false, it is become complicated.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.
Consider we should disable diff protocol in verify node, and enable trust protocol, we didn't have better solution temporary.