zemse / hardhat-tracer

🕵️ allows you to see internal calls, events and storage operations in the console
MIT License
355 stars 36 forks source link

Tracing on geth doesn't work #63

Closed nuliknol closed 9 months ago

nuliknol commented 11 months ago
user@host$ DEBUG=hardhat-tracer:* npx hardhat trace --hash 0xc7fe451a3c532f47097aa929e970799e877466ef79a75bb0c5ae14adfb8a8db5 --rpc http://localhost:8545
  hardhat-tracer:extend:config extending config... +0ms
  hardhat-tracer:extend:config config extended! +3ms
  hardhat-tracer:extend:hre extending environment... +0ms
  hardhat-tracer:decoder Decoder constructor +0ms
  hardhat-tracer:decoder _updateArtifacts called +0ms
  hardhat-tracer:extend:hre environment extended! +53ms
  hardhat-tracer:decoder _updateArtifacts finished +345ms
Nothing to compile
  hardhat-tracer:tasks:trace fetch tx from provider +0ms
  hardhat-tracer:tasks:trace tx not on provider +3s
  hardhat-tracer:tasks:trace fetch tx from rpc http://localhost:8545 +0ms
Activating mainnet fork at block 23
You are forking from block 23, which has less than 31 confirmations, and will affect Hardhat Network's performance.
Please use block number 16 or wait for the block to get 7 more confirmations.
  hardhat-tracer:tasks:trace get VM +2s
  hardhat-tracer:tasks:trace trace transaction +0ms
  hardhat-tracer:tasks:trace running block in context +1ms
  hardhat-tracer:tasks:trace running tx c7fe451a3c532f47097aa929e970799e877466ef79a75bb0c5ae14adfb8a8db5 +12ms
  hardhat-tracer:trace-recorder handleBeforeTx +0ms
An unexpected error occurred:

TypeError: Cannot mix BigInt and other types, use explicit conversions
    at VM._runTx (path/node_modules/@nomicfoundation/ethereumjs-vm/src/runTx.ts:348:54)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at VM.runTx (path/node_modules/@nomicfoundation/ethereumjs-vm/src/runTx.ts:157:20)
    at path/node_modules/hardhat-tracer/src/tasks/trace.ts:255:9
    at HardhatNode._runInBlockContext (path/node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:2226:14)
    at SimpleTaskDefinition.action (path/node_modules/hardhat-tracer/src/tasks/trace.ts:147:5)
    at Environment._runTaskDefinition (path/node_modules/hardhat/src/internal/core/runtime-environment.ts:358:14)
    at Environment.run (path/node_modules/hardhat/src/internal/core/runtime-environment.ts:191:14)
    at main (path/node_modules/hardhat/src/internal/cli/cli.ts:328:7)

geth version: 1.13.8 hardhat version: 2.19.3

zemse commented 11 months ago

I just tried but couldn't reproduce through following steps:

  1. geth --http --http.corsdomain="https://remix-alpha.ethereum.org" --http.api web3,eth,debug,personal,net --vmdebug --dev
  2. Deploy contract and do some txs on it.
  3. npx hardhat trace --hash --rpc http://localhost:8545

But the issue sounds like it is related to baseFee being undefined. Can you give more info how geth is instantiated? Is 1559 activated for your blocks?

nuliknol commented 9 months ago

I don't remember what is is about, closing