erigontech / erigon

Ethereum implementation on the efficiency frontier https://erigon.gitbook.io
GNU Lesser General Public License v3.0
3.12k stars 1.11k forks source link

Polygon: debug_traceTransaction throws error for block 21615364 #7498

Closed zimbabao closed 12 months ago

zimbabao commented 1 year ago

System information

Erigon version: erigon version 2.43.0-stable-7e8beecf

OS & Version: Windows/Linux/OSX: Linux polygon-erigon-archive-a-0 5.10.173-154.642.amzn2.x86_64 #1 SMP Wed Mar 15 00:26:42 UTC 2023 x86_64 Linux

Commit hash: 7e8beecf

Erigon Command (with flags/config): erigon--datadir=/data/volumes/erigon-bor--private.api.addr=localhost:9090--chain=bor-mainnet--http=true--http.addr=0.0.0.0--http.port=8545--maxpeers=300--metrics--metrics.addr=0.0.0.0--metrics.port=6061--private.api.addr=localhost:9090--http.api=eth,erigon,web3,net,debug,trace,txpool,admin,engine--ws--ws.compression--rpc.gascap=300000000--http.addr=0.0.0.0--txpool.api.addr=0.0.0.0:9091--http.vhosts=*--pprof--pprof.addr=0.0.0.0--pprof.port=6059--downloader.verify--p2p.protocol=66--sentry.drop-useless-peers=true

Concensus Layer: heimdalld 0.3.3

Concensus Layer Command (with flags/config): heimdalldstart--home=/data/volumes/heimdall--p2p.laddr=tcp://0.0.0.0:26656--rpc.laddr=tcp://0.0.0.0:26657/var/lib/heimdall

Chain/Network: Polygon

Expected behaviour

Return trace of the block for following API

curl  http://localhost:8545  -X POST  -H "Content-Type: application/json"  --data '{"method":"debug_traceBlockByNumber","params":["0x149d304", {"tracer": "callTracer",  "tracerConfig": {"withLog": true}}],"id":1,"jsonrpc":"2.0"}'

Actual behaviour

Handler crashes and response ends with "output":"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000018556e69737761705632526f757465723a20455850495245440000000000000000","error":"execution reverted","revertReason":"UniswapV2Router: EXPIRED","value":"0x0","type":"CALL"}},{"result":null,"error":{"code":-32000,"message":"method handler crashed"}}

Steps to reproduce the behaviour

Make call to polygon erigon

curl  http://localhost:8545  -X POST  -H "Content-Type: application/json"  --data '{"method":"debug_traceBlockByNumber","params":["0x149d304", {"tracer": "callTracer",  "tracerConfig": {"withLog": true}}],"id":1,"jsonrpc":"2.0"}'
fabwa commented 1 year ago

Does not crash on erigon version 2.33.1-stable-41c0a474

zimbabao commented 1 year ago

@0xKrishna : Did you get any chance to look at this?

0xKrishna commented 1 year ago

Nope, I don't have access to any mainnet node as of now, So not able to reproduce.

zimbabao commented 1 year ago

@0xKrishna it crashes on mumbai archive node too, for block number 29689951

curl  http://localhost:8545  -X POST  -H "Content-Type: application/json"  --data '{"method":"debug_traceBlockByNumber","params":["0x1c5085f", {"tracer": "callTracer",  "tracerConfig": {"withLog": true}}],"id":1,"jsonrpc":"2.0"}'
quickchase commented 1 year ago

I can confirm both of these crash on erigon version 0.0.6-bor-d9c5a011

0xKrishna commented 1 year ago

I checked on a mumbai and debugged, It's something related to contract creation on evm level Logs from server

[EROR] [06-01|09:57:48.401] RPC method debug_traceBlockByNumber crashed: runtime error: index out of range [-1]
[service.go:217 panic.go:890 panic.go:113 call.go:176 interpreter.go:234 interpreter.go:262 evm.go:63 evm.go:401 evm.go:449 state_transition.go:395 state_transition.go:186 tracing.go:195 tracing.go:141 tracing.go:32 value.go:584 value.go:368 service.go:222 handler.go:511 handler.go:444 handler.go:392 handler.go:223 handler.go:316 asm_amd64.s:1594]
zimbabao commented 1 year ago

I tried to look but didn't make much progress. Any luck?

fabwa commented 1 year ago

Still happening on v2.46.0

Andrei-sys commented 1 year ago

Any updates regarding this? Saw that similar issue on node-real/bsc-erigon has been solved.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 40 days with no activity. Remove stale label or comment, or this will be closed in 7 days.

fabwa commented 1 year ago

bump

0xKrishna commented 1 year ago

Any updates regarding this? Saw that similar issue on node-real/bsc-erigon has been solved.

Hi, Can you refer to the commit or PR ?

Andrei-sys commented 1 year ago

Any updates regarding this? Saw that similar issue on node-real/bsc-erigon has been solved.

Hi, Can you refer to the commit or PR ?

Hi, there you go: https://github.com/node-real/bsc-erigon/pull/159

0xKrishna commented 1 year ago

Thanks, I will look into this.

0xKrishna commented 1 year ago

It worked for me on my v2.49.1 node which I have synced from scratch

curl  http://localhost:8545  -X POST  -H "Content-Type: application/json"  --data '{"method":"debug_traceBlockByNumber","params":["0x1c5085f", {"tracer": "callTracer",  "tracerConfig": {"withLog": true}}],"id":1,"jsonrpc":"2.0"}'
0xKrishna commented 1 year ago

Also worked for

curl  http://localhost:8545  -X POST  -H "Content-Type: application/json"  --data '{"method":"debug_traceBlockByNumber","params":["0x149d304", {"tracer": "callTracer",  "tracerConfig": {"withLog": true}}],"id":1,"jsonrpc":"2.0"}'