Closed PaulRBerg closed 7 months ago
For L1 chains, block gas limits are soft consensus parameters with no easy visibility, so I'm hesitant to add them since they're likely become out of date.
For OP Stack chains, you can read this value for a given chain by calling the gasLimit
getter on the L1 SystemConfig contract. For example with OP Mainnet, the L1 SystemConfig contract address can be found here, and you can call
$ cast call 0x229047fed2591dbec1eF1118d64F7aF3dB9EB290 "gasLimit()(uint256)"
30000000
Arbitrum stack chains may expose this value similarly but I'm unsure offhand
Ok, in this case it makes sense to close this issue.
Thanks for your guidance on reading the gas limit on OP Stack chains. Didn't know about the gasLimit
getter.
Block gas limits can influence the configuration of smart contracts. For example, the
MAX_SEGMENT_COUNT
in Sablier is influenced by them.Thus, it would be handy if Forge Std offered the block gas limits of the most popular chains (Ethereum, Arbitrum, Optmism, etc.) as fields in the
Chain
struct.