good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
be813f51
Commit
be813f51
authored
Apr 6, 2022
by
Manav Darji
Browse files
Options
Downloads
Patches
Plain Diff
fix: remove snapshot flag, rely on no-snapshot only
parent
e3e588ef
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
internal/cli/server/config.go
+1
-10
1 addition, 10 deletions
internal/cli/server/config.go
internal/cli/server/config_test.go
+4
-4
4 additions, 4 deletions
internal/cli/server/config_test.go
internal/cli/server/flags.go
+1
-6
1 addition, 6 deletions
internal/cli/server/flags.go
with
6 additions
and
20 deletions
internal/cli/server/config.go
+
1
−
10
View file @
be813f51
...
@@ -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
.
No
Snapshot
{
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
}
}
...
...
This diff is collapsed.
Click to expand it.
internal/cli/server/config_test.go
+
4
−
4
View file @
be813f51
...
@@ -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
,
No
Snapshot
:
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
,
No
Snapshot
:
true
,
Whitelist
:
map
[
string
]
string
{
Whitelist
:
map
[
string
]
string
{
"a"
:
"b"
,
"a"
:
"b"
,
"b"
:
"c"
,
"b"
:
"c"
,
...
...
This diff is collapsed.
Click to expand it.
internal/cli/server/flags.go
+
1
−
6
View file @
be813f51
...
@@ -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
,
})
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment