Skip to content

[SDK] Calculation of the required gas estimateGas #370

Closed Answered by StanislavBreadless
RomanYarinski asked this question in SDKs
Discussion options

You must be logged in to vote

@RomanYarinski Note, that since state diffs are used, the subsequent transactions in a batch can have smaller fee due to the fact that they reused the state storage slots. So depending on the sort of the contract you are calling you can get very different cost of the first and the second call, but when estimating gas we never know whether your transaction will come as one of the first ones in a batch (and will have to pay the full price) or it will continue receiving the benefits of the previous transactions in the current batch that have already paid for the state changes.

Also, the calculations in the table seem to be a bit off. On the 23rd of February the gas price on zksync was around…

Replies: 4 comments 1 reply

This comment was marked as spam.

@RomanYarinski
Comment options

This comment was marked as spam.

This comment was marked as spam.

Comment options

You must be logged in to vote
0 replies
Answer selected by bxpana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
SDKs
Labels
sdk Questions for the SDKs gas Gas related question
5 participants