-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix error:debug_traceCall API returns not valid json format output #10378
Conversation
…en the tx execute is fail
@marshalys can you please share your curl command that reproduces this issue? |
@marshalys can you also explain based on your investigation what exactly was attaching the "null" bit? my expectation was that it would only be |
@marshalys can you please test your use case with PR #10383 instead? I think I found what appends the "null" |
curl -H "Content-Type: application/json" -X POST --data '{"id":1,"jsonrpc":"2.0","method":"debug_traceCall","params":[{"from":"0xae2fc483527b8ef99eb5d9b44875f005ba1fae13","to":"0x6b75d8af000000e20b7a7ddf000ba900b4009a80","value":"0x16906ca2e71","gas":"0x2eaf9","gasPrice":"0x1175c375f","data":"0x57c7bbec68d12a0d1830360f8ec58fa599ba1b0e9b5fedbf9b6fdac17f958d2ee523a2206206994597c13d831ec70064","accessList":[],"type":"0x2"},"0x27a66641a0f38c81e961deeb142d54dc20ba64632f31ebc3c814057ed502c3e5",{}]}' 127.0.0.1:8545 |
to check result has many case depend the api return value, result may be bool or string also. |
if the api call failed, the
|
That's fine. I have other plans to make our json streaming guarantee correctness. Will work on implementing a stack-based Streamer around jsoniter.Stream that closes all pending json objects and fields upon errors. This way in case of errors we will always have generated correct json. The PR I sent is aimed at simply fixing the issue you are reporting. Would appreciate you trying it out on your machine to verify it fixes the issue you raised please. That is the direction I prefer to take for now. |
That is because as far as I know geth does not use JSON streaming. Erigon uses json streaming. If there is an error a client should ignore the |
Managed to test #10383 which seems to have fixed the reported issue. Closing in favour of:
@marshalys many thanks for your contribution and for reporting this issue 🙏 |
Yes, I think your conside is good. |
try to fix debug_traceCall API returns not valid json format output when the tx execute is fail
#10376