aboutsummaryrefslogtreecommitdiffstats
path: root/eth
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 /eth
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 'eth')
-rw-r--r--eth/api_backend.go4
-rw-r--r--eth/config.go3
2 files changed, 7 insertions, 0 deletions
diff --git a/eth/api_backend.go b/eth/api_backend.go
index 29ce19e28..00424caed 100644
--- a/eth/api_backend.go
+++ b/eth/api_backend.go
@@ -218,6 +218,10 @@ func (b *EthAPIBackend) ExtRPCEnabled() bool {
return b.extRPCEnabled
}
+func (b *EthAPIBackend) RPCGasCap() *big.Int {
+ return b.eth.config.RPCGasCap
+}
+
func (b *EthAPIBackend) BloomStatus() (uint64, uint64) {
sections, _, _ := b.eth.bloomIndexer.Sections()
return params.BloomBitsBlocks, sections
diff --git a/eth/config.go b/eth/config.go
index a98e69053..d97ae3070 100644
--- a/eth/config.go
+++ b/eth/config.go
@@ -151,6 +151,9 @@ type Config struct {
// Constantinople block override (TODO: remove after the fork)
ConstantinopleOverride *big.Int
+
+ // RPCGasCap is the global gas cap for eth-call variants.
+ RPCGasCap *big.Int `toml:",omitempty"`
}
type configMarshaling struct {