Fantom-foundation / go-opera

Opera blockchain protocol secured by the Lachesis consensus algorithm
https://fantom.foundation/
GNU Lesser General Public License v3.0
283 stars 283 forks source link

Crashing with `debug_traceBlockByHash` #552

Closed Maharacha closed 4 months ago

Maharacha commented 4 months ago

Describe the bug The node has started to crash when I use method debug_traceBlockByHash. Log:

Jul 10 21:24:04 juju-d8fc4f-0 opera[5915]: INFO [07-10|21:24:04.650] New block                                index=85158967 id=292877:1629:18e9e5  gas_used=269,457    txs=1/0   age=1.329s         t=2.716ms
Jul 10 21:24:04 juju-d8fc4f-0 opera[5915]: panic: runtime error: invalid memory address or nil pointer dereference
Jul 10 21:24:04 juju-d8fc4f-0 opera[5915]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xe8bad9]
Jul 10 21:24:04 juju-d8fc4f-0 opera[5915]: goroutine 37112653 [running]:
Jul 10 21:24:04 juju-d8fc4f-0 opera[5915]: github.com/Fantom-foundation/go-opera/ethapi.(*PublicDebugAPI).traceTx(0xc01176fd20, {0x19d4ac8, 0xc007953380}, {0x19de688?, 0xc02c679050?}, 0xc02ebadda0, {0x181f480, 0x181f488, 0xc034fcb4a0, {0x0, ...}, ...}, ...)
Jul 10 21:24:04 juju-d8fc4f-0 opera[5915]:         /home/ubuntu/go-opera/ethapi/api.go:2206 +0x979
Jul 10 21:24:04 juju-d8fc4f-0 opera[5915]: github.com/Fantom-foundation/go-opera/ethapi.(*PublicDebugAPI).traceBlock.func1()
Jul 10 21:24:04 juju-d8fc4f-0 opera[5915]:         /home/ubuntu/go-opera/ethapi/api.go:2319 +0x435
Jul 10 21:24:04 juju-d8fc4f-0 opera[5915]: created by github.com/Fantom-foundation/go-opera/ethapi.(*PublicDebugAPI).traceBlock
Jul 10 21:24:04 juju-d8fc4f-0 opera[5915]:         /home/ubuntu/go-opera/ethapi/api.go:2307 +0x27d

To Reproduce Steps to reproduce the behavior:

  1. Use branch https://github.com/Fantom-foundation/go-opera/tree/release/txtracing/1.1.3-rc.5
  2. Run archive node with CLI args:
    --datadir /home/opera/.opera --metrics --metrics.port 6060 --metrics.addr 0.0.0.0 --syncmode full --gcmode archive --verbosity 3 --http.addr 0.0.0.0 --http --http.vhosts=* --http.corsdomain=* --http.port 8545 --http.api eth,net,web3,txpool,debug --cache 16000 --db.preset pbl-1 --maxpeers 200'

Expected behavior A response without crashing.

Desktop (please complete the following information): Ubuntu 22.04

jenikd commented 4 months ago

Hi @Maharacha, this PR https://github.com/Fantom-foundation/go-opera/pull/553 solves this issue, please update your branch and it will be solved

Maharacha commented 4 months ago

Hi @Maharacha, this PR #553 solves this issue, please update your branch and it will be solved

Thanks! It works!