aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2019-04-08 19:49:52 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-04-08 19:49:52 +0800
commite2f3465e83a4c03b48977ed367e68b0d63ca2ed1 (patch)
treeb8cb683600672789aa7b56ed349fbceaaa2ae4ae /cmd/utils
parented97517ff4db1982251d8bf7dbeca565159e3604 (diff)
downloadgo-tangerine-e2f3465e83a4c03b48977ed367e68b0d63ca2ed1.tar
go-tangerine-e2f3465e83a4c03b48977ed367e68b0d63ca2ed1.tar.gz
go-tangerine-e2f3465e83a4c03b48977ed367e68b0d63ca2ed1.tar.bz2
go-tangerine-e2f3465e83a4c03b48977ed367e68b0d63ca2ed1.tar.lz
go-tangerine-e2f3465e83a4c03b48977ed367e68b0d63ca2ed1.tar.xz
go-tangerine-e2f3465e83a4c03b48977ed367e68b0d63ca2ed1.tar.zst
go-tangerine-e2f3465e83a4c03b48977ed367e68b0d63ca2ed1.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/utils')
-rw-r--r--cmd/utils/flags.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index f6e428869..f5f4cde5b 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -448,6 +448,10 @@ var (
Name: "allow-insecure-unlock",
Usage: "Allow insecure account unlocking when account-related RPCs are exposed by http",
}
+ 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",
@@ -1400,6 +1404,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 {