mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
added support for miner.recommit flag (#743)
This commit is contained in:
parent
c917e6fe68
commit
238b4496d8
14 changed files with 27 additions and 0 deletions
|
|
@ -58,6 +58,7 @@ syncmode = "full"
|
|||
# mine = true
|
||||
# etherbase = "VALIDATOR ADDRESS"
|
||||
# extradata = ""
|
||||
# recommit = "2m5s"
|
||||
|
||||
|
||||
# [jsonrpc]
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ devfakeauthor = false # Run miner without validator set authorization [de
|
|||
extradata = "" # Block extra data set by the miner (default = client version)
|
||||
gaslimit = 30000000 # Target gas ceiling for mined blocks
|
||||
gasprice = "1000000000" # Minimum gas price for mining a transaction (recommended for mainnet = 30000000000, default suitable for mumbai/devnet)
|
||||
recommit = "2m5s" # The time interval for miner to re-create mining work
|
||||
|
||||
[jsonrpc]
|
||||
ipcdisable = false # Disable the IPC-RPC server
|
||||
|
|
|
|||
|
|
@ -168,6 +168,8 @@ The ```bor server``` command runs the Bor client.
|
|||
|
||||
- ```miner.gasprice```: Minimum gas price for mining a transaction (default: 1000000000)
|
||||
|
||||
- ```miner.recommit```: The time interval for miner to re-create mining work (default: 2m5s)
|
||||
|
||||
### Telemetry Options
|
||||
|
||||
- ```metrics```: Enable metrics collection and reporting (default: false)
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ func (c *DumpconfigCommand) Run(args []string) int {
|
|||
userConfig.TxPool.RejournalRaw = userConfig.TxPool.Rejournal.String()
|
||||
userConfig.TxPool.LifeTimeRaw = userConfig.TxPool.LifeTime.String()
|
||||
userConfig.Sealer.GasPriceRaw = userConfig.Sealer.GasPrice.String()
|
||||
userConfig.Sealer.RecommitRaw = userConfig.Sealer.Recommit.String()
|
||||
userConfig.Gpo.MaxPriceRaw = userConfig.Gpo.MaxPrice.String()
|
||||
userConfig.Gpo.IgnorePriceRaw = userConfig.Gpo.IgnorePrice.String()
|
||||
userConfig.Cache.RejournalRaw = userConfig.Cache.Rejournal.String()
|
||||
|
|
|
|||
|
|
@ -235,6 +235,10 @@ type SealerConfig struct {
|
|||
// GasPrice is the minimum gas price for mining a transaction
|
||||
GasPrice *big.Int `hcl:"-,optional" toml:"-"`
|
||||
GasPriceRaw string `hcl:"gasprice,optional" toml:"gasprice,optional"`
|
||||
|
||||
// The time interval for miner to re-create mining work.
|
||||
Recommit time.Duration `hcl:"-,optional" toml:"-"`
|
||||
RecommitRaw string `hcl:"recommit,optional" toml:"recommit,optional"`
|
||||
}
|
||||
|
||||
type JsonRPCConfig struct {
|
||||
|
|
@ -505,6 +509,7 @@ func DefaultConfig() *Config {
|
|||
GasCeil: 30_000_000, // geth's default
|
||||
GasPrice: big.NewInt(1 * params.GWei), // geth's default
|
||||
ExtraData: "",
|
||||
Recommit: 125 * time.Second,
|
||||
},
|
||||
Gpo: &GpoConfig{
|
||||
Blocks: 20,
|
||||
|
|
@ -638,6 +643,7 @@ func (c *Config) fillTimeDurations() error {
|
|||
td *time.Duration
|
||||
str *string
|
||||
}{
|
||||
{"miner.recommit", &c.Sealer.Recommit, &c.Sealer.RecommitRaw},
|
||||
{"jsonrpc.timeouts.read", &c.JsonRPC.HttpTimeout.ReadTimeout, &c.JsonRPC.HttpTimeout.ReadTimeoutRaw},
|
||||
{"jsonrpc.timeouts.write", &c.JsonRPC.HttpTimeout.WriteTimeout, &c.JsonRPC.HttpTimeout.WriteTimeoutRaw},
|
||||
{"jsonrpc.timeouts.idle", &c.JsonRPC.HttpTimeout.IdleTimeout, &c.JsonRPC.HttpTimeout.IdleTimeoutRaw},
|
||||
|
|
@ -758,6 +764,7 @@ func (c *Config) buildEth(stack *node.Node, accountManager *accounts.Manager) (*
|
|||
|
||||
// miner options
|
||||
{
|
||||
n.Miner.Recommit = c.Sealer.Recommit
|
||||
n.Miner.GasPrice = c.Sealer.GasPrice
|
||||
n.Miner.GasCeil = c.Sealer.GasCeil
|
||||
n.Miner.ExtraData = []byte(c.Sealer.ExtraData)
|
||||
|
|
|
|||
|
|
@ -247,6 +247,13 @@ func (c *Command) Flags() *flagset.Flagset {
|
|||
Group: "Sealer",
|
||||
Default: c.cliConfig.Sealer.GasPrice,
|
||||
})
|
||||
f.DurationFlag(&flagset.DurationFlag{
|
||||
Name: "miner.recommit",
|
||||
Usage: "The time interval for miner to re-create mining work",
|
||||
Value: &c.cliConfig.Sealer.Recommit,
|
||||
Default: c.cliConfig.Sealer.Recommit,
|
||||
Group: "Sealer",
|
||||
})
|
||||
|
||||
// ethstats
|
||||
f.StringFlag(&flagset.StringFlag{
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ gcmode = "archive"
|
|||
# mine = false
|
||||
# etherbase = ""
|
||||
# extradata = ""
|
||||
# recommit = "2m5s"
|
||||
|
||||
[jsonrpc]
|
||||
ipcpath = "/var/lib/bor/bor.ipc"
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ syncmode = "full"
|
|||
# mine = false
|
||||
# etherbase = ""
|
||||
# extradata = ""
|
||||
# recommit = "2m5s"
|
||||
|
||||
[jsonrpc]
|
||||
ipcpath = "/var/lib/bor/bor.ipc"
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ syncmode = "full"
|
|||
gasprice = "30000000000"
|
||||
# etherbase = ""
|
||||
# extradata = ""
|
||||
# recommit = "2m5s"
|
||||
|
||||
[jsonrpc]
|
||||
ipcpath = "/var/lib/bor/bor.ipc"
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ syncmode = "full"
|
|||
gasprice = "30000000000"
|
||||
# etherbase = ""
|
||||
# extradata = ""
|
||||
# recommit = "2m5s"
|
||||
|
||||
[jsonrpc]
|
||||
ipcpath = "/var/lib/bor/bor.ipc"
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ gcmode = "archive"
|
|||
# mine = false
|
||||
# etherbase = ""
|
||||
# extradata = ""
|
||||
# recommit = "2m5s"
|
||||
|
||||
[jsonrpc]
|
||||
ipcpath = "/var/lib/bor/bor.ipc"
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ syncmode = "full"
|
|||
# mine = false
|
||||
# etherbase = ""
|
||||
# extradata = ""
|
||||
# recommit = "2m5s"
|
||||
|
||||
[jsonrpc]
|
||||
ipcpath = "/var/lib/bor/bor.ipc"
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ syncmode = "full"
|
|||
# gasprice = "1000000000"
|
||||
# etherbase = ""
|
||||
# extradata = ""
|
||||
# recommit = "2m5s"
|
||||
|
||||
[jsonrpc]
|
||||
ipcpath = "/var/lib/bor/bor.ipc"
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ syncmode = "full"
|
|||
# gasprice = "1000000000"
|
||||
# etherbase = ""
|
||||
# extradata = ""
|
||||
# recommit = "2m5s"
|
||||
|
||||
[jsonrpc]
|
||||
ipcpath = "/var/lib/bor/bor.ipc"
|
||||
|
|
|
|||
Loading…
Reference in a new issue