You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
🌟 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.The text was updated successfully, but these errors were encountered: