Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Different output in traces (hex vs decimals) between beta and master #2622

Closed
tomusdrw opened this issue Oct 14, 2016 · 5 comments
Closed

Different output in traces (hex vs decimals) between beta and master #2622

tomusdrw opened this issue Oct 14, 2016 · 5 comments
Labels
M4-core ⛓ Core client code / Rust. Z1-question 🙋‍♀️ Issue is a question. Closer should answer.

Comments

@tomusdrw
Copy link
Collaborator

$ curl -H "Content-Type: application/json" -sX POST --data '{"jsonrpc":"2.0","method":"trace_transaction","params":["0xea1093d492a1dcb1bef708f771a99a96ff05dcab81ca76c31940300177fcf49f"],"id":74}' localhost:8545
{
"jsonrpc":"2.0",
"result":[{"action":{
"callType":"call","from":"0x39fa8c5f2793459d6622857e7d9fbb4bd91766d3","gas":"0x1a6d4","input":"0x","to":"0xc083e9947cf02b8ffc7d3090ae9aea72df98fd47","value":"0x56bc75e2d63100000"},"blockHash":"0x8e38b4dbf6b11fcc3b9dee84fb7986e29ca0a02cecd8977c161ff7333329681e","blockNumber":1000000,"result":{"gasUsed":"0x2034","output":"0x0000000000000000000000000000000000000000000000000000000000000000"},
"subtraces":1,"traceAddress":[],"transactionHash":"0xea1093d492a1dcb1bef708f771a99a96ff05dcab81ca76c31940300177fcf49f","transactionPosition":0,"type":"call"},{"action":{"callType":"callcode","from":"0xc083e9947cf02b8ffc7d3090ae9aea72df98fd47","gas":"0x18c56","input":"0x","to":"0xc083e9947cf02b8ffc7d3090ae9aea72df98fd47","value":"0x56bc75e2d63100000"},"blockHash":"0x8e38b4dbf6b11fcc3b9dee84fb7986e29ca0a02cecd8977c161ff7333329681e","blockNumber":1000000,"result":{"gasUsed":"0x5a4","output":"0x"},"subtraces":0,"traceAddress":[0],"transactionHash":"0xea1093d492a1dcb1bef708f771a99a96ff05dcab81ca76c31940300177fcf49f","transactionPosition":0,"type":"call"}],
"id":74
}

while for 1.3.7 client

$ curl -H "Content-Type: application/json" -sX POST --data '{"jsonrpc":"2.0","method":"trace_transaction","params":["0xea1093d492a1dcb1bef708f771a99a96ff05dcab81ca76c31940300177fcf49f"],"id":74}' localhost:8545
{
"jsonrpc":"2.0",
"result":[{"action":{
"call":{"callType":{"call":[]},"from":"0x39fa8c5f2793459d6622857e7d9fbb4bd91766d3","gas":"0x01a6d4","input":"0x","to":"0xc083e9947cf02b8ffc7d3090ae9aea72df98fd47","value":"0x056bc75e2d63100000"}},"blockHash":"0x8e38b4dbf6b11fcc3b9dee84fb7986e29ca0a02cecd8977c161ff7333329681e","blockNumber":"0x0f4240","result":{"call":{"gasUsed":"0x2034","output":"0x0000000000000000000000000000000000000000000000000000000000000000"}},
"subtraces":"0x01","traceAddress":[],"transactionHash":"0xea1093d492a1dcb1bef708f771a99a96ff05dcab81ca76c31940300177fcf49f","transactionPosition":"0x00"},{"action":{"call":{"callType":{"callcode":[]},"from":"0xc083e9947cf02b8ffc7d3090ae9aea72df98fd47","gas":"0x018c56","input":"0x","to":"0xc083e9947cf02b8ffc7d3090ae9aea72df98fd47","value":"0x056bc75e2d63100000"}},"blockHash":"0x8e38b4dbf6b11fcc3b9dee84fb7986e29ca0a02cecd8977c161ff7333329681e","blockNumber":"0x0f4240","result":{"call":{"gasUsed":"0x05a4","output":"0x"}},"subtraces":"0x00","traceAddress":["0x00"],"transactionHash":"0xea1093d492a1dcb1bef708f771a99a96ff05dcab81ca76c31940300177fcf49f","transactionPosition":"0x00"}],
"id":74
}

Question originally posted on Gitter by @shihao-guo
Which format is going to stick?
Was the change intentional?

@tomusdrw tomusdrw added Z1-question 🙋‍♀️ Issue is a question. Closer should answer. M4-core ⛓ Core client code / Rust. labels Oct 14, 2016
@tomusdrw
Copy link
Collaborator Author

AFAICT the change in trace format was intentional and it will stay like this. Not sure about hex vs decimals though - @debris could you confirm?

@debris
Copy link
Collaborator

debris commented Oct 14, 2016

The change was introduced here by @gavofyork . I believe it was intentional and we will stick with it

@mtbitcoin
Copy link

mtbitcoin commented Oct 14, 2016

Actually I remember bringing this up in the Gitter chat with @gavofyork in 1.4 when they were displayed as decimals instead of hex. And it was then reverted back to hex in the following push. This was related to an issue of the ordering the trace number which he was fixing

@shihao-guo
Copy link

If parity were to adopt the format and number representation from master in a new lease, which one may it be?

@gavofyork
Copy link
Contributor

it will be fixed going forward as decimals.

the convention is decimals if the number is indexing into a data structure, hex otherwise.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
M4-core ⛓ Core client code / Rust. Z1-question 🙋‍♀️ Issue is a question. Closer should answer.
Projects
None yet
Development

No branches or pull requests

5 participants