Skip to content

Commit

Permalink
cmd/utils: disable snap protocol for fast node
Browse files Browse the repository at this point in the history
  • Loading branch information
weiihann committed Mar 21, 2024
1 parent 5378df3 commit e6280a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1921,6 +1921,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
if cfg.TriesVerifyMode.NeedRemoteVerify() {
cfg.EnableTrustProtocol = true
}
// A node without trie is not able to provide snap data, so it should disable snap protocol.
if cfg.TriesVerifyMode != core.LocalVerify {
log.Info("Automatically disables snap protocol due to verify mode", "mode", cfg.TriesVerifyMode)
cfg.DisableSnapProtocol = true
}
}
if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheSnapshotFlag.Name) {
cfg.SnapshotCache = ctx.Int(CacheFlag.Name) * ctx.Int(CacheSnapshotFlag.Name) / 100
Expand Down

0 comments on commit e6280a1

Please sign in to comment.