From 8186e4d2a1721fcbe9c2ac86628f5463f9b730a0 Mon Sep 17 00:00:00 2001 From: Shivam Sharma Date: Wed, 24 Aug 2022 14:58:38 +0530 Subject: [PATCH 1/4] chg : sealer.gasPrice to 1 from 30Gwei --- internal/cli/server/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cli/server/config.go b/internal/cli/server/config.go index 7dcc986c01..360abfa226 100644 --- a/internal/cli/server/config.go +++ b/internal/cli/server/config.go @@ -437,7 +437,7 @@ func DefaultConfig() *Config { Enabled: false, Etherbase: "", GasCeil: 20000000, - GasPrice: big.NewInt(30 * params.GWei), + GasPrice: big.NewInt(1), ExtraData: "", }, Gpo: &GpoConfig{ From 632c1646a863eb478d8358e109c43fbbb44e7a44 Mon Sep 17 00:00:00 2001 From: Shivam Sharma Date: Thu, 25 Aug 2022 12:47:54 +0530 Subject: [PATCH 2/4] chg : default sealer.gasPrice from 1wei to 1Gwei --- internal/cli/server/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cli/server/config.go b/internal/cli/server/config.go index 360abfa226..8a338d2ef5 100644 --- a/internal/cli/server/config.go +++ b/internal/cli/server/config.go @@ -437,7 +437,7 @@ func DefaultConfig() *Config { Enabled: false, Etherbase: "", GasCeil: 20000000, - GasPrice: big.NewInt(1), + GasPrice: big.NewInt(1 * params.GWei), ExtraData: "", }, Gpo: &GpoConfig{ From eb16a3d313e3da5649b14a27c12ecc0be6db5ee3 Mon Sep 17 00:00:00 2001 From: Manav Darji Date: Fri, 26 Aug 2022 11:24:51 +0530 Subject: [PATCH 3/4] update defaults in new-cli --- internal/cli/server/config.go | 20 ++++++++++---------- internal/cli/server/config_legacy_test.go | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/internal/cli/server/config.go b/internal/cli/server/config.go index 8a338d2ef5..c6193e6e76 100644 --- a/internal/cli/server/config.go +++ b/internal/cli/server/config.go @@ -423,7 +423,7 @@ func DefaultConfig() *Config { TxPool: &TxPoolConfig{ Locals: []string{}, NoLocals: false, - Journal: "", + Journal: "transactions.rlp", Rejournal: 1 * time.Hour, PriceLimit: 1, PriceBump: 10, @@ -436,7 +436,7 @@ func DefaultConfig() *Config { Sealer: &SealerConfig{ Enabled: false, Etherbase: "", - GasCeil: 20000000, + GasCeil: 30_000_000, GasPrice: big.NewInt(1 * params.GWei), ExtraData: "", }, @@ -457,22 +457,22 @@ func DefaultConfig() *Config { Prefix: "", Host: "localhost", API: []string{"eth", "net", "web3", "txpool", "bor"}, - Cors: []string{"*"}, - VHost: []string{"*"}, + Cors: []string{"localhost"}, + VHost: []string{"localhost"}, }, Ws: &APIConfig{ Enabled: false, Port: 8546, Prefix: "", Host: "localhost", - API: []string{"web3", "net"}, - Cors: []string{"*"}, - VHost: []string{"*"}, + API: []string{"net", "web3"}, + Cors: []string{"localhost"}, + VHost: []string{"localhost"}, }, Graphql: &APIConfig{ Enabled: false, - Cors: []string{"*"}, - VHost: []string{"*"}, + Cors: []string{"localhost"}, + VHost: []string{"localhost"}, }, }, Ethstats: "", @@ -511,7 +511,7 @@ func DefaultConfig() *Config { PasswordFile: "", AllowInsecureUnlock: false, UseLightweightKDF: false, - DisableBorWallet: false, + DisableBorWallet: true, }, GRPC: &GRPCConfig{ Addr: ":3131", diff --git a/internal/cli/server/config_legacy_test.go b/internal/cli/server/config_legacy_test.go index 43263ff010..631542db43 100644 --- a/internal/cli/server/config_legacy_test.go +++ b/internal/cli/server/config_legacy_test.go @@ -140,7 +140,7 @@ func TestConfigLegacy(t *testing.T) { PasswordFile: "", AllowInsecureUnlock: false, UseLightweightKDF: false, - DisableBorWallet: false, + DisableBorWallet: true, }, GRPC: &GRPCConfig{ Addr: ":3131", From 1ac5f09518e1c1f4d28f97896b2930dc65609c31 Mon Sep 17 00:00:00 2001 From: Shivam Sharma Date: Fri, 26 Aug 2022 14:08:15 +0530 Subject: [PATCH 4/4] fix : TestConfigLegacy --- internal/cli/server/config_legacy_test.go | 28 ++++++++++++----------- internal/cli/server/testdata/test.toml | 4 ++-- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/internal/cli/server/config_legacy_test.go b/internal/cli/server/config_legacy_test.go index 631542db43..e22639fa7e 100644 --- a/internal/cli/server/config_legacy_test.go +++ b/internal/cli/server/config_legacy_test.go @@ -14,10 +14,10 @@ import ( func TestConfigLegacy(t *testing.T) { readFile := func(path string) { - config, err := readLegacyConfig(path) + expectedConfig, err := readLegacyConfig(path) assert.NoError(t, err) - assert.Equal(t, config, &Config{ + testConfig := &Config{ Chain: "mainnet", Identity: Hostname(), RequiredBlocks: map[string]string{ @@ -52,7 +52,7 @@ func TestConfigLegacy(t *testing.T) { TxPool: &TxPoolConfig{ Locals: []string{}, NoLocals: false, - Journal: "", + Journal: "transactions.rlp", Rejournal: 1 * time.Hour, PriceLimit: 1, PriceBump: 10, @@ -65,8 +65,8 @@ func TestConfigLegacy(t *testing.T) { Sealer: &SealerConfig{ Enabled: false, Etherbase: "", - GasCeil: 20000000, - GasPrice: big.NewInt(30000000000), + GasCeil: 30000000, + GasPrice: big.NewInt(1 * params.GWei), ExtraData: "", }, Gpo: &GpoConfig{ @@ -86,22 +86,22 @@ func TestConfigLegacy(t *testing.T) { Prefix: "", Host: "localhost", API: []string{"eth", "net", "web3", "txpool", "bor"}, - Cors: []string{"*"}, - VHost: []string{"*"}, + Cors: []string{"localhost"}, + VHost: []string{"localhost"}, }, Ws: &APIConfig{ Enabled: false, Port: 8546, Prefix: "", Host: "localhost", - API: []string{"web3", "net"}, - Cors: []string{"*"}, - VHost: []string{"*"}, + API: []string{"net", "web3"}, + Cors: []string{"localhost"}, + VHost: []string{"localhost"}, }, Graphql: &APIConfig{ Enabled: false, - Cors: []string{"*"}, - VHost: []string{"*"}, + Cors: []string{"localhost"}, + VHost: []string{"localhost"}, }, }, Ethstats: "", @@ -149,7 +149,9 @@ func TestConfigLegacy(t *testing.T) { Enabled: false, Period: 0, }, - }) + } + + assert.Equal(t, expectedConfig, testConfig) } // read file in hcl format diff --git a/internal/cli/server/testdata/test.toml b/internal/cli/server/testdata/test.toml index ecc313b5b5..2277e03664 100644 --- a/internal/cli/server/testdata/test.toml +++ b/internal/cli/server/testdata/test.toml @@ -12,8 +12,8 @@ lifetime = "1s" [miner] mine = false -gaslimit = 20000000 -gasprice = "30000000000" +gaslimit = 30000000 +gasprice = "1000000000" [gpo] ignoreprice = "4"