solidity-gas-profiler icon indicating copy to clipboard operation
solidity-gas-profiler copied to clipboard

debug_traceTransaction fails: required historical state unavailable

Open wjmelements opened this issue 6 years ago • 3 comments

Thanks for this project. I hope I can get it to work.

I have gotten two different errors with two different nodes. I suspect the underlying issue is that debug is not supported by geth without --gcmode "archive". I am currently testing this by resyncing my node as an archive node.

From INFURA the error was

Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (~/projects/solidity-gas-profiler/node_modules/web3-core-helpers/src/errors.js:42:16)
    at XMLHttpRequest.request.onreadystatechange (~/projects/solidity-gas-profiler/node_modules/web3-providers-http/src/index.js:75:32)
    at XMLHttpRequestEventTarget.dispatchEvent (~/projects/solidity-gas-profiler/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
    at XMLHttpRequest._setReadyState (~/projects/solidity-gas-profiler/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
    at XMLHttpRequest._onHttpRequestError (~/projects/solidity-gas-profiler/node_modules/xhr2-cookies/dist/xml-http-request.js:349:14)
    at ClientRequest.<anonymous> (~/projects/solidity-gas-profiler/node_modules/xhr2-cookies/dist/xml-http-request.js:252:61)
    at ClientRequest.emit (events.js:182:13)
    at Socket.socketErrorListener (_http_client.js:391:9)
    at Socket.emit (events.js:182:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)

From my own node the error was

Error: Returned error: required historical state unavailable (reexec=128)
    at Object.ErrorResponse (~/projects/solidity-gas-profiler/node_modules/web3-core-helpers/src/errors.js:29:16)
    at /Users/williammorriss/projects/solidity-gas-profiler/node_modules/web3-core-requestmanager/src/index.js:140:36
    at XMLHttpRequest.request.onreadystatechange (~/projects/solidity-gas-profiler/node_modules/web3-providers-http/src/index.js:79:13)
    at XMLHttpRequestEventTarget.dispatchEvent (~/projects/solidity-gas-profiler/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
    at XMLHttpRequest._setReadyState (~/projects/solidity-gas-profiler/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
    at XMLHttpRequest._onHttpResponseEnd (~/projects/solidity-gas-profiler/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14)
    at IncomingMessage.<anonymous> (~/projects/solidity-gas-profiler/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61)
    at IncomingMessage.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1094:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

wjmelements avatar Feb 21 '19 00:02 wjmelements

I estimate the archive node will finish syncing by the end of next week.

wjmelements avatar Feb 25 '19 21:02 wjmelements

Thanks for reporting the issue! If profiling a live real-world tx is not absolutely necessary, I recommend running geth in dev mode to avoid syncing.

yushih avatar Feb 26 '19 14:02 yushih

`

debug.traceTransaction("0xc991b81f74fe203d07db35521eff32bdc37d7afa313d1d717313fe845fe11c04") Error: required historical state unavailable (reexec=128) at web3.js:3456:20 at web3.js:6304:15 at web3.js:5410:36 at :1:1 `

bglmmz avatar Jun 07 '22 03:06 bglmmz