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

[BUG] Gas refund amount is different from reported block explorer #522

Open
dutterbutter opened this issue Jan 8, 2025 · 1 comment
Open
Labels
bug πŸ› Something isn't working p2 🟑 Indicates moderately high priority item

Comments

@dutterbutter
Copy link
Collaborator

πŸ› Bug Report for anvil-zksync

πŸ“ Description

Replaying the following tx:

anvil-zksync -d replay_tx --fork-url sepolia-testnet 0x46c0db5b243cec2ef4016143a7f17718815420f0e863197b432f4231a1b2c57c 

We see the following details:

17:08:40  INFO βœ…  [SUCCESS] Hash: 0x46c0db5b243cec2ef4016143a7f17718815420f0e863197b432f4231a1b2c57c
17:08:40  INFO Initiator: 0xe85b66fca403bc35bcae17ce7758e942aea65dc0
17:08:40  INFO Payer: 0xe85b66fca403bc35bcae17ce7758e942aea65dc0
17:08:40  INFO Gas Limit: 264_868 | Used: 129_640 | Refunded: 135_228
17:08:40  INFO Paid: 0.0000032410 ETH (129640 gas * 0.02500000 gwei)
17:08:40  INFO Refunded: 0.0000033807 ETH

The refund specified is Refunded: 0.0000033807 ETH whereas if we review the tx on the block explorer it is reported as Refunded: 0.0000044942 ETH

As a result the calculation for fees is also different.

πŸ”„ Reproduction Steps

  1. Step 1
  2. Step 2
  3. ...

πŸ€” Expected Behavior

Replayed refund amount should be the same as reported on block explorer.

😯 Current Behavior

Discrepancy on refund amount.

πŸ–₯️ Environment

  • Rust version: [e.g., rustc 1.52.0]
  • Operating System & Version: [e.g., Ubuntu 20.04]
  • Other relevant environment details:

πŸ“‹ Additional Context

Add any other context about the problem here. If applicable, add screenshots to help explain.

πŸ“Ž Log Output

Paste any relevant log output here.
@dutterbutter dutterbutter added bug πŸ› Something isn't working p2 🟑 Indicates moderately high priority item labels Jan 8, 2025
@dutterbutter dutterbutter changed the title Gas refund amount is different from reported block explorer [BUG] Gas refund amount is different from reported block explorer Jan 9, 2025
@dutterbutter dutterbutter moved this to Todo in DevEx squad Jan 15, 2025
@dutterbutter
Copy link
Collaborator Author

So the refund amount reported by the block explorer 179_768 units of gas which equals 0.0000044942 ETH. We are reporting 135_228 units of gas which equals 0.0000033807 ETH.

We are receiving the refund value from the tx_result VmExecutionResultAndLogs so I am not sure where the discrepancy is coming from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug πŸ› Something isn't working p2 🟑 Indicates moderately high priority item
Projects
Status: Todo
Development

No branches or pull requests

1 participant