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

Error: "Invalid 2nd Argument" for 'tracer' in Stylus replay and trace commands #103

Open
barabanovro opened this issue Oct 9, 2024 · 0 comments

Comments

@barabanovro
Copy link

Environment

  • Operating System: Linux Ubuntu x86_64
  • Stylus Version: 0.5.3 (using cargo stylus --version)
  • Node Provider: Alchemy (supports debug endpoints)

Problem

I encountered an error when trying to use the stylus replay command. The error message is:

"invalid 2nd argument: options 'tracer': invalid tracer value"

Logs:

cargo stylus replay --tx=$TX_HASH --endpoint=$RPC_URL
Reading symbols from /root/.cargo/bin/cargo-stylus...
(No debugging symbols found in /root/.cargo/bin/cargo-stylus)
Function "user_entrypoint" not defined.
Breakpoint 1 (user_entrypoint) pending.
Starting program: /root/.cargo/bin/cargo-stylus stylus replay --tx=0xea570604b7df1ea95e528554c2ef82ee6a5c051e165e8fcd9e39447c4e8178fe --endpoint=https://arb-sepolia.g.alchemy.com/v2/c1n3IjOqwsc7ucA_zem_L-********** --child
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Detaching after vfork from child process 919674]
[New Thread 0x7ffff7798640 (LWP 919675)]
Error: failed to replay tx

Caused by:
    (code: -32602, message: invalid 2nd argument: options 'tracer': invalid tracer value, data: None)

Location:
    /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-stylus-0.5.3/src/trace.rs:49:40
[Thread 0x7ffff7798640 (LWP 919675) exited]
[Inferior 1 (process 919671) exited with code 01]

The request payload I saw in the Alchemy dashboard:

{
  "id": 3,
  "jsonrpc": "2.0",
  "method": "debug_traceTransaction",
  "params": [
    "0xea570604b7df1ea95e528554c2ef82ee6a5c051e165e8fcd9e39447c4e8178fe",
    {
      "tracer": "{\n    \"hostio\": function(info) {\n        info.args = toHex(info.args);\n        info.outs = toHex(info.outs);\n        if (this.nests.includes(info.name)) {\n            Object.assign(info, this.open.pop());\n            info.name = info.name.substring(4) // remove evm_\n        }\n        this.open.push(info);\n    },\n    \"enter\": function(fr"
    }
  ]
}

I also encountered the same error when trying to use the stylus trace command. Logs:

cargo stylus trace --tx=$TX_HASH --endpoint=$RPC_URL
Error: failed to trace tx

Caused by:
    (code: -32602, message: invalid 2nd argument: options 'tracer': invalid tracer value, data: None)

Location:
    /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-stylus-0.5.3/src/trace.rs:49:40

Steps to Reproduce

Follow the tutorial at https://docs.arbitrum.io/stylus/how-tos/debugging-stylus-tx .

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

No branches or pull requests

1 participant