Skip to content

fix: address issue with replaying tx via cast run #1071

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

Merged
merged 6 commits into from
Jun 12, 2025
Merged

Conversation

dutterbutter
Copy link
Collaborator

What 💻

  • Turns on evm_interpreter
  • Fixes gas issues

Note: Some improvements can still be made, for instance we return Error function_selector = 0xe8d529f9, data = 0xe8d529f9 as a String and its never decoded via Openchain. We should improve this to do so, then its human readable as OrderFailed() instead of 0xe8d529f9.

Why ✋

  • By specifying true for base system contracts for evm interpreter we can successfully replay both EraVM and EVM transactions during replay
  • The gas calculation has not been updated for quite some time resulting in incorrect gas limits

Evidence 📷

Include screenshots, screen recordings, or console output here demonstrating that your changes work as intended

BEFORE:

cast run --zksync --rpc-url https://api.mainnet.abs.xyz 0x7b902729627b4a027b30498feea48299fac067443f9a32907df2200537b3b320 -vvvvv --decode-internal
Executing previous transactions from the block.
2025-06-11T19:45:37.004465Z ERROR foundry_zksync_core::vm::tracers::error: vm error: Not enough gas
2025-06-11T19:45:37.005124Z ERROR foundry_zksync_core::vm::tracers::error: vm error: Not enough gas
2025-06-11T19:45:37.005184Z ERROR foundry_zksync_core::vm::tracers::error: vm error: Not enough gas
2025-06-11T19:45:37.005204Z ERROR foundry_zksync_core::vm::tracers::error: vm error: Not enough gas
2025-06-11T19:45:37.005749Z ERROR foundry_zksync_core::vm::inspect: tx execution halted: Account validation error: Not enough gas for transaction validation
Traces:
  [0] 0x0000000000000000000000000000000000000000::fallback()
    └─ ← [Continue] <empty revert data>


Error: Transaction failed.
Gas used: 38017

NOW:

cast run --zksync --rpc-url https://api.mainnet.abs.xyz 0x7b902729627b4a027b30498feea48299fac067443f9a32907df2200537b3b320 -vvvvv --decode-internal
Executing previous transactions from the block.
Traces:
  [36279] 0x634E831cE6D460c2CD5067Af98D6452Eb280E374::7e42ae50{value: 17073000000000000}(59d1364475c1130d58882a5f85744008a462b0b53e3a83f86ecd9eee865d8597)
    ├─ [204] 0xf70da97812CB96acDF810712Aa562db8dfA3dbEF::fallback{value: 17073000000000000}()
    │   └─ ← [Return]
    └─ ← [Return]


Transaction successfully executed.
Gas used: 150717

Documentation 📚

Please ensure the following before submitting your PR:

  • Check if these changes affect any documented features or workflows.
  • Update the book if these changes affect any documented features or workflows.

@dutterbutter
Copy link
Collaborator Author

@dutterbutter dutterbutter requested review from itegulov and popzxc June 11, 2025 19:53
@dutterbutter dutterbutter enabled auto-merge (squash) June 12, 2025 02:20
@dutterbutter dutterbutter merged commit adb50e9 into main Jun 12, 2025
27 checks passed
@dutterbutter dutterbutter deleted the db/fix-replay-tx branch June 12, 2025 05:17
@github-project-automation github-project-automation bot moved this from Todo to Done in DevEx squad Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants