diff options
author | Martin Holst Swende <martin@swende.se> | 2019-04-08 19:49:52 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-04-08 20:15:13 +0800 |
commit | e872ba7a9e8123a4010198ee8dfaada9f71fa24a (patch) | |
tree | 11a3ae72a1ee1854fc77795c76c232fcde0cd186 /cmd | |
parent | 9d9c6b5847bfd1267c2fee60f5a5b05bdaaf4216 (diff) | |
download | go-tangerine-e872ba7a9e8123a4010198ee8dfaada9f71fa24a.tar go-tangerine-e872ba7a9e8123a4010198ee8dfaada9f71fa24a.tar.gz go-tangerine-e872ba7a9e8123a4010198ee8dfaada9f71fa24a.tar.bz2 go-tangerine-e872ba7a9e8123a4010198ee8dfaada9f71fa24a.tar.lz go-tangerine-e872ba7a9e8123a4010198ee8dfaada9f71fa24a.tar.xz go-tangerine-e872ba7a9e8123a4010198ee8dfaada9f71fa24a.tar.zst go-tangerine-e872ba7a9e8123a4010198ee8dfaada9f71fa24a.zip |
eth, les, geth: implement cli-configurable global gas cap for RPC calls (#19401)
* eth, les, geth: implement cli-configurable global gas cap for RPC calls
* graphql, ethapi: place gas cap in DoCall
* ethapi: reformat log message
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/geth/main.go | 3 | ||||
-rw-r--r-- | cmd/geth/usage.go | 1 | ||||
-rw-r--r-- | cmd/utils/flags.go | 7 |
3 files changed, 9 insertions, 2 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go index e60a27e43..458608112 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -125,8 +125,6 @@ var ( utils.VMEnableDebugFlag, utils.NetworkIdFlag, utils.ConstantinopleOverrideFlag, - utils.RPCCORSDomainFlag, - utils.RPCVirtualHostsFlag, utils.EthStatsURLFlag, utils.MetricsEnabledFlag, utils.FakePoWFlag, @@ -150,6 +148,7 @@ var ( utils.WSAllowedOriginsFlag, utils.IPCDisabledFlag, utils.IPCPathFlag, + utils.RPCGlobalGasCap, } whisperFlags = []cli.Flag{ diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index 6823aa36c..259e6d30a 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -153,6 +153,7 @@ var AppHelpFlagGroups = []flagGroup{ utils.RPCListenAddrFlag, utils.RPCPortFlag, utils.RPCApiFlag, + utils.RPCGlobalGasCap, utils.WSEnabledFlag, utils.WSListenAddrFlag, utils.WSPortFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 55e84b876..052660ba1 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -411,6 +411,10 @@ var ( Name: "vmdebug", Usage: "Record information useful for VM and contract debugging", } + RPCGlobalGasCap = cli.Uint64Flag{ + Name: "rpc.gascap", + Usage: "Sets a cap on gas that can be used in eth_call/estimateGas", + } // Logging and debug settings EthStatsURLFlag = cli.StringFlag{ Name: "ethstats", @@ -1256,6 +1260,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) { if ctx.GlobalIsSet(EVMInterpreterFlag.Name) { cfg.EVMInterpreter = ctx.GlobalString(EVMInterpreterFlag.Name) } + if ctx.GlobalIsSet(RPCGlobalGasCap.Name) { + cfg.RPCGasCap = new(big.Int).SetUint64(ctx.GlobalUint64(RPCGlobalGasCap.Name)) + } // Override any default configs for hard coded networks. switch { |