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

prestateTracer, callTracer, 4byteTracer, noopTracer return the same answer for debug_traceTransaction JSON-RPC call #1753

Closed
oleksandrSydorenkoJ opened this issue Dec 13, 2023 · 3 comments · Fixed by #1783
Assignees
Labels
bug Something isn't working epic:archive-node

Comments

@oleksandrSydorenkoJ
Copy link

oleksandrSydorenkoJ commented Dec 13, 2023

Used calls
curl http://10.3.155.147:10131 -X POST -H "Content-Type: application/json" --data '{"method":"debug_traceTransaction","params":["0x1d2b8062fd975bc3f718beb9e391ea35a10e950fb9b94857a524364b70f2b317",{"tracer":"callTracer","tracerConfig":{"withLog":true}}],"id":1,"jsonrpc":"2.0"}'
curl http://10.3.155.147:10131 -X POST -H "Content-Type: application/json" --data '{"method":"debug_traceTransaction","params":["0x1d2b8062fd975bc3f718beb9e391ea35a10e950fb9b94857a524364b70f2b317",{"tracer":"4byteTracer"}],"id":1,"jsonrpc":"2.0"}'
curl http://10.3.155.147:10131 -X POST -H "Content-Type: application/json" --data '{"method":"debug_traceTransaction","params":["0x1d2b8062fd975bc3f718beb9e391ea35a10e950fb9b94857a524364b70f2b317",{"tracer":"prestateTracer"}],"id":1,"jsonrpc":"2.0"}'
curl http://10.3.155.147:10131 -X POST -H "Content-Type: application/json" --data '{"method":"debug_traceTransaction","params":["0x1d2b8062fd975bc3f718beb9e391ea35a10e950fb9b94857a524364b70f2b317",{"tracer":"noopTracer"}],"id":1,"jsonrpc":"2.0"}'

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 transaction contract deployment to schain via any tool ( Hardhat, web3py, Remix)
  2. Wait until the transaction is mined with status 0x1 (success) and save the transaction hash
  3. Send 4 debug_traceTransaction methods with tx_hash from step 2 with every Geth Tracers
    gethTracers = ["callTracer", "4byteTracer", "prestateTracer", "noopTracer"]

Expected state:
The prestateTracer returns the accounts necessary to execute a given transaction
callTracer - tracks all the call frames executed during a transaction, including depth 0.
4byteTracer - collects the function selectors of every function executed in the lifetime of a transaction, along with the size of the supplied call data.
noopTracer - should return an empty object and is only meant for testing the setup

Actual state:
Skaled returns the same output for all 4 traces of a given transaction that is valid only for the callTracer argument

Log output 4 times for each call

{"id":1,"jsonrpc":"2.0","result":{"from":"0xb04a7f2cd74eb624df4bd8bed8f7034b5aed89c0","gas":"0x05ab9e","gasUsed":"0x06fc5a","output":"0x608060405234801561001057600080fd5b50600436106100625760003560e01c806306fdde031461006757806318160ddd1461008557806340c10f191461009c57806356b8c724146100b157806370a08231146100d457806395d89b41146100f4575b600080fd5b61006f6100fc565b60405161007c9190610483565b60405180910390f35b61008e60025481565b60405190815260200161007c565b6100af6100aa366004610341565b61018a565b005b6100c46100bf36600461036b565b6101d4565b604051901515815260200161007c565b61008e6100e236600461031f565b60036020526000908152604090205481565b61006f6102f6565b60008054610109906104e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610135906104e6565b80156101825780601f1061015757610100808354040283529160200191610182565b820191906000526020600020905b81548152906001019060200180831161016557829003601f168201915b505050505081565b6001600160a01b038216600090815260036020526040812080548392906101b29084906104b7565b9250508190555080600260008282546101cb91906104b7565b90915550505050565b3360009081526003602052604081205483111561022e5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015260640160405180910390fd5b60005b600681101561029e5733600090815260036020526040812080548692906102599084906104cf565b90915550506001600160a01b038516600090815260036020526040812080548692906102869084906104b7565b9091555081905061029681610521565b915050610231565b50836001600160a01b0316336001600160a01b03167fcd6e659e4c2e75c3bfe47fecaccf39aeb368116a0ee52afb532e07f6cba6c0d185856040516102e4929190610496565b60405180910390a35060019392505050565b60018054610109906104e6565b80356001600160a01b038116811461031a57600080fd5b919050565b60006020828403121561033157600080fd5b61033a82610303565b9392505050565b6000806040838503121561035457600080fd5b61035d83610303565b946020939093013593505050565b60008060006060848603121561038057600080fd5b61038984610303565b925060208401359150604084013567ffffffffffffffff808211156103ad57600080fd5b818601915086601f8301126103c157600080fd5b8135818111156103d3576103d3610552565b604051601f8201601f19908116603f011681019083821181831017156103fb576103fb610552565b8160405282815289602084870101111561041457600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000815180845260005b8181101561045c57602081850181015186830182015201610440565b8181111561046e576000602083870101525b50601f01601f19169290920160200192915050565b60208152600061033a6020830184610436565b8281526040602082015260006104af6040830184610436565b949350505050565b600082198211156104ca576104ca61053c565b500190565b6000828210156104e1576104e161053c565b500390565b600181811c908216806104fa57607f821691505b6020821081141561051b57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156105355761053561053c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212205393945b341e6ee5bb89c350656b19b8439867683ac45c09491327bbfba1d64864736f6c63430008060033","type":"CREATE","value":"0x"}}

The same calls on Goerly

debug_traceTranscation_goerly.txt

@kladkogex
Copy link
Collaborator

This bug was fixed as a part of 1751 fix

@kladkogex kladkogex linked a pull request Jan 22, 2024 that will close this issue
@kladkogex kladkogex moved this from Ready For Pickup to Merged To Release Candidate in SKALE Engineering 🚀 Jan 22, 2024
@github-project-automation github-project-automation bot moved this from QA to Ready For Release Candidate in SKALE Engineering 🚀 Feb 5, 2024
@oleksandrSydorenkoJ
Copy link
Author

Verified on Legacy network
Version: skalenetwork/schain:3.18.1-beta.0-historic
skale_schain_these-long-sadalsuud
Transaction token transfer 0x652cdca90b236cc37d4ce2b5b0ed9072c510468e6dfef40b48fca7c5c1512c6e


$ curl http://localhost:10195/   -X POST -H "Content-Type: application/json" --data '{"method":"debug_traceTransaction","params":["0xcb49df24a751049963245c259edbf8e4a75d60a487adb0c73266c9d561c53983", {"tracer": "callTracer"}], "id":1,"jsonrpc":"2.0"}'
{"id":1,"jsonrpc":"2.0","result":{"from":"0x71cbe3fede33905d4d1bf2bd51f9d4a62375e659","gas":"0xee6b280","gasUsed":"0x6fc8a","input":"0x608060405234801561001057600080fd5b5060405161082338038061082383398101604081905261002f916101b9565b8251610042906000906020860190610074565b508151610056906001906020850190610074565b50600281905533600090815260036020526040902055506102769050565b82805461008090610225565b90600052602060002090601f0160209004810192826100a257600085556100e8565b82601f106100bb57805160ff19168380011785556100e8565b828001600101855582156100e8579182015b828111156100e85782518255916020019190600101906100cd565b506100f49291506100f8565b5090565b5b808211156100f457600081556001016100f9565b600082601f83011261011e57600080fd5b81516001600160401b038082111561013857610138610260565b604051601f8301601f19908116603f0116810190828211818310171561016057610160610260565b8160405283815260209250868385880101111561017c57600080fd5b600091505b8382101561019e5785820183015181830184015290820190610181565b838211156101af5760008385830101525b9695505050505050565b6000806000606084860312156101ce57600080fd5b83516001600160401b03808211156101e557600080fd5b6101f18783880161010d565b9450602086015191508082111561020757600080fd5b506102148682870161010d565b925050604084015190509250925092565b600181811c9082168061023957607f821691505b6020821081141561025a57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b61059e806102856000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806306fdde031461006757806318160ddd1461008557806340c10f191461009c57806356b8c724146100b157806370a08231146100d457806395d89b41146100f4575b600080fd5b61006f6100fc565b60405161007c9190610483565b60405180910390f35b61008e60025481565b60405190815260200161007c565b6100af6100aa366004610341565b61018a565b005b6100c46100bf36600461036b565b6101d4565b604051901515815260200161007c565b61008e6100e236600461031f565b60036020526000908152604090205481565b61006f6102f6565b60008054610109906104e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610135906104e6565b80156101825780601f1061015757610100808354040283529160200191610182565b820191906000526020600020905b81548152906001019060200180831161016557829003601f168201915b505050505081565b6001600160a01b038216600090815260036020526040812080548392906101b29084906104b7565b9250508190555080600260008282546101cb91906104b7565b90915550505050565b3360009081526003602052604081205483111561022e5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015260640160405180910390fd5b60005b600681101561029e5733600090815260036020526040812080548692906102599084906104cf565b90915550506001600160a01b038516600090815260036020526040812080548692906102869084906104b7565b9091555081905061029681610521565b915050610231565b50836001600160a01b0316336001600160a01b03167fcd6e659e4c2e75c3bfe47fecaccf39aeb368116a0ee52afb532e07f6cba6c0d185856040516102e4929190610496565b60405180910390a35060019392505050565b60018054610109906104e6565b80356001600160a01b038116811461031a57600080fd5b919050565b60006020828403121561033157600080fd5b61033a82610303565b9392505050565b6000806040838503121561035457600080fd5b61035d83610303565b946020939093013593505050565b60008060006060848603121561038057600080fd5b61038984610303565b925060208401359150604084013567ffffffffffffffff808211156103ad57600080fd5b818601915086601f8301126103c157600080fd5b8135818111156103d3576103d3610552565b604051601f8201601f19908116603f011681019083821181831017156103fb576103fb610552565b8160405282815289602084870101111561041457600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000815180845260005b8181101561045c57602081850181015186830182015201610440565b8181111561046e576000602083870101525b50601f01601f19169290920160200192915050565b60208152600061033a6020830184610436565b8281526040602082015260006104af6040830184610436565b949350505050565b600082198211156104ca576104ca61053c565b500190565b6000828210156104e1576104e161053c565b500390565b600181811c908216806104fa57607f821691505b6020821081141561051b57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156105355761053561053c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212205393945b341e6ee5bb89c350656b19b8439867683ac45c09491327bbfba1d64864736f6c63430008060033000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000056bc75e2d63100000000000000000000000000000000000000000000000000000000000000000000b746573745141546f6b656e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035141540000000000000000000000000000000000000000000000000000000000","output":"0x608060405234801561001057600080fd5b50600436106100625760003560e01c806306fdde031461006757806318160ddd1461008557806340c10f191461009c57806356b8c724146100b157806370a08231146100d457806395d89b41146100f4575b600080fd5b61006f6100fc565b60405161007c9190610483565b60405180910390f35b61008e60025481565b60405190815260200161007c565b6100af6100aa366004610341565b61018a565b005b6100c46100bf36600461036b565b6101d4565b604051901515815260200161007c565b61008e6100e236600461031f565b60036020526000908152604090205481565b61006f6102f6565b60008054610109906104e6565b80601f0160208091040260200160405190810160405280929190818152602001828054610135906104e6565b80156101825780601f1061015757610100808354040283529160200191610182565b820191906000526020600020905b81548152906001019060200180831161016557829003601f168201915b505050505081565b6001600160a01b038216600090815260036020526040812080548392906101b29084906104b7565b9250508190555080600260008282546101cb91906104b7565b90915550505050565b3360009081526003602052604081205483111561022e5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015260640160405180910390fd5b60005b600681101561029e5733600090815260036020526040812080548692906102599084906104cf565b90915550506001600160a01b038516600090815260036020526040812080548692906102869084906104b7565b9091555081905061029681610521565b915050610231565b50836001600160a01b0316336001600160a01b03167fcd6e659e4c2e75c3bfe47fecaccf39aeb368116a0ee52afb532e07f6cba6c0d185856040516102e4929190610496565b60405180910390a35060019392505050565b60018054610109906104e6565b80356001600160a01b038116811461031a57600080fd5b919050565b60006020828403121561033157600080fd5b61033a82610303565b9392505050565b6000806040838503121561035457600080fd5b61035d83610303565b946020939093013593505050565b60008060006060848603121561038057600080fd5b61038984610303565b925060208401359150604084013567ffffffffffffffff808211156103ad57600080fd5b818601915086601f8301126103c157600080fd5b8135818111156103d3576103d3610552565b604051601f8201601f19908116603f011681019083821181831017156103fb576103fb610552565b8160405282815289602084870101111561041457600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000815180845260005b8181101561045c57602081850181015186830182015201610440565b8181111561046e576000602083870101525b50601f01601f19169290920160200192915050565b60208152600061033a6020830184610436565b8281526040602082015260006104af6040830184610436565b949350505050565b600082198211156104ca576104ca61053c565b500190565b6000828210156104e1576104e161053c565b500390565b600181811c908216806104fa57607f821691505b6020821081141561051b57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156105355761053561053c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212205393945b341e6ee5bb89c350656b19b8439867683ac45c09491327bbfba1d64864736f6c63430008060033","to":"0x8722eb776a5d9a2ffd914648381fe2daf80c7add","type":"CREATE","value":"0x0"}}


$ curl http://localhost:10195/   -X POST -H "Content-Type: application/json" --data '{"method":"debug_traceTransaction","params":["0xcb49df24a751049963245c259edbf8e4a75d60a487adb0c73266c9d561c53983", {"tracer": "4byteTracer"}], "id":1,"jsonrpc":"2.0"}'
{"id":1,"jsonrpc":"2.0","result":{"0x60806040-2303":1}}


$ curl http://localhost:10195/   -X POST -H "Content-Type: application/json" --data '{"method":"debug_traceTransaction","params":["0xcb49df24a751049963245c259edbf8e4a75d60a487adb0c73266c9d561c53983", {"tracer": "prestateTracer"}], "id":1,"jsonrpc":"2.0"}'
{"id":1,"jsonrpc":"2.0","result":{"0x0000000000000000000000000000000000000000":{"balance":"0x0"},"0x71cbe3fede33905d4d1bf2bd51f9d4a62375e659":{"balance":"0x52b7d2aefc1589c37f48c0","nonce":98},"0x8722eb776a5d9a2ffd914648381fe2daf80c7add":{"balance":"0x0","nonce":1,"storage":{"0x0000000000000000000000000000000000000000000000000000000000000000":"0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001":"0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000002":"0x0000000000000000000000000000000000000000000000000000000000000000","0xb0a2a423825de4815fce71e64575dc06ce5927dbd062faedaa2ebd6b264ea8a8":"0x0000000000000000000000000000000000000000000000000000000000000000"}}}}


 curl http://localhost:10195/   -X POST -H "Content-Type: application/json" --data '{"method":"debug_traceTransaction","params":["0xcb49df24a751049963245c259edbf8e4a75d60a487adb0c73266c9d561c53983", {"tracer": "noopTracer"}], "id":1,"jsonrpc":"2.0"}'
{"id":1,"jsonrpc":"2.0","result":{}}

@PolinaKiporenko
Copy link
Contributor

3.18.1-beta.0

@PolinaKiporenko PolinaKiporenko moved this from Ready For Release Candidate to Merged To Release Candidate in SKALE Engineering 🚀 May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working epic:archive-node
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants