Skip to content

[Dev Tools] anvil-zksync replay_tx not matching chain data #1031

Discussion options

You must be logged in to vote

I did a small investigation and the reason why execution in anvil-zksync is different is that, unfortunately, gas consumption when replaying an individual transaction (or even an individual block) is different from what it is in real life execution. For instance, it's a lot cheaper to write into slots that have already been written into by some previous transaction in the same batch.

To fully replicate what happened in real life, anvil-zksync would have to re-execute all transactions from that batch. But batches live for quite a while on the majority of ZK chains (including Abstract) and it is unreasonable for anvil-zksync to replay all of them. For example, second transaction from the or…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by itegulov
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