trufflesuite / ganache

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.

Home Page:https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error "`c.header.cliqueSigner` is not a function" when debugging on a forked chain

haltman-at opened this issue · comments

I'm trying to debug a transaction on Goerli by forking with Ganache and debugging there. However, on recent versions of Ganache (7.8.0 and 7.7.0) the debug_traceTransaction call returns an error. This error does not occur on Ganache 7.6.0. It also does not seem to occur when not using forking.

Reproduction steps:

  1. Create an instance of Ganache forking Goerli.
  2. Attempt to use Truffle Debugger (I used -x, although that shouldn't be relevant here) to debug the following transaction: 0x6a86b051ad13bcf8a4ebfc33f6ccdacced818bd2de3149e7566e9f55cc0fab64

If you do this, you get the following error:

Error: c.header.cliqueSigner is not a function
    at on.getTrace (/home/sniffnoy/truffle/truffle/packages/debugger/lib/web3/adapter.js:38:13)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
Truffle (unbundled) (core: 5.8.2)
Node v14.21.3

(This is on 7.8.0; with Ganache 7.7.0, it's called t.header.cliqueSigner instead. And, as mentioned, with 7.6.0, no error occurs.)

Now this error is of course coming from adapter.js, but that's because it got an error response from Ganache on the debug_traceTransaction call. Specifically, with 7.8.0, the response looks like this:

{
  id: 1681425938846,
  jsonrpc: '2.0',
  error: {
    message: 'c.header.cliqueSigner is not a function',
    stack: 'TypeError: c.header.cliqueSigner is not a function\n' +
      '    at VM._runTx (/home/sniffnoy/.nvm/versions/node/v14.21.3/lib/node_modules/ganache/dist/node/0.js:2:3817717)\n' +
      '    at async VM.runTx (/home/sniffnoy/.nvm/versions/node/v14.21.3/lib/node_modules/ganache/dist/node/0.js:2:3821314)\n' +
      '    at async Blockchain.<anonymous> (/home/sniffnoy/.nvm/versions/node/v14.21.3/lib/node_modules/ganache/dist/node/1.js:2:77581)\n' +
      '    at async Blockchain.traceTransaction (/home/sniffnoy/.nvm/versions/node/v14.21.3/lib/node_modules/ganache/dist/node/1.js:2:85688)',
    code: -32700
  }
}

So, seems like a Ganache bug!

Other notes: I initially encountered this error when manually forking via Infura, because I forgot that these days you can just do ganache -f goerli. But on trying the latter, the error still occurred.

Note: Issue #4450 may be related to this one.