Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement anvil_setBlockGasLimit API endpoint #425

Open
itegulov opened this issue Nov 25, 2024 · 3 comments
Open

feat: implement anvil_setBlockGasLimit API endpoint #425

itegulov opened this issue Nov 25, 2024 · 3 comments

Comments

@itegulov
Copy link
Contributor

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.

@itegulov
Copy link
Contributor Author

@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.

@popzxc
Copy link
Member

popzxc commented Nov 25, 2024

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).

@itegulov
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants