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

cmd/utils: disable snap protocol for fast node #2234

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

weiihann
Copy link
Contributor

Description

This PR adds a logic check such that if the node is fast node (i.e. --tries-verify-mode is not local), then it will disable the snap protocol by default.

Rationale

When serving snap data (i.e. AccountRange, StorageRange, TrieNodes), access to a complete state trie is necessary. However, for fast nodes, since they only store the snapshot, they can't service these requests. Disabling this snap protocol by default may help reduce network calls and processing time for the nodes in general.

@weiihann weiihann changed the base branch from master to develop February 23, 2024 06:37
zzzckck
zzzckck previously approved these changes Feb 26, 2024
Copy link
Collaborator

@zzzckck zzzckck left a comment

Choose a reason for hiding this comment

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

LGTM

zlacfzy
zlacfzy previously approved these changes Mar 21, 2024
@zzzckck zzzckck dismissed stale reviews from zlacfzy and themself via 80daa47 March 21, 2024 03:44
zlacfzy
zlacfzy previously approved these changes Mar 21, 2024
zzzckck
zzzckck previously approved these changes Mar 21, 2024
cmd/utils/flags.go Outdated Show resolved Hide resolved
@@ -1954,6 +1954,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
cfg.EnableTrustProtocol = true
}

// A node without trie is not able to provide snap data, so it should disable snap protocol.
Copy link
Collaborator

Choose a reason for hiding this comment

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

if disable
fast node can do snap sync?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you meant when a node starts with a fast node, which does full sync, then later on becomes a full node and does snap sync again, will it work? I'm not entirely sure, my intuition is that it doesn't work.

@weiihann weiihann dismissed stale reviews from zzzckck and zlacfzy via e6280a1 March 21, 2024 04:40
Copy link
Contributor

@MatusKysel MatusKysel left a comment

Choose a reason for hiding this comment

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

👍

@zzzckck zzzckck merged commit 84c3658 into bnb-chain:develop Mar 21, 2024
7 checks passed
@Pjrich1313 Pjrich1313 mentioned this pull request Mar 27, 2024
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.

5 participants