Skip to content

[Dev Tools] Discrepancy between gas cost computed inside paymaster and from tx response #794

Closed Answered by cytadela8
cesarenaldi asked this question in Dev Tooling
Discussion options

You must be logged in to vote

Hi, there is a good answer for a similar problem here. Basically, you cannot unfortunately get an exact fee paid by a paymaster during paymaster execution in the transaction. You can improve your estimation by using _maxRefundedGas in postTransaction as explained in that discussion.

I would recommand going with the approach I proposed above and avoid accounting the spending immediately during the transaction. I would observe the difference between the last recorded paymaster balance and the current balance during each operation where funds are moved (deposited or withdrawn) outside of a paymaster transaction. This way you can accurately and in bulk account the transactions. As an addition…

Replies: 6 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@kaymomin
Comment options

Comment options

You must be logged in to vote
1 reply
@cesarenaldi
Comment options

Comment options

You must be logged in to vote
6 replies
@cytadela8
Comment options

@cesarenaldi
Comment options

@cesarenaldi
Comment options

@cytadela8
Comment options

Answer selected by cytadela8
@cytadela8
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devtools Questions related to zkSync Tooling
3 participants