From e872ba7a9e8123a4010198ee8dfaada9f71fa24a Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Mon, 8 Apr 2019 13:49:52 +0200 Subject: 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 --- eth/api_backend.go | 4 ++++ eth/config.go | 3 +++ 2 files changed, 7 insertions(+) (limited to 'eth') diff --git a/eth/api_backend.go b/eth/api_backend.go index a48815e0d..3efc09cc1 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -213,6 +213,10 @@ func (b *EthAPIBackend) AccountManager() *accounts.Manager { return b.eth.AccountManager() } +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 7c041d1af..5b9db2502 100644 --- a/eth/config.go +++ b/eth/config.go @@ -135,6 +135,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 { -- cgit v1.2.3