@@ -23,6 +23,7 @@ import (
23
23
"io"
24
24
"io/ioutil"
25
25
"math"
26
+ "math/big"
26
27
"path/filepath"
27
28
godebug "runtime/debug"
28
29
"strconv"
@@ -445,6 +446,11 @@ var (
445
446
Usage : "Multiplier applied to the gasEstimation rpc call (1 = gasEstimation, 1.3 = gasEstimation + 30%, etc. Defaults to 1.3)" ,
446
447
Value : ethconfig .Defaults .RPCGasInflationRate ,
447
448
}
449
+ RPCGlobalGasPriceMultiplierFlag = cli.Float64Flag {
450
+ Name : "rpc.gaspricemultiplier" ,
451
+ Usage : "Multiplier applied to the gasPrice rpc call (1 = gasPrice, 1.3 = gasPrice + 30%, etc. Defaults to 2.0)" ,
452
+ Value : 2.0 ,
453
+ }
448
454
RPCGlobalGasCapFlag = cli.Uint64Flag {
449
455
Name : "rpc.gascap" ,
450
456
Usage : "Sets a cap on gas that can be used in eth_call/estimateGas (0=infinite)" ,
@@ -1746,6 +1752,15 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
1746
1752
if ctx .GlobalIsSet (RPCGlobalGasInflationRateFlag .Name ) {
1747
1753
cfg .RPCGasInflationRate = ctx .GlobalFloat64 (RPCGlobalGasInflationRateFlag .Name )
1748
1754
}
1755
+ if ctx .GlobalIsSet (RPCGlobalGasPriceMultiplierFlag .Name ) {
1756
+ floatMutliplier := ctx .GlobalFloat64 (RPCGlobalGasPriceMultiplierFlag .Name )
1757
+ if floatMutliplier <= 1.0 {
1758
+ log .Warn ("Too low RPCGasPriceMultiplier, setting to 1.0" , "provided value" , floatMutliplier )
1759
+ floatMutliplier = 1.0
1760
+ }
1761
+
1762
+ cfg .RPCGasPriceMultiplier = big .NewInt (int64 (floatMutliplier * 100 ))
1763
+ }
1749
1764
if cfg .RPCGasInflationRate < 1 {
1750
1765
Fatalf ("The inflation rate shouldn't be less than 1: %f" , cfg .RPCGasInflationRate )
1751
1766
}
0 commit comments