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

Expose MAX_TRANSACTION_GAS_LIMIT in the system contracts #1210

Open
CodeSandwich opened this issue Jan 21, 2025 · 0 comments
Open

Expose MAX_TRANSACTION_GAS_LIMIT in the system contracts #1210

CodeSandwich opened this issue Jan 21, 2025 · 0 comments

Comments

@CodeSandwich
Copy link

CodeSandwich commented Jan 21, 2025

🌟 Feature Request

📝 Description

Expose MAX_TRANSACTION_GAS_LIMIT in the system contracts.

🤔 Rationale

As of now there's no way to learn what's the maximum gas available for a transaction. block.gaslimit only tells the limit of the entire batch, which is a different thing unlike in EVMs where the transaction gas limit is equal to the block gas limit. The maximum gas usable in a transaction is sometimes a useful piece of information, for example my smart contract uses it for throttling requests of an off-chain resource, the gas cost of requesting it goes up with each call increasing the price until the transaction gas limit is reached and the resource can't be used at all until the cooldown ends.

📋 Additional Context

Making block.gaslimit return the transaction gas limit feels like the right choice when it comes to porting EVM contracts to ZKsync. In the context of Solidity smart contracts the batch limit isn't a relevant information because their execution is always in the context of a transaction. Having the batch limit which is a strictly ZKsync thing available in the system contract seems right, it doesn't need to be available right in the Solidity syntax. I suspect that this switch probably won't happen though as it may cause compatibility issues in the existing contracts.

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

1 participant