good morning!!!!

Skip to content
Snippets Groups Projects
Commit be813f51 authored by Manav Darji's avatar Manav Darji
Browse files

fix: remove snapshot flag, rely on no-snapshot only

parent e3e588ef
No related branches found
No related tags found
No related merge requests found
...@@ -58,9 +58,6 @@ type Config struct { ...@@ -58,9 +58,6 @@ type Config struct {
// GcMode selects the garbage collection mode for the trie // GcMode selects the garbage collection mode for the trie
GcMode string `hcl:"gc-mode,optional"` GcMode string `hcl:"gc-mode,optional"`
// Snapshot enables the snapshot database mode
Snapshot bool `hcl:"snapshot,optional"`
// NoSnapshot disbales the snapshot database mode // NoSnapshot disbales the snapshot database mode
NoSnapshot bool `hcl:"no-snapshot,optional"` NoSnapshot bool `hcl:"no-snapshot,optional"`
...@@ -411,7 +408,6 @@ func DefaultConfig() *Config { ...@@ -411,7 +408,6 @@ func DefaultConfig() *Config {
}, },
SyncMode: "full", SyncMode: "full",
GcMode: "full", GcMode: "full",
Snapshot: true,
NoSnapshot: false, NoSnapshot: false,
TxPool: &TxPoolConfig{ TxPool: &TxPoolConfig{
Locals: []string{}, Locals: []string{},
...@@ -814,7 +810,7 @@ func (c *Config) buildEth(stack *node.Node) (*ethconfig.Config, error) { ...@@ -814,7 +810,7 @@ func (c *Config) buildEth(stack *node.Node) (*ethconfig.Config, error) {
} }
// snapshot disable check // snapshot disable check
if !c.Snapshot { if c.NoSnapshot {
if n.SyncMode == downloader.SnapSync { if n.SyncMode == downloader.SnapSync {
log.Info("Snap sync requested, enabling --snapshot") log.Info("Snap sync requested, enabling --snapshot")
} else { } else {
...@@ -940,11 +936,6 @@ func (c *Config) Merge(cc ...*Config) error { ...@@ -940,11 +936,6 @@ func (c *Config) Merge(cc ...*Config) error {
if elem.P2P.MaxPeers == 0 { if elem.P2P.MaxPeers == 0 {
c.P2P.MaxPeers = 0 c.P2P.MaxPeers = 0
} }
// update snapshot db mode
if elem.NoSnapshot {
c.Snapshot = false
}
} }
return nil return nil
} }
......
...@@ -23,7 +23,7 @@ func TestConfigDefault(t *testing.T) { ...@@ -23,7 +23,7 @@ func TestConfigDefault(t *testing.T) {
func TestConfigMerge(t *testing.T) { func TestConfigMerge(t *testing.T) {
c0 := &Config{ c0 := &Config{
Chain: "0", Chain: "0",
Snapshot: true, NoSnapshot: true,
Whitelist: map[string]string{ Whitelist: map[string]string{
"a": "b", "a": "b",
}, },
...@@ -54,7 +54,7 @@ func TestConfigMerge(t *testing.T) { ...@@ -54,7 +54,7 @@ func TestConfigMerge(t *testing.T) {
} }
expected := &Config{ expected := &Config{
Chain: "1", Chain: "1",
Snapshot: true, NoSnapshot: true,
Whitelist: map[string]string{ Whitelist: map[string]string{
"a": "b", "a": "b",
"b": "c", "b": "c",
......
...@@ -49,14 +49,9 @@ func (c *Command) Flags() *flagset.Flagset { ...@@ -49,14 +49,9 @@ func (c *Command) Flags() *flagset.Flagset {
Usage: "Comma separated block number-to-hash mappings to enforce (<number>=<hash>)", Usage: "Comma separated block number-to-hash mappings to enforce (<number>=<hash>)",
Value: &c.cliConfig.Whitelist, Value: &c.cliConfig.Whitelist,
}) })
f.BoolFlag(&flagset.BoolFlag{
Name: "snapshot",
Usage: `Enables snapshot-database mode (default = enable)`,
Value: &c.cliConfig.Snapshot,
})
f.BoolFlag(&flagset.BoolFlag{ f.BoolFlag(&flagset.BoolFlag{
Name: "no-snapshot", Name: "no-snapshot",
Usage: `Disables the snapshot-database mode`, Usage: `Disables the snapshot-database mode (default = false)`,
Value: &c.cliConfig.NoSnapshot, Value: &c.cliConfig.NoSnapshot,
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment