AcalaNetwork / chopsticks

Create parallel reality of your Substrate network.
Apache License 2.0
139 stars 85 forks source link

Cannot see runtime logs for Moobeam #859

Open alistair-singh opened 6 days ago

alistair-singh commented 6 days ago

When using chopsticks on Moonbeam runtime to debug XCM, runtime logs are not output. This could because the chain is an EVM style chain which accepts EVM style accounts with ECDSA.

Possibly related issues: https://github.com/AcalaNetwork/chopsticks/issues/845

Example txs: https://moonbeam.subscan.io/extrinsic/8434476-4 https://moonbeam.subscan.io/extrinsic/8492691-4

Steps to reproduce:

  1. Clone the moonbeam repo: https://github.com/moonbeam-foundation/moonbeam
  2. Build the moonbeam runtime.
    cd moonbeam
    git checkout runtime-3300
    cargo build -p moonbeam-runtime
  3. Create config moonbeam.yml with path to the build debug wasm.
    endpoint: wss://moonbeam-rpc.dwellir.com
    mock-signature-host: true
    block: ${env.MOONBEAM_BLOCK_NUMBER}
    db: ./moonbeam.db.sqlite
    runtime-log-level: 5
    wasm-override: ../moonbeam/target/debug/wbuild/moonbeam-runtime/moonbeam_runtime.wasm
  4. Run the command to re-run the block:
    RUST_LOG=trace npx @acala-network/chopsticks@latest run-block -c moonbeam.yml -b 0x0d19ddccba84b83e01d79b47ac74fafa7a6ce0f0db00770de0ea89c627f3a211 --runtime-log-level 5

Expected output is a log line like:

xcm::execute  TRACE: !!! ERROR

Actual output: out4.txt

Version:

$ npx @acala-network/chopsticks@latest --version
1.0.1
xlc commented 6 days ago

It is not related to #845 as you are replaying a real tx with valid signature.

I can see logs from EVM pallet so runtime logs is working.

To debug this why the tx failed, I will suggest:

this will allow you replay only the failed tx and if needed, you can do additional storage override before replay it. e.g. if you found out the issue is the source account does not have enough funds, you can top it up and replay to see if it is going to success this time

You can also use dev_setHead with -1 as parameter to revert last block