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

Skaled returns error on valid debug_traceCall request #1748

Closed
oleksandrSydorenkoJ opened this issue Dec 12, 2023 · 4 comments · Fixed by #1772
Closed

Skaled returns error on valid debug_traceCall request #1748

oleksandrSydorenkoJ opened this issue Dec 12, 2023 · 4 comments · Fixed by #1772
Assignees
Labels
bug Something isn't working epic:archive-node

Comments

@oleksandrSydorenkoJ
Copy link

oleksandrSydorenkoJ commented Dec 12, 2023

Preconditions
Active chains
Archival node
Address with Sfuel and with Whitelist deployer role
Contract to deploy: Example ERC20

Versions
skalenetwork/schain:3.17.2-develop.2-historic

Steps to reproduce

  1. Send JSON-RPC call to the archival node - totalSupply() method via eth_call and debug_traceCall
    eth_call
curl  http://10.3.155.147:10131  -X POST  -H "Content-Type: application/json"  --data '{"id":1,"jsonrpc":"2.0","method":"eth_call","params":[{"from":"0xb04a7f2Cd74Eb624Df4BD8bed8f7034B5Aed89C0","to":"0x3bcDb2642cBC0d351F6Bc7fDFEA50120cE9146AC","data":"0x18160ddd0000000000000000000000000000000000000000000000000000000000000000"},"latest"]}'

debug_traceCall

curl  http://10.3.155.147:10131   -X POST  -H "Content-Type: application/json" --data '{"id":1,"jsonrpc":"2.0","method":"debug_traceCall","params":[{"from":"0xb04a7f2Cd74Eb624Df4BD8bed8f7034B5Aed89C0","to":"0x3bcDb2642cBC0d351F6Bc7fDFEA50120cE9146AC","data":"0x18160ddd0000000000000000000000000000000000000000000000000000000000000000"},"latest"]}'
  1. check the result

Actual state:
Eth-call returns the total supply value 0x000000000000000000000000000000000000000000000000000000003b9aca00
debug_traceBlock returns: INVALID_PARAMS: Invalid method parameters (invalid name and/or type) recognised error

Expected behavior
Skaled should return the number of possible tracing result by executing an eth call within the context of the given block execution.

@PolinaKiporenko PolinaKiporenko moved this to Ready For Pickup in SKALE Engineering 🚀 Dec 12, 2023
@PolinaKiporenko PolinaKiporenko moved this from Ready For Pickup to In Progress in SKALE Engineering 🚀 Dec 13, 2023
This was linked to pull requests Dec 15, 2023
This was linked to pull requests Dec 27, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Ready For Release Candidate in SKALE Engineering 🚀 Jan 4, 2024
@PolinaKiporenko PolinaKiporenko moved this from Ready For Release Candidate to Code Review in SKALE Engineering 🚀 Jan 4, 2024
@PolinaKiporenko PolinaKiporenko moved this from Code Review to Ready For Release Candidate in SKALE Engineering 🚀 Jan 4, 2024
@oleksandrSydorenkoJ
Copy link
Author

still relevant for 3.17.2-develop.3-historic

request regular eth_call

curl  http://1.1.1.1:10131  -X POST  -H "Content-Type: application/json"  --data '{"id":1,"jsonrpc":"2.0","method":"eth_call","params":[{"from":"0xb04a7f2Cd74Eb624Df4BD8bed8f7034B5Aed89C0","to":"0xE6A2c576a7759300207D7F5Bf607336635737176","data":"0x18160ddd0000000000000000000000000000000000000000000000000000000000000000"},"latest"]}'

response:

{"id":1,"jsonrpc":"2.0","result":"0x0000000000000000000000000000000000000000000000000038d7ea8802ca00"}

request debbug_traceCall

curl  http://1.1.1.1:10131   -X POST  -H "Content-Type: application/json" --data '{"id":1,"jsonrpc":"2.0","metcurl  http://10.3.155.147:10131   -X POST  -H "Content-Type: application/json" --data '{"id":1,"jsonrpc":"2.0","method":"debug_traceCall","params":[{"from":"0xb04a7f2Cd74Eb624Df4BD8bed8f7034B5Aed89C0","to":"0xE6A2c576a7759300207D7F5Bf607336635737176","data":"0x18160ddd0000000000000000000000000000000000000000000000000000000000000000"},"latest"]}'

response:

{"error":{"code":-32602,"message":"INVALID_PARAMS: Invalid method parameters (invalid name and/or type) recognised"},"id":1,"jsonrpc":"2.0"}

@github-project-automation github-project-automation bot moved this from Ready For Release Candidate to Ready For Pickup in SKALE Engineering 🚀 Jan 5, 2024
@oleksandrSydorenkoJ
Copy link
Author

oleksandrSydorenkoJ commented Jan 5, 2024

UPD
Partially fixed on 3.17.2-develop.3-historic

need to add a handler for the absence of an empty object in the params field.

curl  http://1.1.1.1:10131   -X POST  -H "Content-Type: application/json" --data '{"id":1,"jsonrpc":"2.0","method":"debug_traceCall","params":[{"from":null,"to":"0xE6A2c576a7759300207D7F5Bf607336635737176","data":"0x18160ddd0000000000000000000000000000000000000000000000000000000000000000"},"latest", {}]}'
{"id":1,"jsonrpc":"2.0","result":{"failed":false,"gas":22187,"returnValue":"0000000000000000000000000000000000000000000000000038d7ea8802ca00","structLogs":[{"depth":1,"gas":268414263,"gasCost":3,"op":"PUSH1","pc":0,"stack":[]},{"depth":1,"gas":268414260,"gasCost":3,"op":"PUSH1","pc":2,"stack":["0x80"]},{"depth":1,"gas":268414257,"gasCost":12,"op":"MSTORE","pc":4,"stack":["0x80","0x40"]},{"depth":1,"gas":268414245,"gasCost":2,"op":"CALLVALUE","pc":5,"stack":[]},{"depth":1,"gas":268414243,"gasCost":3,"op":"DUP1","pc":6,"stack":["0x0"]},{"depth":1,"gas":268414240,"gasCost":3,"op":"ISZERO","pc":7,"stack":["0x0","0x0"]},{"depth":1,"gas":268414237,"gasCost":3,"op":"PUSH2","pc":8,"stack":["0x0","0x1"]},{"depth":1,"gas":268414234,"gasCost":10,"op":"JUMPI","pc":11,"stack":["0x0","0x1","0x10"]},{"depth":1,"gas":268414224,"gasCost":1,"op":"JUMPDEST","pc":16,"stack":["0x0"]},{"depth":1,"gas":268414223,"gasCost":2,"op":"POP","pc":17,"stack":["0x0"]},{"depth":1,"gas":268414221,"gasCost":3,"op":"PUSH1","pc":18,"stack":[]},{"depth":1,"gas":268414218,"gasCost":2,"op":"CALLDATASIZE","pc":20,"stack":["0x4"]},{"depth":1,"gas":268414216,"gasCost":3,"op":"LT","pc":21,"stack":["0x4","0x24"]},{"depth":1,"gas":268414213,"gasCost":3,"op":"PUSH2","pc":22,"stack":["0x0"]},{"depth":1,"gas":268414210,"gasCost":10,"op":"JUMPI","pc":25,"stack":["0x0","0x62"]},{"depth":1,"gas":268414200,"gasCost":3,"op":"PUSH1","pc":26,"stack":[]},{"depth":1,"gas":268414197,"gasCost":3,"op":"CALLDATALOAD","pc":28,"stack":["0x0"]},{"depth":1,"gas":268414194,"gasCost":3,"op":"PUSH1","pc":29,"stack":["0x18160ddd00000000000000000000000000000000000000000000000000000000"]},{"depth":1,"gas":268414191,"gasCost":3,"op":"SHR","pc":31,"stack":["0x18160ddd00000000000000000000000000000000000000000000000000000000","0xe0"]},{"depth":1,"gas":268414188,"gasCost":3,"op":"DUP1","pc":32,"stack":["0x18160ddd"]},{"depth":1,"gas":268414185,"gasCost":3,"op":"PUSH4","pc":33,"stack":["0x18160ddd","0x18160ddd"]},{"depth":1,"gas":268414182,"gasCost":3,"op":"EQ","pc":38,"stack":["0x18160ddd","0x18160ddd","0x6fdde03"]},{"depth":1,"gas":268414179,"gasCost":3,"op":"PUSH2","pc":39,"stack":["0x18160ddd","0x0"]},{"depth":1,"gas":268414176,"gasCost":10,"op":"JUMPI","pc":42,"stack":["0x18160ddd","0x0","0x67"]},{"depth":1,"gas":268414166,"gasCost":3,"op":"DUP1","pc":43,"stack":["0x18160ddd"]},{"depth":1,"gas":268414163,"gasCost":3,"op":"PUSH4","pc":44,"stack":["0x18160ddd","0x18160ddd"]},{"depth":1,"gas":268414160,"gasCost":3,"op":"EQ","pc":49,"stack":["0x18160ddd","0x18160ddd","0x18160ddd"]},{"depth":1,"gas":268414157,"gasCost":3,"op":"PUSH2","pc":50,"stack":["0x18160ddd","0x1"]},{"depth":1,"gas":268414154,"gasCost":10,"op":"JUMPI","pc":53,"stack":["0x18160ddd","0x1","0x85"]},{"depth":1,"gas":268414144,"gasCost":1,"op":"JUMPDEST","pc":133,"stack":["0x18160ddd"]},{"depth":1,"gas":268414143,"gasCost":3,"op":"PUSH2","pc":134,"stack":["0x18160ddd"]},{"depth":1,"gas":268414140,"gasCost":3,"op":"PUSH1","pc":137,"stack":["0x18160ddd","0x8e"]},{"depth":1,"gas":268414137,"gasCost":800,"op":"SLOAD","pc":139,"stack":["0x18160ddd","0x8e","0x2"],"storage":{"0000000000000000000000000000000000000000000000000000000000000002":"0000000000000000000000000000000000000000000000000038d7ea8802ca00"}},{"depth":1,"gas":268413337,"gasCost":3,"op":"DUP2","pc":140,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00"]},{"depth":1,"gas":268413334,"gasCost":8,"op":"JUMP","pc":141,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00","0x8e"]},{"depth":1,"gas":268413326,"gasCost":1,"op":"JUMPDEST","pc":142,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00"]},{"depth":1,"gas":268413325,"gasCost":3,"op":"PUSH1","pc":143,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00"]},{"depth":1,"gas":268413322,"gasCost":3,"op":"MLOAD","pc":145,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00","0x40"]},{"depth":1,"gas":268413319,"gasCost":3,"op":"SWAP1","pc":146,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00","0x80"]},{"depth":1,"gas":268413316,"gasCost":3,"op":"DUP2","pc":147,"stack":["0x18160ddd","0x8e","0x80","0x38d7ea8802ca00"]},{"depth":1,"gas":268413313,"gasCost":9,"op":"MSTORE","pc":148,"stack":["0x18160ddd","0x8e","0x80","0x38d7ea8802ca00","0x80"]},{"depth":1,"gas":268413304,"gasCost":3,"op":"PUSH1","pc":149,"stack":["0x18160ddd","0x8e","0x80"]},{"depth":1,"gas":268413301,"gasCost":3,"op":"ADD","pc":151,"stack":["0x18160ddd","0x8e","0x80","0x20"]},{"depth":1,"gas":268413298,"gasCost":3,"op":"PUSH2","pc":152,"stack":["0x18160ddd","0x8e","0xa0"]},{"depth":1,"gas":268413295,"gasCost":8,"op":"JUMP","pc":155,"stack":["0x18160ddd","0x8e","0xa0","0x7c"]},{"depth":1,"gas":268413287,"gasCost":1,"op":"JUMPDEST","pc":124,"stack":["0x18160ddd","0x8e","0xa0"]},{"depth":1,"gas":268413286,"gasCost":3,"op":"PUSH1","pc":125,"stack":["0x18160ddd","0x8e","0xa0"]},{"depth":1,"gas":268413283,"gasCost":3,"op":"MLOAD","pc":127,"stack":["0x18160ddd","0x8e","0xa0","0x40"]},{"depth":1,"gas":268413280,"gasCost":3,"op":"DUP1","pc":128,"stack":["0x18160ddd","0x8e","0xa0","0x80"]},{"depth":1,"gas":268413277,"gasCost":3,"op":"SWAP2","pc":129,"stack":["0x18160ddd","0x8e","0xa0","0x80","0x80"]},{"depth":1,"gas":268413274,"gasCost":3,"op":"SUB","pc":130,"stack":["0x18160ddd","0x8e","0x80","0x80","0xa0"]},{"depth":1,"gas":268413271,"gasCost":3,"op":"SWAP1","pc":131,"stack":["0x18160ddd","0x8e","0x80","0x20"]},{"depth":1,"gas":268413268,"gasCost":0,"op":"RETURN","pc":132,"stack":["0x18160ddd","0x8e","0x20","0x80"]}]}

But, according to the documentation https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug, JSON RPC call should be valid without the empty object

> curl -H "Content-Type: application/json" -X POST  localhost:8545 --data '{"jsonrpc":"2.0","method":"debug_traceCall","params":[null, "pending"],"id":1}'

@oleksandrSydorenkoJ oleksandrSydorenkoJ changed the title debug_traceCall doesn't work Skaled returns error on valid debug_traceCall request Jan 5, 2024
@oleksandrSydorenkoJ
Copy link
Author

oleksandrSydorenkoJ commented Jan 8, 2024

3.17.2-develop.3-historic

callTracer:

{'jsonrpc': '2.0', 'method': 'debug_traceCall', 'params': [{'from': '0x0000000000000000000000000000000000000000', 'to': '0x5508D5615fCaf28a96c61E119685eD8dccC22FcE', 'data': '0x18160ddd0000000000000000000000000000000000000000000000000000000000000000'}, 'latest', {'tracer': 'callTracer'}], 'id': 1}
Response traceCall: {"id":1,"jsonrpc":"2.0","result":{"from":"0x0000000000000000000000000000000000000000","gas":"0xfffad37","gasUsed":"0x56ab","input":"0x18160ddd0000000000000000000000000000000000000000000000000000000000000000","output":"0x0000000000000000000000000000000000000000000000000038d7ea8802ca00","to":"0x5508d5615fcaf28a96c61e119685ed8dccc22fce","type":"CALL","value":"0x0"}}

4byteTracer

{'jsonrpc': '2.0', 'method': 'debug_traceCall', 'params': [{'from': '0x0000000000000000000000000000000000000000', 'to': '0x5508D5615fCaf28a96c61E119685eD8dccC22FcE', 'data': '0x18160ddd0000000000000000000000000000000000000000000000000000000000000000'}, 'latest', {'tracer': '4byteTracer'}], 'id': 1}
Response traceCall: {"id":1,"jsonrpc":"2.0","result":{"0x18160ddd-32":1}}

prestateTracer

{'jsonrpc': '2.0', 'method': 'debug_traceCall', 'params': [{'from': '0x0000000000000000000000000000000000000000', 'to': '0x5508D5615fCaf28a96c61E119685eD8dccC22FcE', 'data': '0x18160ddd0000000000000000000000000000000000000000000000000000000000000000'}, 'latest', {'tracer': 'prestateTracer'}], 'id': 1}
Debug eth_call status code : 200
Response traceCall: {"id":1,"jsonrpc":"2.0","result":{"0x0000000000000000000000000000000000000000":{"balance":"0x0"},"0x5508d5615fcaf28a96c61e119685ed8dccc22fce":{"balance":"0x0","code":"0x608060405234801561001057600080fd5b50600436106100625760003560e01c806306fdde031461006757806318160ddd1461008557806340c10f191461009c57806356b8c724146100b157806370a08231146100d457806395d89b41146100f4575b600080fd5b61006f6100fc565b60405161007c9190610483565b60405180910390f35b61008e60025481565b60405190815260200161007c565b6100af6100aa366004610341565b61018a565b005b6100c46100bf36600461036b565b6101d4565b604051901515815260200161007c565b61008e6100e236600461031f565b60036020526000908152604090205481565b61006f6102f6565b60008054610109906104e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610135906104e6565b80156101825780601f1061015757610100808354040283529160200191610182565b820191906000526020600020905b81548152906001019060200180831161016557829003601f168201915b505050505081565b6001600160a01b038216600090815260036020526040812080548392906101b29084906104b7565b9250508190555080600260008282546101cb91906104b7565b90915550505050565b3360009081526003602052604081205483111561022e5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015260640160405180910390fd5b60005b600681101561029e5733600090815260036020526040812080548692906102599084906104cf565b90915550506001600160a01b038516600090815260036020526040812080548692906102869084906104b7565b9091555081905061029681610521565b915050610231565b50836001600160a01b0316336001600160a01b03167fcd6e659e4c2e75c3bfe47fecaccf39aeb368116a0ee52afb532e07f6cba6c0d185856040516102e4929190610496565b60405180910390a35060019392505050565b60018054610109906104e6565b80356001600160a01b038116811461031a57600080fd5b919050565b60006020828403121561033157600080fd5b61033a82610303565b9392505050565b6000806040838503121561035457600080fd5b61035d83610303565b946020939093013593505050565b60008060006060848603121561038057600080fd5b61038984610303565b925060208401359150604084013567ffffffffffffffff808211156103ad57600080fd5b818601915086601f8301126103c157600080fd5b8135818111156103d3576103d3610552565b604051601f8201601f19908116603f011681019083821181831017156103fb576103fb610552565b8160405282815289602084870101111561041457600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000815180845260005b8181101561045c57602081850181015186830182015201610440565b8181111561046e576000602083870101525b50601f01601f19169290920160200192915050565b60208152600061033a6020830184610436565b8281526040602082015260006104af6040830184610436565b949350505050565b600082198211156104ca576104ca61053c565b500190565b6000828210156104e1576104e161053c565b500390565b600181811c908216806104fa57607f821691505b6020821081141561051b57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156105355761053561053c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212205393945b341e6ee5bb89c350656b19b8439867683ac45c09491327bbfba1d64864736f6c63430008060033","nonce":1,"storage":{"0x0000000000000000000000000000000000000000000000000000000000000002":"0x0000000000000000000000000000000000000000000000000038d7ea8802ca00"}}}}

noopTracer

{'jsonrpc': '2.0', 'method': 'debug_traceCall', 'params': [{'from': '0x0000000000000000000000000000000000000000', 'to': '0x5508D5615fCaf28a96c61E119685eD8dccC22FcE', 'data': '0x18160ddd0000000000000000000000000000000000000000000000000000000000000000'}, 'latest', {'tracer': 'noopTracer'}], 'id': 1}
Response traceCall: {"id":1,"jsonrpc":"2.0","result":{}}

replayTracer

{'jsonrpc': '2.0', 'method': 'debug_traceCall', 'params': [{'from': '0x0000000000000000000000000000000000000000', 'to': '0x5508D5615fCaf28a96c61E119685eD8dccC22FcE', 'data': '0x18160ddd0000000000000000000000000000000000000000000000000000000000000000'}, 'latest', {'tracer': 'replayTracer'}], 'id': 1}
Response traceCall: {"id":1,"jsonrpc":"2.0","result":{"output":"0x0000000000000000000000000000000000000000000000000038d7ea8802ca00","stateDiff":null,"trace":[{"action":{"callType":"call","from":"0x0000000000000000000000000000000000000000","gas":"0x000000000000000000000000000000000000000000000000000000000fffad37","input":"0x18160ddd0000000000000000000000000000000000000000000000000000000000000000","to":"0x5508d5615fcaf28a96c61e119685ed8dccc22fce","value":"0x0000000000000000000000000000000000000000000000000000000000000000"},"result":{"gasUsed":"0x00000000000000000000000000000000000000000000000000000000000056ab","output":"0x0000000000000000000000000000000000000000000000000038d7ea8802ca00"},"subtraces":0,"traceAddress":[],"type":"call"}],"transactionHash":"0xadc168943b71d4d0099fbe3a0970be6dbbef29dbc94453c41ebd31d29e4edc87","vmTrace":null}}

allTracer (Skaled only available)

{'jsonrpc': '2.0', 'method': 'debug_traceCall', 'params': [{'from': '0x0000000000000000000000000000000000000000', 'to': '0x5508D5615fCaf28a96c61E119685eD8dccC22FcE', 'data': '0x18160ddd0000000000000000000000000000000000000000000000000000000000000000'}, 'latest', {'tracer': 'allTracer'}], 'id': 1}
Debug eth_call status code : 200
Response traceCall: {"id":1,"jsonrpc":"2.0","result":{"4byteTrace":{"0x18160ddd-32":1},"callTrace":{"from":"0x0000000000000000000000000000000000000000","gas":"0xfffad37","gasUsed":"0x56ab","input":"0x18160ddd0000000000000000000000000000000000000000000000000000000000000000","output":"0x0000000000000000000000000000000000000000000000000038d7ea8802ca00","to":"0x5508d5615fcaf28a96c61e119685ed8dccc22fce","type":"CALL","value":"0x0"},"defaultTrace":{"failed":false,"gas":22187,"returnValue":"0000000000000000000000000000000000000000000000000038d7ea8802ca00","structLogs":[{"depth":1,"gas":268414263,"gasCost":3,"op":"PUSH1","pc":0,"stack":[]},{"depth":1,"gas":268414260,"gasCost":3,"op":"PUSH1","pc":2,"stack":["0x80"]},{"depth":1,"gas":268414257,"gasCost":12,"op":"MSTORE","pc":4,"stack":["0x80","0x40"]},{"depth":1,"gas":268414245,"gasCost":2,"op":"CALLVALUE","pc":5,"stack":[]},{"depth":1,"gas":268414243,"gasCost":3,"op":"DUP1","pc":6,"stack":["0x0"]},{"depth":1,"gas":268414240,"gasCost":3,"op":"ISZERO","pc":7,"stack":["0x0","0x0"]},{"depth":1,"gas":268414237,"gasCost":3,"op":"PUSH2","pc":8,"stack":["0x0","0x1"]},{"depth":1,"gas":268414234,"gasCost":10,"op":"JUMPI","pc":11,"stack":["0x0","0x1","0x10"]},{"depth":1,"gas":268414224,"gasCost":1,"op":"JUMPDEST","pc":16,"stack":["0x0"]},{"depth":1,"gas":268414223,"gasCost":2,"op":"POP","pc":17,"stack":["0x0"]},{"depth":1,"gas":268414221,"gasCost":3,"op":"PUSH1","pc":18,"stack":[]},{"depth":1,"gas":268414218,"gasCost":2,"op":"CALLDATASIZE","pc":20,"stack":["0x4"]},{"depth":1,"gas":268414216,"gasCost":3,"op":"LT","pc":21,"stack":["0x4","0x24"]},{"depth":1,"gas":268414213,"gasCost":3,"op":"PUSH2","pc":22,"stack":["0x0"]},{"depth":1,"gas":268414210,"gasCost":10,"op":"JUMPI","pc":25,"stack":["0x0","0x62"]},{"depth":1,"gas":268414200,"gasCost":3,"op":"PUSH1","pc":26,"stack":[]},{"depth":1,"gas":268414197,"gasCost":3,"op":"CALLDATALOAD","pc":28,"stack":["0x0"]},{"depth":1,"gas":268414194,"gasCost":3,"op":"PUSH1","pc":29,"stack":["0x18160ddd00000000000000000000000000000000000000000000000000000000"]},{"depth":1,"gas":268414191,"gasCost":3,"op":"SHR","pc":31,"stack":["0x18160ddd00000000000000000000000000000000000000000000000000000000","0xe0"]},{"depth":1,"gas":268414188,"gasCost":3,"op":"DUP1","pc":32,"stack":["0x18160ddd"]},{"depth":1,"gas":268414185,"gasCost":3,"op":"PUSH4","pc":33,"stack":["0x18160ddd","0x18160ddd"]},{"depth":1,"gas":268414182,"gasCost":3,"op":"EQ","pc":38,"stack":["0x18160ddd","0x18160ddd","0x6fdde03"]},{"depth":1,"gas":268414179,"gasCost":3,"op":"PUSH2","pc":39,"stack":["0x18160ddd","0x0"]},{"depth":1,"gas":268414176,"gasCost":10,"op":"JUMPI","pc":42,"stack":["0x18160ddd","0x0","0x67"]},{"depth":1,"gas":268414166,"gasCost":3,"op":"DUP1","pc":43,"stack":["0x18160ddd"]},{"depth":1,"gas":268414163,"gasCost":3,"op":"PUSH4","pc":44,"stack":["0x18160ddd","0x18160ddd"]},{"depth":1,"gas":268414160,"gasCost":3,"op":"EQ","pc":49,"stack":["0x18160ddd","0x18160ddd","0x18160ddd"]},{"depth":1,"gas":268414157,"gasCost":3,"op":"PUSH2","pc":50,"stack":["0x18160ddd","0x1"]},{"depth":1,"gas":268414154,"gasCost":10,"op":"JUMPI","pc":53,"stack":["0x18160ddd","0x1","0x85"]},{"depth":1,"gas":268414144,"gasCost":1,"op":"JUMPDEST","pc":133,"stack":["0x18160ddd"]},{"depth":1,"gas":268414143,"gasCost":3,"op":"PUSH2","pc":134,"stack":["0x18160ddd"]},{"depth":1,"gas":268414140,"gasCost":3,"op":"PUSH1","pc":137,"stack":["0x18160ddd","0x8e"]},{"depth":1,"gas":268414137,"gasCost":800,"op":"SLOAD","pc":139,"stack":["0x18160ddd","0x8e","0x2"],"storage":{"0000000000000000000000000000000000000000000000000000000000000002":"0000000000000000000000000000000000000000000000000038d7ea8802ca00"}},{"depth":1,"gas":268413337,"gasCost":3,"op":"DUP2","pc":140,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00"]},{"depth":1,"gas":268413334,"gasCost":8,"op":"JUMP","pc":141,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00","0x8e"]},{"depth":1,"gas":268413326,"gasCost":1,"op":"JUMPDEST","pc":142,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00"]},{"depth":1,"gas":268413325,"gasCost":3,"op":"PUSH1","pc":143,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00"]},{"depth":1,"gas":268413322,"gasCost":3,"op":"MLOAD","pc":145,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00","0x40"]},{"depth":1,"gas":268413319,"gasCost":3,"op":"SWAP1","pc":146,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00","0x80"]},{"depth":1,"gas":268413316,"gasCost":3,"op":"DUP2","pc":147,"stack":["0x18160ddd","0x8e","0x80","0x38d7ea8802ca00"]},{"depth":1,"gas":268413313,"gasCost":9,"op":"MSTORE","pc":148,"stack":["0x18160ddd","0x8e","0x80","0x38d7ea8802ca00","0x80"]},{"depth":1,"gas":268413304,"gasCost":3,"op":"PUSH1","pc":149,"stack":["0x18160ddd","0x8e","0x80"]},{"depth":1,"gas":268413301,"gasCost":3,"op":"ADD","pc":151,"stack":["0x18160ddd","0x8e","0x80","0x20"]},{"depth":1,"gas":268413298,"gasCost":3,"op":"PUSH2","pc":152,"stack":["0x18160ddd","0x8e","0xa0"]},{"depth":1,"gas":268413295,"gasCost":8,"op":"JUMP","pc":155,"stack":["0x18160ddd","0x8e","0xa0","0x7c"]},{"depth":1,"gas":268413287,"gasCost":1,"op":"JUMPDEST","pc":124,"stack":["0x18160ddd","0x8e","0xa0"]},{"depth":1,"gas":268413286,"gasCost":3,"op":"PUSH1","pc":125,"stack":["0x18160ddd","0x8e","0xa0"]},{"depth":1,"gas":268413283,"gasCost":3,"op":"MLOAD","pc":127,"stack":["0x18160ddd","0x8e","0xa0","0x40"]},{"depth":1,"gas":268413280,"gasCost":3,"op":"DUP1","pc":128,"stack":["0x18160ddd","0x8e","0xa0","0x80"]},{"depth":1,"gas":268413277,"gasCost":3,"op":"SWAP2","pc":129,"stack":["0x18160ddd","0x8e","0xa0","0x80","0x80"]},{"depth":1,"gas":268413274,"gasCost":3,"op":"SUB","pc":130,"stack":["0x18160ddd","0x8e","0x80","0x80","0xa0"]},{"depth":1,"gas":268413271,"gasCost":3,"op":"SWAP1","pc":131,"stack":["0x18160ddd","0x8e","0x80","0x20"]},{"depth":1,"gas":268413268,"gasCost":0,"op":"RETURN","pc":132,"stack":["0x18160ddd","0x8e","0x20","0x80"]}]},"noopTrace":{},"prestateTrace":{"0x0000000000000000000000000000000000000000":{"balance":"0x0"},"0x5508d5615fcaf28a96c61e119685ed8dccc22fce":{"balance":"0x0","code":"0x608060405234801561001057600080fd5b50600436106100625760003560e01c806306fdde031461006757806318160ddd1461008557806340c10f191461009c57806356b8c724146100b157806370a08231146100d457806395d89b41146100f4575b600080fd5b61006f6100fc565b60405161007c9190610483565b60405180910390f35b61008e60025481565b60405190815260200161007c565b6100af6100aa366004610341565b61018a565b005b6100c46100bf36600461036b565b6101d4565b604051901515815260200161007c565b61008e6100e236600461031f565b60036020526000908152604090205481565b61006f6102f6565b60008054610109906104e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610135906104e6565b80156101825780601f1061015757610100808354040283529160200191610182565b820191906000526020600020905b81548152906001019060200180831161016557829003601f168201915b505050505081565b6001600160a01b038216600090815260036020526040812080548392906101b29084906104b7565b9250508190555080600260008282546101cb91906104b7565b90915550505050565b3360009081526003602052604081205483111561022e5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015260640160405180910390fd5b60005b600681101561029e5733600090815260036020526040812080548692906102599084906104cf565b90915550506001600160a01b038516600090815260036020526040812080548692906102869084906104b7565b9091555081905061029681610521565b915050610231565b50836001600160a01b0316336001600160a01b03167fcd6e659e4c2e75c3bfe47fecaccf39aeb368116a0ee52afb532e07f6cba6c0d185856040516102e4929190610496565b60405180910390a35060019392505050565b60018054610109906104e6565b80356001600160a01b038116811461031a57600080fd5b919050565b60006020828403121561033157600080fd5b61033a82610303565b9392505050565b6000806040838503121561035457600080fd5b61035d83610303565b946020939093013593505050565b60008060006060848603121561038057600080fd5b61038984610303565b925060208401359150604084013567ffffffffffffffff808211156103ad57600080fd5b818601915086601f8301126103c157600080fd5b8135818111156103d3576103d3610552565b604051601f8201601f19908116603f011681019083821181831017156103fb576103fb610552565b8160405282815289602084870101111561041457600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000815180845260005b8181101561045c57602081850181015186830182015201610440565b8181111561046e576000602083870101525b50601f01601f19169290920160200192915050565b60208152600061033a6020830184610436565b8281526040602082015260006104af6040830184610436565b949350505050565b600082198211156104ca576104ca61053c565b500190565b6000828210156104e1576104e161053c565b500390565b600181811c908216806104fa57607f821691505b6020821081141561051b57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156105355761053561053c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212205393945b341e6ee5bb89c350656b19b8439867683ac45c09491327bbfba1d64864736f6c63430008060033","nonce":1,"storage":{"0x0000000000000000000000000000000000000000000000000000000000000002":"0x0000000000000000000000000000000000000000000000000038d7ea8802ca00"}}},"replayTrace":{"output":"0x0000000000000000000000000000000000000000000000000038d7ea8802ca00","stateDiff":null,"trace":[{"action":{"callType":"call","from":"0x0000000000000000000000000000000000000000","gas":"0x000000000000000000000000000000000000000000000000000000000fffad37","input":"0x18160ddd0000000000000000000000000000000000000000000000000000000000000000","to":"0x5508d5615fcaf28a96c61e119685ed8dccc22fce","value":"0x0000000000000000000000000000000000000000000000000000000000000000"},"result":{"gasUsed":"0x00000000000000000000000000000000000000000000000000000000000056ab","output":"0x0000000000000000000000000000000000000000000000000038d7ea8802ca00"},"subtraces":0,"traceAddress":[],"type":"call"}],"transactionHash":"0xadc168943b71d4d0099fbe3a0970be6dbbef29dbc94453c41ebd31d29e4edc87","vmTrace":null}}}

@oleksandrSydorenkoJ
Copy link
Author

oleksandrSydorenkoJ commented Jan 8, 2024

UPD Partially fixed on 3.17.2-develop.3-historic

need to add a handler for the absence of an empty object in the params field.

curl  http://1.1.1.1:10131   -X POST  -H "Content-Type: application/json" --data '{"id":1,"jsonrpc":"2.0","method":"debug_traceCall","params":[{"from":null,"to":"0xE6A2c576a7759300207D7F5Bf607336635737176","data":"0x18160ddd0000000000000000000000000000000000000000000000000000000000000000"},"latest", {}]}'
{"id":1,"jsonrpc":"2.0","result":{"failed":false,"gas":22187,"returnValue":"0000000000000000000000000000000000000000000000000038d7ea8802ca00","structLogs":[{"depth":1,"gas":268414263,"gasCost":3,"op":"PUSH1","pc":0,"stack":[]},{"depth":1,"gas":268414260,"gasCost":3,"op":"PUSH1","pc":2,"stack":["0x80"]},{"depth":1,"gas":268414257,"gasCost":12,"op":"MSTORE","pc":4,"stack":["0x80","0x40"]},{"depth":1,"gas":268414245,"gasCost":2,"op":"CALLVALUE","pc":5,"stack":[]},{"depth":1,"gas":268414243,"gasCost":3,"op":"DUP1","pc":6,"stack":["0x0"]},{"depth":1,"gas":268414240,"gasCost":3,"op":"ISZERO","pc":7,"stack":["0x0","0x0"]},{"depth":1,"gas":268414237,"gasCost":3,"op":"PUSH2","pc":8,"stack":["0x0","0x1"]},{"depth":1,"gas":268414234,"gasCost":10,"op":"JUMPI","pc":11,"stack":["0x0","0x1","0x10"]},{"depth":1,"gas":268414224,"gasCost":1,"op":"JUMPDEST","pc":16,"stack":["0x0"]},{"depth":1,"gas":268414223,"gasCost":2,"op":"POP","pc":17,"stack":["0x0"]},{"depth":1,"gas":268414221,"gasCost":3,"op":"PUSH1","pc":18,"stack":[]},{"depth":1,"gas":268414218,"gasCost":2,"op":"CALLDATASIZE","pc":20,"stack":["0x4"]},{"depth":1,"gas":268414216,"gasCost":3,"op":"LT","pc":21,"stack":["0x4","0x24"]},{"depth":1,"gas":268414213,"gasCost":3,"op":"PUSH2","pc":22,"stack":["0x0"]},{"depth":1,"gas":268414210,"gasCost":10,"op":"JUMPI","pc":25,"stack":["0x0","0x62"]},{"depth":1,"gas":268414200,"gasCost":3,"op":"PUSH1","pc":26,"stack":[]},{"depth":1,"gas":268414197,"gasCost":3,"op":"CALLDATALOAD","pc":28,"stack":["0x0"]},{"depth":1,"gas":268414194,"gasCost":3,"op":"PUSH1","pc":29,"stack":["0x18160ddd00000000000000000000000000000000000000000000000000000000"]},{"depth":1,"gas":268414191,"gasCost":3,"op":"SHR","pc":31,"stack":["0x18160ddd00000000000000000000000000000000000000000000000000000000","0xe0"]},{"depth":1,"gas":268414188,"gasCost":3,"op":"DUP1","pc":32,"stack":["0x18160ddd"]},{"depth":1,"gas":268414185,"gasCost":3,"op":"PUSH4","pc":33,"stack":["0x18160ddd","0x18160ddd"]},{"depth":1,"gas":268414182,"gasCost":3,"op":"EQ","pc":38,"stack":["0x18160ddd","0x18160ddd","0x6fdde03"]},{"depth":1,"gas":268414179,"gasCost":3,"op":"PUSH2","pc":39,"stack":["0x18160ddd","0x0"]},{"depth":1,"gas":268414176,"gasCost":10,"op":"JUMPI","pc":42,"stack":["0x18160ddd","0x0","0x67"]},{"depth":1,"gas":268414166,"gasCost":3,"op":"DUP1","pc":43,"stack":["0x18160ddd"]},{"depth":1,"gas":268414163,"gasCost":3,"op":"PUSH4","pc":44,"stack":["0x18160ddd","0x18160ddd"]},{"depth":1,"gas":268414160,"gasCost":3,"op":"EQ","pc":49,"stack":["0x18160ddd","0x18160ddd","0x18160ddd"]},{"depth":1,"gas":268414157,"gasCost":3,"op":"PUSH2","pc":50,"stack":["0x18160ddd","0x1"]},{"depth":1,"gas":268414154,"gasCost":10,"op":"JUMPI","pc":53,"stack":["0x18160ddd","0x1","0x85"]},{"depth":1,"gas":268414144,"gasCost":1,"op":"JUMPDEST","pc":133,"stack":["0x18160ddd"]},{"depth":1,"gas":268414143,"gasCost":3,"op":"PUSH2","pc":134,"stack":["0x18160ddd"]},{"depth":1,"gas":268414140,"gasCost":3,"op":"PUSH1","pc":137,"stack":["0x18160ddd","0x8e"]},{"depth":1,"gas":268414137,"gasCost":800,"op":"SLOAD","pc":139,"stack":["0x18160ddd","0x8e","0x2"],"storage":{"0000000000000000000000000000000000000000000000000000000000000002":"0000000000000000000000000000000000000000000000000038d7ea8802ca00"}},{"depth":1,"gas":268413337,"gasCost":3,"op":"DUP2","pc":140,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00"]},{"depth":1,"gas":268413334,"gasCost":8,"op":"JUMP","pc":141,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00","0x8e"]},{"depth":1,"gas":268413326,"gasCost":1,"op":"JUMPDEST","pc":142,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00"]},{"depth":1,"gas":268413325,"gasCost":3,"op":"PUSH1","pc":143,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00"]},{"depth":1,"gas":268413322,"gasCost":3,"op":"MLOAD","pc":145,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00","0x40"]},{"depth":1,"gas":268413319,"gasCost":3,"op":"SWAP1","pc":146,"stack":["0x18160ddd","0x8e","0x38d7ea8802ca00","0x80"]},{"depth":1,"gas":268413316,"gasCost":3,"op":"DUP2","pc":147,"stack":["0x18160ddd","0x8e","0x80","0x38d7ea8802ca00"]},{"depth":1,"gas":268413313,"gasCost":9,"op":"MSTORE","pc":148,"stack":["0x18160ddd","0x8e","0x80","0x38d7ea8802ca00","0x80"]},{"depth":1,"gas":268413304,"gasCost":3,"op":"PUSH1","pc":149,"stack":["0x18160ddd","0x8e","0x80"]},{"depth":1,"gas":268413301,"gasCost":3,"op":"ADD","pc":151,"stack":["0x18160ddd","0x8e","0x80","0x20"]},{"depth":1,"gas":268413298,"gasCost":3,"op":"PUSH2","pc":152,"stack":["0x18160ddd","0x8e","0xa0"]},{"depth":1,"gas":268413295,"gasCost":8,"op":"JUMP","pc":155,"stack":["0x18160ddd","0x8e","0xa0","0x7c"]},{"depth":1,"gas":268413287,"gasCost":1,"op":"JUMPDEST","pc":124,"stack":["0x18160ddd","0x8e","0xa0"]},{"depth":1,"gas":268413286,"gasCost":3,"op":"PUSH1","pc":125,"stack":["0x18160ddd","0x8e","0xa0"]},{"depth":1,"gas":268413283,"gasCost":3,"op":"MLOAD","pc":127,"stack":["0x18160ddd","0x8e","0xa0","0x40"]},{"depth":1,"gas":268413280,"gasCost":3,"op":"DUP1","pc":128,"stack":["0x18160ddd","0x8e","0xa0","0x80"]},{"depth":1,"gas":268413277,"gasCost":3,"op":"SWAP2","pc":129,"stack":["0x18160ddd","0x8e","0xa0","0x80","0x80"]},{"depth":1,"gas":268413274,"gasCost":3,"op":"SUB","pc":130,"stack":["0x18160ddd","0x8e","0x80","0x80","0xa0"]},{"depth":1,"gas":268413271,"gasCost":3,"op":"SWAP1","pc":131,"stack":["0x18160ddd","0x8e","0x80","0x20"]},{"depth":1,"gas":268413268,"gasCost":0,"op":"RETURN","pc":132,"stack":["0x18160ddd","0x8e","0x20","0x80"]}]}

But, according to the documentation https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug, JSON RPC call should be valid without the empty object

> curl -H "Content-Type: application/json" -X POST  localhost:8545 --data '{"jsonrpc":"2.0","method":"debug_traceCall","params":[null, "pending"],"id":1}'

will be fixed in a separate issue #1780
Closed as completed and validated on 3.17.2-develop.3-historic

@github-project-automation github-project-automation bot moved this from Ready For Pickup to Ready For Release Candidate in SKALE Engineering 🚀 Jan 8, 2024
@PolinaKiporenko PolinaKiporenko moved this from Ready For Release Candidate to Done in SKALE Engineering 🚀 Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment