anvil-zksync
anvil-zksync copied to clipboard
feat: implement `anvil_setBlockGasLimit` API endpoint
A method that allows a user to manually set block gas limit to a value of their choice:
#[rpc(name = "anvil_setBlockGasLimit")]
fn set_block_gas_limit(&self, limit: U256) -> RpcResult<bool>;
Not sure if this even makes sense in our case as even for core block gas limit is fixed to the the VM's batch gas limit.
@popzxc what do you think regarding that last question? Implementing this would be easy on a surface level but honestly I am not sure in the general usefulness of this as you can never exceed VM's gas limit regardless.
You cannot exceed VM's gas limit, but you can exceed a single transaction gas limit (e.g. we have an API check for that). I think it might be useful for indirect usages: e.g. if people want to make sure that given certain parameters they don't exceed certain gas limit for their transaction (so: instead of increasing limit, we will decrease it).
Right, I guess in a non-single tx mode this is dependent on us following proper block sealing criteria from core that, among other things, will take this "fake" gas limit into account.