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

Failed to trace a first block #3454

Closed
begmaroman opened this issue Mar 13, 2024 · 1 comment · Fixed by #3469
Closed

Failed to trace a first block #3454

begmaroman opened this issue Mar 13, 2024 · 1 comment · Fixed by #3469
Assignees
Milestone

Comments

@begmaroman
Copy link
Contributor

begmaroman commented Mar 13, 2024

System information

zkEVM Node version: v0.0.X-RCXX
OS & Version: OSX
Commit hash : 567d1df
Network: Mainnet/Testnet

Expected behaviour

After running a network, I can successfully trace a first block using "debug_traceBlockByNumber" endpoint.

Actual behaviour

"debug_traceBlockByNumber" endpoint of the first block returns the following error:

failed to get trace for transaction 0xfcd9fff0177d0e86727354a93ac01e15b7c682ddfbbcc33a54dcece43f7db268: failed to get trace: batch v2 must start with changeL2Block before Tx (suspect a V1 Batch or a ForcedBatch?))

Steps to reproduce the behaviour

  1. cd test
  2. make run
  3. pull https://github.com/0xPolygonHermez/zkevm-node/compare/bug/tracing-first-block-issue?expand=1 bracnh and run "Test_DebugFirstBatch" test

Backtrace

=== RUN   Test_DebugFirstBatch
    debug_1batch_test.go:31: {
          "jsonrpc": "2.0",
          "id": 1,
          "error": {
            "code": -32000,
            "message": "failed to get trace for transaction 0xfcd9fff0177d0e86727354a93ac01e15b7c682ddfbbcc33a54dcece43f7db268: failed to get trace: batch v2 must start with changeL2Block before Tx (suspect a V1 Batch or a ForcedBatch?))"
          }
        }
--- PASS: Test_DebugFirstBatch (0.02s)
PASS
@tclemos tclemos self-assigned this Mar 19, 2024
@tclemos tclemos added this to the v0.7.0 milestone Mar 19, 2024
@tclemos
Copy link
Contributor

tclemos commented Mar 19, 2024

This happens because networks starting with a forkID from Etrog will have their first block containing a particular transaction called Injected TX.

This Injected TX requires a different way to be executed.
I've adapted the code to process this particular transaction when tracing it In this commit 9769672

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants