Skip to content

Commit

Permalink
Merge pull request ethereum#513 from maticnetwork/qa-flag-requiredblocks
Browse files Browse the repository at this point in the history
Changed 'requiredblocks' flag back to 'eth.requiredblocks'
  • Loading branch information
temaniarpit27 authored Sep 8, 2022
2 parents 7bb7bac + 2cf5945 commit 0969781
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ jobs:
if: always()
run: |
cd matic-cli/devnet
docker compose down
docker compose down --remove-orphans
cd -
mkdir -p ${{ github.run_id }}/matic-cli
sudo mv bor ${{ github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion builder/files/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ syncmode = "full"
# snapshot = true
# ethstats = ""

# [requiredblocks]
# ["eth.requiredblocks"]

[p2p]
# maxpeers = 1
Expand Down
2 changes: 2 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ gcmode = "full"
snapshot = true
ethstats = ""
["eth.requiredblocks"]
[p2p]
maxpeers = 30
maxpendpeers = 50
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/server/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestFlags(t *testing.T) {
"--dev.period", "2",
"--datadir", "./data",
"--maxpeers", "30",
"--requiredblocks", "a=b",
"--eth.requiredblocks", "a=b",
"--http.api", "eth,web3,bor",
}
err := c.extractFlags(args)
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type Config struct {
Identity string `hcl:"identity,optional" toml:"identity,optional"`

// RequiredBlocks is a list of required (block number, hash) pairs to accept
RequiredBlocks map[string]string `hcl:"requiredblocks,optional" toml:"requiredblocks,optional"`
RequiredBlocks map[string]string `hcl:"eth.requiredblocks,optional" toml:"eth.requiredblocks,optional"`

// LogLevel is the level of the logs to put out
LogLevel string `hcl:"log-level,optional" toml:"log-level,optional"`
Expand Down
3 changes: 0 additions & 3 deletions internal/cli/server/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ func TestConfigLoadFile(t *testing.T) {

assert.Equal(t, config, &Config{
DataDir: "./data",
RequiredBlocks: map[string]string{
"a": "b",
},
P2P: &P2PConfig{
MaxPeers: 30,
},
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/server/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (c *Command) Flags() *flagset.Flagset {
Default: c.cliConfig.GcMode,
})
f.MapStringFlag(&flagset.MapStringFlag{
Name: "requiredblocks",
Name: "eth.requiredblocks",
Usage: "Comma separated block number-to-hash mappings to enforce (<number>=<hash>)",
Value: &c.cliConfig.RequiredBlocks,
})
Expand Down
4 changes: 0 additions & 4 deletions internal/cli/server/testdata/test.hcl
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
datadir = "./data"

requiredblocks = {
a = "b"
}

p2p {
maxpeers = 30
}
Expand Down
3 changes: 0 additions & 3 deletions internal/cli/server/testdata/test.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"datadir": "./data",
"requiredblocks": {
"a": "b"
},
"p2p": {
"maxpeers": 30
},
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/server/testdata/test.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
datadir = "./data"

[requiredblocks]
["eth.requiredblocks"]
a = "b"

[p2p]
Expand Down

0 comments on commit 0969781

Please sign in to comment.