Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug_traceCall returns error after update #22485

Open
fernandezpaco opened this issue Mar 11, 2021 · 6 comments
Open

debug_traceCall returns error after update #22485

fernandezpaco opened this issue Mar 11, 2021 · 6 comments

Comments

@fernandezpaco
Copy link

fernandezpaco commented Mar 11, 2021

On the previous version was working fine but after upgrade it is returning an error

System information

Geth version: v1.10.1
OS & Version: OSX

Expected behaviour

Returns trace data

Actual behaviour

Returns {code: -32000, message: 'required historical state unavailable (reexec=128)'}

Steps to reproduce the behaviour

Call debug_traceCall

Backtrace

WARN [03-11|12:59:17.640] Served debug_traceCall                   conn=127.0.0.1:61534 reqid=0x6abebb6bba01c4a5414bea640b196737385c1d251637a0cabf2d5773eb8e30e8 t=36.822322ms  err="required historical state unavailable (reexec=128)"
@fernandezpaco
Copy link
Author

Update:

If i start the node with --snapshot=false then tracing works for a while and then stops working again

im using debug_traceCall to trace pending transactions so no historical data should be needed

This was working fine on 1.9.25

@fernandezpaco
Copy link
Author

fernandezpaco commented Mar 11, 2021

Update:

if i run it with preimage (--cache.preimages) then crashes

ERROR[03-11|20:21:07.508] RPC method debug_traceCall crashed: runtime error: invalid memory address or nil pointer dereference
goroutine 105565 [running]:
github.com/ethereum/go-ethereum/rpc.(*callback).call.func1(0xc0e58d1d30, 0xf, 0xc01527fd58)
	github.com/ethereum/go-ethereum/rpc/service.go:200 +0xbd
panic(0x4e5e500, 0x5ac2a90)
	runtime/panic.go:965 +0x1b9
github.com/ethereum/go-ethereum/core/types.(*Block).NumberU64(...)
	github.com/ethereum/go-ethereum/core/types/block.go:312
github.com/ethereum/go-ethereum/eth.(*Ethereum).stateAtBlock(0xc00a125950, 0xc00016a120, 0x80, 0xc02f7be9c0, 0x0, 0x0, 0x0)
	github.com/ethereum/go-ethereum/eth/state_accessor.go:88 +0x10bd
github.com/ethereum/go-ethereum/eth.(*EthAPIBackend).StateAtBlock(0xc00173f860, 0x520d978, 0xc0c077ed00, 0xc012c14090, 0x80, 0x0, 0x0, 0x4dfc240, 0xc04838a8e0)
	github.com/ethereum/go-ethereum/eth/api_backend.go:336 +0x45
github.com/ethereum/go-ethereum/eth/tracers.(*API).TraceCall(0xc0010cb060, 0x520d978, 0xc0c077ed00, 0xc10c843d58, 0xc10c843d70, 0x0, 0x0, 0xc11b9b8620, 0xc0dd3e21b0, 0x0, ...)
	github.com/ethereum/go-ethereum/eth/tracers/api.go:707 +0x151
reflect.Value.call(0xc01382f500, 0xc01383e538, 0x13, 0x4fe1485, 0x4, 0xc0c37e5e00, 0x5, 0x5, 0xc0c37e5e30, 0xc0d8a57090, ...)
	reflect/value.go:476 +0x8e7
reflect.Value.Call(0xc01382f500, 0xc01383e538, 0x13, 0xc0c37e5e00, 0x5, 0x5, 0x0, 0x0, 0xc041354c80)
	reflect/value.go:337 +0xb9
github.com/ethereum/go-ethereum/rpc.(*callback).call(0xc0138530e0, 0x520d978, 0xc0c077ed00, 0xc0e58d1d30, 0xf, 0xc0d8a57090, 0x3, 0x3, 0x0, 0x0, ...)
	github.com/ethereum/go-ethereum/rpc/service.go:206 +0x2c5
github.com/ethereum/go-ethereum/rpc.(*handler).runMethod(0xc04fb595f0, 0x520d978, 0xc0c077ed00, 0xc1072af2d0, 0xc0138530e0, 0xc0d8a57090, 0x3, 0x3, 0x3)
	github.com/ethereum/go-ethereum/rpc/handler.go:389 +0x8a
github.com/ethereum/go-ethereum/rpc.(*handler).handleCall(0xc04fb595f0, 0xc0cea31bc0, 0xc1072af2d0, 0x203033)
	github.com/ethereum/go-ethereum/rpc/handler.go:337 +0x265
github.com/ethereum/go-ethereum/rpc.(*handler).handleCallMsg(0xc04fb595f0, 0xc0cea31bc0, 0xc1072af2d0, 0x51ffe01)
	github.com/ethereum/go-ethereum/rpc/handler.go:298 +0x1be
github.com/ethereum/go-ethereum/rpc.(*handler).handleMsg.func1(0xc0cea31bc0)
	github.com/ethereum/go-ethereum/rpc/handler.go:139 +0x46
github.com/ethereum/go-ethereum/rpc.(*handler).startCallProc.func1(0xc04fb595f0, 0xc0dd3e2198)
	github.com/ethereum/go-ethereum/rpc/handler.go:226 +0xd2
created by github.com/ethereum/go-ethereum/rpc.(*handler).startCallProc
	github.com/ethereum/go-ethereum/rpc/handler.go:222 +0x66

@holiman
Copy link
Contributor

holiman commented Mar 12, 2021

Yeah, funky condition here:

		if block = eth.blockchain.GetBlockByNumber(block.NumberU64() + 1); block == nil {
			return nil, nil, fmt.Errorf("block #%d not found", block.NumberU64()+1)
		}

I.e, if block == nil, then print out block.NumberU64()+1

@huahuayu
Copy link
Contributor

huahuayu commented Jun 14, 2021

im using debug_traceCall to trace pending transactions

hi @fernandezpaco I am looking for a working example for this function just exactly as you described.

I read all the testcases about traceCall in the code base, one is func TestTraceCall(t *testing.T) and another is func TestOverridenTraceCall(t *testing.T) , also read a document, but still don't know how to do it in practice. Could you kindly share an example?

Hope your problem been solved!

@huahuayu
Copy link
Contributor

hey, I found this document and example really helps!

@s1na
Copy link
Contributor

s1na commented Nov 2, 2022

Does this issue still persist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants