livepeer / protocol

Livepeer protocol
MIT License
154 stars 45 forks source link

Hardhat could not generate stack trace "a call trace has not functionJumpdest..." #499

Closed yondonfu closed 2 years ago

yondonfu commented 2 years ago

When running tests with hardhat --verbose, there are a few cases where Hardhat complaints that stack traces could not be generated. In all these cases, the verbose logs include this output:

hardhat:core:hardhat-network:node Could not generate stack trace. Please report this to help us improve Hardhat.
  hardhat:core:hardhat-network:node  Error: This shouldn't happen: a call trace has no functionJumpdest but has already jumped into a function
    at ErrorInferrer._getEntryBeforeFailureInModifier (/Users/yondonfu/Development/livepeer/protocol/node_modules/hardhat/src/internal/hardhat-network/stack-traces/error-inferrer.ts:1481:13)
    at ErrorInferrer._checkRevertOrInvalidOpcode (/Users/yondonfu/Development/livepeer/protocol/node_modules/hardhat/src/internal/hardhat-network/stack-traces/error-inferrer.ts:373:16)
    at ErrorInferrer._checkLastInstruction (/Users/yondonfu/Development/livepeer/protocol/node_modules/hardhat/src/internal/hardhat-network/stack-traces/error-inferrer.ts:557:44)
    at ErrorInferrer.inferAfterTracing (/Users/yondonfu/Development/livepeer/protocol/node_modules/hardhat/src/internal/hardhat-network/stack-traces/error-inferrer.ts:165:12)
    at SolidityTracer._rawTraceEvmExecution (/Users/yondonfu/Development/livepeer/protocol/node_modules/hardhat/src/internal/hardhat-network/stack-traces/solidityTracer.ts:213:61)
    at SolidityTracer._traceEvmExecution (/Users/yondonfu/Development/livepeer/protocol/node_modules/hardhat/src/internal/hardhat-network/stack-traces/solidityTracer.ts:151:29)
    at SolidityTracer._getCallMessageStackTrace (/Users/yondonfu/Development/livepeer/protocol/node_modules/hardhat/src/internal/hardhat-network/stack-traces/solidityTracer.ts:73:17)
    at SolidityTracer.getStackTrace (/Users/yondonfu/Development/livepeer/protocol/node_modules/hardhat/src/internal/hardhat-network/stack-traces/solidityTracer.ts:56:19)
    at HardhatNode._manageErrors (/Users/yondonfu/Development/livepeer/protocol/node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:1705:41)
    at HardhatNode._gatherTraces (/Users/yondonfu/Development/livepeer/protocol/node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:1468:30)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at runNextTicks (internal/process/task_queues.js:64:3)
    at listOnTimeout (internal/timers.js:526:9)
    at processTimers (internal/timers.js:500:7)
    at async HardhatNode._mineBlockWithPendingTxs (/Users/yondonfu/Development/livepeer/protocol/node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:1582:23) +178ms

According to https://github.com/nomiclabs/hardhat/issues/1185 this is apparently a Solidity issue that was fixed in v0.8.8. Opening this issue to track this since until all dev branches are upgraded to use Solidity v0.8.8