Skip to content

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

Merged
zzzckck merged 1 commit intobnb-chain:developfrom
weiihann:develop/fast-with-snap
Mar 21, 2024
Merged

cmd/utils: disable snap protocol for fast node#2234
zzzckck merged 1 commit intobnb-chain:developfrom
weiihann:develop/fast-with-snap

Conversation

@weiihann
Copy link
Copy Markdown
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
Copy Markdown
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
cfg.EnableTrustProtocol = true
}

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

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
Copy Markdown
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
@weiihann weiihann force-pushed the develop/fast-with-snap branch from 80daa47 to e6280a1 Compare March 21, 2024 04:40
@weiihann weiihann force-pushed the develop/fast-with-snap branch from e6280a1 to 8430242 Compare March 21, 2024 04:43
Copy link
Copy Markdown
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.

👍

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