{"action":"created","issue":{"url":"https://api.github.com/repos/paritytech/parity-ethereum/issues/9887","repository_url":"https://api.github.com/repos/paritytech/parity-ethereum","labels_url":"https://api.github.com/repos/paritytech/parity-ethereum/issues/9887/labels{/name}","comments_url":"https://api.github.com/repos/paritytech/parity-ethereum/issues/9887/comments","events_url":"https://api.github.com/repos/paritytech/parity-ethereum/issues/9887/events","html_url":"https://github.com/paritytech/parity-ethereum/issues/9887","id":379125310,"node_id":"MDU6SXNzdWUzNzkxMjUzMTA=","number":9887,"title":"Getting revert reason from transaction trace","user":{"login":"uluhonolulu","id":872764,"node_id":"MDQ6VXNlcjg3Mjc2NA==","avatar_url":"https://avatars0.githubusercontent.com/u/872764?v=4","gravatar_id":"","url":"https://api.github.com/users/uluhonolulu","html_url":"https://github.com/uluhonolulu","followers_url":"https://api.github.com/users/uluhonolulu/followers","following_url":"https://api.github.com/users/uluhonolulu/following{/other_user}","gists_url":"https://api.github.com/users/uluhonolulu/gists{/gist_id}","starred_url":"https://api.github.com/users/uluhonolulu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uluhonolulu/subscriptions","organizations_url":"https://api.github.com/users/uluhonolulu/orgs","repos_url":"https://api.github.com/users/uluhonolulu/repos","events_url":"https://api.github.com/users/uluhonolulu/events{/privacy}","received_events_url":"https://api.github.com/users/uluhonolulu/received_events","type":"User","site_admin":false},"labels":[{"id":290482954,"node_id":"MDU6TGFiZWwyOTA0ODI5NTQ=","url":"https://api.github.com/repos/paritytech/parity-ethereum/labels/Z1-question%20%F0%9F%99%8B%E2%80%8D%E2%99%80%EF%B8%8F","name":"Z1-question 🙋‍♀️","color":"fff5fb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-09T11:27:35Z","updated_at":"2018-11-09T13:33:46Z","closed_at":null,"author_association":"NONE","body":"\r\n* Parity Ethereum version: v1.11.4-beta-f26a7fe6f-20180612/x86_64-windows-msvc/rustc1.26.1\r\n* Operating system: Windows\r\n* Installation: one-line installer\r\n* Fully synchronized: yes\r\n* Network: private\r\n* Restarted: yes\r\n\r\nWhen I execute `trace_replayTransaction` for a failed transaction, I get, among others, the `output` field that looks like this: `0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000384e6f7420656e6f756768206d6f6e6579206f6e2062616c616e636520746f2077697468647261772073706563696669656420616d6f756e740000000000000000`.\r\n\r\nIf I take the chars starting with `38...` (after a long row of zeroes) and convert it to ASCII, I get the revert reason which matches the revert instruction in my smart code. I've been doing it manually, but I would like to automate it. Is there a spec for this field? \r\n\r\nNote that I can't just take everything after \"many zeroes\", because the first two characters (\"38\", which becomes \"8\" after conversion) are not a part of the revert reason. The string that I need starts at position 137.\r\n\r\nMy question is: how do I get the revert reason from the output field?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/paritytech/parity-ethereum/issues/comments/437360593","html_url":"https://github.com/paritytech/parity-ethereum/issues/9887#issuecomment-437360593","issue_url":"https://api.github.com/repos/paritytech/parity-ethereum/issues/9887","id":437360593,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzM2MDU5Mw==","user":{"login":"uluhonolulu","id":872764,"node_id":"MDQ6VXNlcjg3Mjc2NA==","avatar_url":"https://avatars0.githubusercontent.com/u/872764?v=4","gravatar_id":"","url":"https://api.github.com/users/uluhonolulu","html_url":"https://github.com/uluhonolulu","followers_url":"https://api.github.com/users/uluhonolulu/followers","following_url":"https://api.github.com/users/uluhonolulu/following{/other_user}","gists_url":"https://api.github.com/users/uluhonolulu/gists{/gist_id}","starred_url":"https://api.github.com/users/uluhonolulu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uluhonolulu/subscriptions","organizations_url":"https://api.github.com/users/uluhonolulu/orgs","repos_url":"https://api.github.com/users/uluhonolulu/repos","events_url":"https://api.github.com/users/uluhonolulu/events{/privacy}","received_events_url":"https://api.github.com/users/uluhonolulu/received_events","type":"User","site_admin":false},"created_at":"2018-11-09T13:33:46Z","updated_at":"2018-11-09T13:33:46Z","author_association":"NONE","body":"@joshua-mir would be cool but doesn't work here.\r\n> For a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.\r\nThe first byte is `0x08` in my case, so it should be, theoretically, the only byte in the encoded value. Indeed, a deoding tool throws an exception.\r\n\r\nWhat I have noticed so far is that 1) I always have `0x08c379a0` at the beginning; 2) the string that I need always starts at position 137.\r\n\r\nCould you tell me where to look in the source for the code that produces this output?"}}
{"actor":{"display_login":"uluhonolulu"}}