celo-blockchain
celo-blockchain copied to clipboard
JSON/RPC block information should still return a gasLimit
I understand that on Celo the block gas limit is essentially hardcoded (if I'm understanding proposals such as CGP11 and CGP12 correctly), and so in #574 "unused" fields were to be removed from blocks to reduce network overhead (which in fact happened as part of 25b9e3fcc0bb7427df12617b453f1ec7e0bde854 from #913)... however, these values still need to be returned from the JSON/RPC API, so that cross-chain client tooling--which will not have any idea of what "Celo" is or its special rules regarding a hardcoded gas limit--can understand your chain correctly and make decisions related to transaction size optimization (or do other analysis tasks such as digging through history to calculate utilization rates).
@YazzyYaz I'm now realizing that I should have complained about this during that call I was just sitting in on (as you made it sound like I'd have to be for #1734 to happen); is there any hope of fixing this? I appreciate your gas limit isn't dynamic in the way Ethereum is, and so isn't in the header, but the issue is that you do still HAVE a limit--and I presume, as that limit seemed to be part of your consensus, that this limit changes over time as you make new hard forks--and the RPC API should be returning that limit. (And, even if you didn't have a limit, you should at least be returning that lack of limit: there is another EIP that I believe limits that field to 63-bits, so you could just return the maximum amount or something.)
Oh I wish you informed me of this, we can definitely discuss it. I spoke to @mcortesi @gastonponti @nategraf @trianglesphere last week about displaying gasLimit in an RPC call and I believe it's very doable.
I doubt it requires a HF but the devs need to correct me if I'm mistaken.
Adding the field to the block would require a hard fork, but adding an RPC is definitely doable!
@saurik would having the gasLimit appear in an RPC call be a good solution for your usecase?
@YazzyYaz Yes: I am only saying it should exist in the RPC response (so tooling that accepts a JSON/RPC URL can be chain-agnostic).
Related ongoing issue using ethers
Keeping this issue. Although we already fixed the rpc to return the gasLimit, we plan to re add this field in the next HF to maintain a better compatibility with Ethereum. Or we could close this one that is just referring to the rpc response and open one specific for the block format (@carterqw2 your call)
We'll open a specific one for the block format.