{"action":"created","issue":{"url":"https://api.github.com/repos/poanetwork/blockscout/issues/1094","repository_url":"https://api.github.com/repos/poanetwork/blockscout","labels_url":"https://api.github.com/repos/poanetwork/blockscout/issues/1094/labels{/name}","comments_url":"https://api.github.com/repos/poanetwork/blockscout/issues/1094/comments","events_url":"https://api.github.com/repos/poanetwork/blockscout/issues/1094/events","html_url":"https://github.com/poanetwork/blockscout/pull/1094","id":380291337,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwNTI1NjE1","number":1094,"title":"Extract input from Parity call traces","user":{"login":"KronicDeth","id":298259,"node_id":"MDQ6VXNlcjI5ODI1OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/298259?v=4","gravatar_id":"","url":"https://api.github.com/users/KronicDeth","html_url":"https://github.com/KronicDeth","followers_url":"https://api.github.com/users/KronicDeth/followers","following_url":"https://api.github.com/users/KronicDeth/following{/other_user}","gists_url":"https://api.github.com/users/KronicDeth/gists{/gist_id}","starred_url":"https://api.github.com/users/KronicDeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KronicDeth/subscriptions","organizations_url":"https://api.github.com/users/KronicDeth/orgs","repos_url":"https://api.github.com/users/KronicDeth/repos","events_url":"https://api.github.com/users/KronicDeth/events{/privacy}","received_events_url":"https://api.github.com/users/KronicDeth/received_events","type":"User","site_admin":false},"labels":[{"id":803248120,"node_id":"MDU6TGFiZWw4MDMyNDgxMjA=","url":"https://api.github.com/repos/poanetwork/blockscout/labels/bug%20:bug:","name":"bug :bug:","color":"ee0701","default":false}],"state":"closed","locked":false,"assignee":{"login":"KronicDeth","id":298259,"node_id":"MDQ6VXNlcjI5ODI1OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/298259?v=4","gravatar_id":"","url":"https://api.github.com/users/KronicDeth","html_url":"https://github.com/KronicDeth","followers_url":"https://api.github.com/users/KronicDeth/followers","following_url":"https://api.github.com/users/KronicDeth/following{/other_user}","gists_url":"https://api.github.com/users/KronicDeth/gists{/gist_id}","starred_url":"https://api.github.com/users/KronicDeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KronicDeth/subscriptions","organizations_url":"https://api.github.com/users/KronicDeth/orgs","repos_url":"https://api.github.com/users/KronicDeth/repos","events_url":"https://api.github.com/users/KronicDeth/events{/privacy}","received_events_url":"https://api.github.com/users/KronicDeth/received_events","type":"User","site_admin":false},"assignees":[{"login":"KronicDeth","id":298259,"node_id":"MDQ6VXNlcjI5ODI1OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/298259?v=4","gravatar_id":"","url":"https://api.github.com/users/KronicDeth","html_url":"https://github.com/KronicDeth","followers_url":"https://api.github.com/users/KronicDeth/followers","following_url":"https://api.github.com/users/KronicDeth/following{/other_user}","gists_url":"https://api.github.com/users/KronicDeth/gists{/gist_id}","starred_url":"https://api.github.com/users/KronicDeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KronicDeth/subscriptions","organizations_url":"https://api.github.com/users/KronicDeth/orgs","repos_url":"https://api.github.com/users/KronicDeth/repos","events_url":"https://api.github.com/users/KronicDeth/events{/privacy}","received_events_url":"https://api.github.com/users/KronicDeth/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-11-13T15:46:22Z","updated_at":"2018-11-16T14:19:28Z","closed_at":"2018-11-13T21:29:07Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/poanetwork/blockscout/pulls/1094","html_url":"https://github.com/poanetwork/blockscout/pull/1094","diff_url":"https://github.com/poanetwork/blockscout/pull/1094.diff","patch_url":"https://github.com/poanetwork/blockscout/pull/1094.patch"},"body":"Fixes #1069\r\n\r\n## Changelog\r\n\r\n### Bug Fixes\r\n* Parity call traces contain the input, but it was not put in the `internal_transactions_params`.\r\n  * Enforce `input` and `call_type` being non-`NULL` for calls in new constraints on `internal_transactions`.\r\n  * Validate `input` as required for call `InternalTransaction`s.\r\n* Enforce `init` being non-`NULL` for creates in new constraint in `internal_transactions`.\r\n\r\n## Upgrading\r\n\r\n* **If you currently have calls that are missing inputs**, you'll need to remove those internal transactions and mark them to be refetched:\r\n   1.  `cd apps/explorer`\r\n   2. This must be done from `apps/explorer` so that the indexer without the fix does not refetch without the input: `iex -S mix`\r\n   3. `import Ecto.Query`\r\n   4. `alias Explorer.Repo`\r\n   4. `alias Explorer.Chain.{Transaction, InternalTransaction}`\r\n   5.  Mark transactions to refetch their transactions: `Repo.update_all(from(transaction in Transaction, join: internal_transaction in assoc(transaction, :internal_transactions), where: internal_transaction.type == ^:call and is_nil(internal_transaction.input), set: [internal_transactions_indexed_at: nil]))\r\n   5. Delete bad internal transactions: `Repo.delete_all(from(internal_transaction in InternalTransaction, where: internal_transaction.type == ^:call and is_nil(internal_transaction.input)))`\r\n\r\n   If you are unsure this is a problem for your data, run the migration in this PR first.  If an error occurs adding the constraint because some rows violate the constraint, you will need to do the above steps first before migrating."},"comment":{"url":"https://api.github.com/repos/poanetwork/blockscout/issues/comments/439407076","html_url":"https://github.com/poanetwork/blockscout/pull/1094#issuecomment-439407076","issue_url":"https://api.github.com/repos/poanetwork/blockscout/issues/1094","id":439407076,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTQwNzA3Ng==","user":{"login":"KronicDeth","id":298259,"node_id":"MDQ6VXNlcjI5ODI1OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/298259?v=4","gravatar_id":"","url":"https://api.github.com/users/KronicDeth","html_url":"https://github.com/KronicDeth","followers_url":"https://api.github.com/users/KronicDeth/followers","following_url":"https://api.github.com/users/KronicDeth/following{/other_user}","gists_url":"https://api.github.com/users/KronicDeth/gists{/gist_id}","starred_url":"https://api.github.com/users/KronicDeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KronicDeth/subscriptions","organizations_url":"https://api.github.com/users/KronicDeth/orgs","repos_url":"https://api.github.com/users/KronicDeth/repos","events_url":"https://api.github.com/users/KronicDeth/events{/privacy}","received_events_url":"https://api.github.com/users/KronicDeth/received_events","type":"User","site_admin":false},"created_at":"2018-11-16T14:19:28Z","updated_at":"2018-11-16T14:19:28Z","author_association":"CONTRIBUTOR","body":"@APshenkin yeah, we discussed that in Slack."}}
{"actor":{"display_login":"KronicDeth"}}