{"action":"created","issue":{"url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/3685","repository_url":"https://api.github.com/repos/input-output-hk/cardano-sl","labels_url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/3685/labels{/name}","comments_url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/3685/comments","events_url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/3685/events","html_url":"https://github.com/input-output-hk/cardano-sl/pull/3685","id":365016965,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5MDY3NDEw","number":3685,"title":"[CO-354] Fix SafeCopy instance for `AddrAttributes`","user":{"login":"mhuesch","id":1151946,"node_id":"MDQ6VXNlcjExNTE5NDY=","avatar_url":"https://avatars1.githubusercontent.com/u/1151946?v=4","gravatar_id":"","url":"https://api.github.com/users/mhuesch","html_url":"https://github.com/mhuesch","followers_url":"https://api.github.com/users/mhuesch/followers","following_url":"https://api.github.com/users/mhuesch/following{/other_user}","gists_url":"https://api.github.com/users/mhuesch/gists{/gist_id}","starred_url":"https://api.github.com/users/mhuesch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhuesch/subscriptions","organizations_url":"https://api.github.com/users/mhuesch/orgs","repos_url":"https://api.github.com/users/mhuesch/repos","events_url":"https://api.github.com/users/mhuesch/events{/privacy}","received_events_url":"https://api.github.com/users/mhuesch/received_events","type":"User","site_admin":false},"labels":[{"id":997487461,"node_id":"MDU6TGFiZWw5OTc0ODc0NjE=","url":"https://api.github.com/repos/input-output-hk/cardano-sl/labels/release-1.3.1","name":"release-1.3.1","color":"e8765a","default":false}],"state":"open","locked":false,"assignee":{"login":"mhuesch","id":1151946,"node_id":"MDQ6VXNlcjExNTE5NDY=","avatar_url":"https://avatars1.githubusercontent.com/u/1151946?v=4","gravatar_id":"","url":"https://api.github.com/users/mhuesch","html_url":"https://github.com/mhuesch","followers_url":"https://api.github.com/users/mhuesch/followers","following_url":"https://api.github.com/users/mhuesch/following{/other_user}","gists_url":"https://api.github.com/users/mhuesch/gists{/gist_id}","starred_url":"https://api.github.com/users/mhuesch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhuesch/subscriptions","organizations_url":"https://api.github.com/users/mhuesch/orgs","repos_url":"https://api.github.com/users/mhuesch/repos","events_url":"https://api.github.com/users/mhuesch/events{/privacy}","received_events_url":"https://api.github.com/users/mhuesch/received_events","type":"User","site_admin":false},"assignees":[{"login":"mhuesch","id":1151946,"node_id":"MDQ6VXNlcjExNTE5NDY=","avatar_url":"https://avatars1.githubusercontent.com/u/1151946?v=4","gravatar_id":"","url":"https://api.github.com/users/mhuesch","html_url":"https://github.com/mhuesch","followers_url":"https://api.github.com/users/mhuesch/followers","following_url":"https://api.github.com/users/mhuesch/following{/other_user}","gists_url":"https://api.github.com/users/mhuesch/gists{/gist_id}","starred_url":"https://api.github.com/users/mhuesch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhuesch/subscriptions","organizations_url":"https://api.github.com/users/mhuesch/orgs","repos_url":"https://api.github.com/users/mhuesch/repos","events_url":"https://api.github.com/users/mhuesch/events{/privacy}","received_events_url":"https://api.github.com/users/mhuesch/received_events","type":"User","site_admin":false},{"login":"intricate","id":19835357,"node_id":"MDQ6VXNlcjE5ODM1MzU3","avatar_url":"https://avatars1.githubusercontent.com/u/19835357?v=4","gravatar_id":"","url":"https://api.github.com/users/intricate","html_url":"https://github.com/intricate","followers_url":"https://api.github.com/users/intricate/followers","following_url":"https://api.github.com/users/intricate/following{/other_user}","gists_url":"https://api.github.com/users/intricate/gists{/gist_id}","starred_url":"https://api.github.com/users/intricate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/intricate/subscriptions","organizations_url":"https://api.github.com/users/intricate/orgs","repos_url":"https://api.github.com/users/intricate/repos","events_url":"https://api.github.com/users/intricate/events{/privacy}","received_events_url":"https://api.github.com/users/intricate/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2018-09-28T19:43:39Z","updated_at":"2018-10-02T15:04:00Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/input-output-hk/cardano-sl/pulls/3685","html_url":"https://github.com/input-output-hk/cardano-sl/pull/3685","diff_url":"https://github.com/input-output-hk/cardano-sl/pull/3685.diff","patch_url":"https://github.com/input-output-hk/cardano-sl/pull/3685.patch"},"body":"## Description\r\n    \r\n    Until now, the instance was derived, and thus was broken when we\r\n    modified `AddrAttributes` in earlier release/1.3.1 commits by adding\r\n    the `aaNetworkMagic` field.\r\n    \r\n    In order to make future modifications to the instance easier in the\r\n    future, we simply de/serialize a ByteString from the `Bi` instance\r\n    for `Attributes AddrAttributes`.\r\n    \r\n    Since there is a very low probability of collisions between the old\r\n    SafeCopy binary format and the new CBOR/Bi binary format, we attempt\r\n    to decode via `Bi` first, and if that fails (either an invalid length\r\n    ByteString, or a CBOR failure), then we do a \"legacy\" decode, where\r\n    we only look for 2 fields (`AddrAttributes` had 2 before we added\r\n    `aaNetworkMagic`) and fill in `NMNothing` so that the existing\r\n    mainnet/staging databases are correctly read.\r\n\r\n## Linked issue\r\n\r\nhttps://iohk.myjetbrains.com/youtrack/issue/CO-354\r\n\r\n## Type of change\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply and `~` in the ones that do not: -->\r\n- [x] 🐞 Bug fix (non-breaking change which fixes an issue)\r\n- [~] 🛠 New feature (non-breaking change which adds functionality)\r\n- [~] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)\r\n- [~] 🏭 Refactoring that does not change existing functionality but does improve things like code readability, structure etc\r\n- [x] 🔨 New or improved tests for existing code\r\n- [~] ⛑ git-flow chore (backport, hotfix, etc)\r\n\r\n## Developer checklist\r\n- [x] I have read the [style guide](https://github.com/input-output-hk/cardano-sl/blob/develop/docs/style-guide.md) document, and my code follows the code style of this project.\r\n- [x] If my code deals with exceptions, it follows the [guidelines](https://github.com/input-output-hk/cardano-sl/blob/develop/docs/exceptions.md).\r\n- [x] I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on [cardanodocs.com](https://github.com/input-output-hk/cardanodocs.com), amending the inline [Haddock](https://www.haskell.org/haddock/) comments, any relevant README file or one of the document listed in the [docs](https://github.com/input-output-hk/cardano-sl/tree/develop/docs) directory.\r\n- [~] CHANGELOG entry has been added and is linked to the correct PR on GitHub.\r\n\r\n## Testing checklist\r\n- [x] I have added tests to cover my changes.\r\n- [x] All new and existing tests passed.\r\n\r\n## QA Steps\r\n```\r\n$ stack test\r\n$ EXISTING_WALLET_PATH=<path>\r\n$ stack exec cardano-node -- --topology=docs/network/example-topologies/mainnet-staging.yaml --configuration-key mainnet_dryrun_full  --db-path ../staging-db --tlscert ../tls-certs/server.crt --tlskey ../tls-certs/server.key --tlsca ../tls-certs/ca.crt --no-client-auth --wallet-db-path $EXISTING_WALLET_PATH\r\n```"},"comment":{"url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/comments/426308738","html_url":"https://github.com/input-output-hk/cardano-sl/pull/3685#issuecomment-426308738","issue_url":"https://api.github.com/repos/input-output-hk/cardano-sl/issues/3685","id":426308738,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjMwODczOA==","user":{"login":"mhuesch","id":1151946,"node_id":"MDQ6VXNlcjExNTE5NDY=","avatar_url":"https://avatars1.githubusercontent.com/u/1151946?v=4","gravatar_id":"","url":"https://api.github.com/users/mhuesch","html_url":"https://github.com/mhuesch","followers_url":"https://api.github.com/users/mhuesch/followers","following_url":"https://api.github.com/users/mhuesch/following{/other_user}","gists_url":"https://api.github.com/users/mhuesch/gists{/gist_id}","starred_url":"https://api.github.com/users/mhuesch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhuesch/subscriptions","organizations_url":"https://api.github.com/users/mhuesch/orgs","repos_url":"https://api.github.com/users/mhuesch/repos","events_url":"https://api.github.com/users/mhuesch/events{/privacy}","received_events_url":"https://api.github.com/users/mhuesch/received_events","type":"User","site_admin":false},"created_at":"2018-10-02T15:04:00Z","updated_at":"2018-10-02T15:04:00Z","author_association":"CONTRIBUTOR","body":"@dcoutts I'm still mystified by `lookAheadE`'s behavior, as it is described to do (I think) what we want it to do, yet it behaves differently.\r\n\r\nI figured out how to use `Alternative` to run the non-legacy parser first, and if that fails, to then run the legacy parser. This seems fairly clean & safe. Just updated the PR."}}
{"actor":{"display_login":"mhuesch"}}