From 1f51b73d71ee9a9621f915a85f3f07929c35f4f0 Mon Sep 17 00:00:00 2001 From: Austin Abell Date: Thu, 7 Nov 2019 13:02:35 -0500 Subject: [PATCH] Fix block gas limit return for dev tooling (#150) * cap formatted -1 value of tendermint block gas limit * return blank miner address for dev tooling checks --- rpc/eth_api.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rpc/eth_api.go b/rpc/eth_api.go index 8058b5e5..f1f797c6 100644 --- a/rpc/eth_api.go +++ b/rpc/eth_api.go @@ -541,7 +541,7 @@ func formatBlock( "logsBloom": bloom, "transactionsRoot": hexutil.Bytes(header.DataHash), "stateRoot": hexutil.Bytes(header.AppHash), - "miner": hexutil.Bytes(header.ValidatorsHash), + "miner": common.Address{}, "difficulty": nil, "totalDifficulty": nil, "extraData": nil, @@ -861,6 +861,12 @@ func (e *PublicEthAPI) getGasLimit() (int64, error) { // Save value to gasLimit cached value gasLimit := genesis.Genesis.ConsensusParams.Block.MaxGas + if gasLimit == -1 { + // Sets gas limit to max uint32 to not error with javascript dev tooling + // This -1 value indicating no block gas limit is set to max uint64 with geth hexutils + // which errors certain javascript dev tooling which only supports up to 53 bits + gasLimit = int64(^uint32(0)) + } e.gasLimit = &gasLimit return gasLimit, nil }