{"action":"created","issue":{"url":"https://api.github.com/repos/coinbase/toshi/issues/207","labels_url":"https://api.github.com/repos/coinbase/toshi/issues/207/labels{/name}","comments_url":"https://api.github.com/repos/coinbase/toshi/issues/207/comments","events_url":"https://api.github.com/repos/coinbase/toshi/issues/207/events","html_url":"https://github.com/coinbase/toshi/issues/207","id":99274758,"number":207,"title":"Multiple (different) blocks at the same height.","user":{"login":"dan-da","id":5110592,"avatar_url":"https://avatars.githubusercontent.com/u/5110592?v=3","gravatar_id":"","url":"https://api.github.com/users/dan-da","html_url":"https://github.com/dan-da","followers_url":"https://api.github.com/users/dan-da/followers","following_url":"https://api.github.com/users/dan-da/following{/other_user}","gists_url":"https://api.github.com/users/dan-da/gists{/gist_id}","starred_url":"https://api.github.com/users/dan-da/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dan-da/subscriptions","organizations_url":"https://api.github.com/users/dan-da/orgs","repos_url":"https://api.github.com/users/dan-da/repos","events_url":"https://api.github.com/users/dan-da/events{/privacy}","received_events_url":"https://api.github.com/users/dan-da/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-05T19:01:02Z","updated_at":"2015-08-05T20:38:41Z","closed_at":null,"body":"I'm not sure how serious this is. (seems bad)   I am seeing multiple blocks with the same height but different values.\r\n\r\nI'm seeing this on both testnet and mainnet.  values below are from testnet, and the system has been started stopped many times during the initial sync.  So it may be related to that.\r\n\r\n<pre>\r\ntoshi_development=# select height, count(*) from blocks group by height having count(*) > 1;          \r\n height | count \r\n--------+-------\r\n      0 |    16\r\n      1 |    11\r\n      2 |     8\r\n      3 |     8\r\n      4 |     8\r\n      5 |     6\r\n      6 |     6\r\n      7 |     5\r\n      8 |     5\r\n      9 |     5\r\n     10 |     5\r\n     11 |     5\r\n     12 |     3\r\n     13 |     3\r\n     14 |     3\r\n     15 |     2\r\n     16 |     2\r\n     17 |     2\r\n     18 |     2\r\n     19 |     2\r\n     20 |     2\r\n     21 |     2\r\n     22 |     2\r\n     23 |     2\r\n     24 |     2\r\n     25 |     2\r\n     26 |     2\r\n     27 |     2\r\n     28 |     2\r\n     29 |     2\r\n     30 |     2\r\n     31 |     2\r\n     32 |     2\r\n     33 |     2\r\n(34 rows)\r\n</pre>\r\n\r\nSo let's look at the blocks stored for one of these heights.  Notice they are different values.\r\n\r\n<pre>\r\ntoshi_development=# select * from blocks where height = 33;\r\n-[ RECORD 1 ]------+-----------------------------------------------------------------\r\nid                 | 8724\r\nhsh                | 00000000000312846cd887f35a945e637fc67cdae7aae8cb261289899f8f2a3f\r\nheight             | 33\r\nprev_block         | 0000000000028136225c01f8002f6ba53c6a201e478230873e72b4c57309308f\r\nmrkl_root          | bab7664fb59aadeed6ddbec118526450e9775c0fd9052aaa4344a08b8e999559\r\ntime               | 1438670203\r\nbits               | 453193372\r\nnonce              | 3240797680\r\nver                | 3\r\nbranch             | 2\r\nsize               | 1435\r\nwork               | \\x50736991318a\r\nfees               | 0\r\ntotal_in_value     | 0\r\ntotal_out_value    | 0\r\ntransactions_count | 6\r\ncreated_at         | 2015-08-04 04:50:42.226754\r\n-----   D 2 ]------+--------------------------------------------------------------More--\r\nid                 | 34\r\nhsh                | 00000000663742a962be4db62757e0464a83583c0f5abd74832ba35a3e5571f5\r\nheight             | 33\r\nprev_block         | 00000000a8c3af05dadff24b9798dd317191645f45bb46c99d4bedd84705604c\r\nmrkl_root          | 1c6991d08e16b64f1e0401c48a34b7b096e3a99b7b77b047182111a6c41ab0e5\r\ntime               | 1296691918\r\nbits               | 486604799\r\nnonce              | 3076553219\r\nver                | 1\r\nbranch             | 0\r\nsize               | 190\r\nwork               | \\x2200220022\r\nfees               | 0\r\ntotal_in_value     | 0\r\ntotal_out_value    | 5000000000\r\ntransactions_count | 1\r\ncreated_at         | 2015-08-04 02:13:46.995818\r\n</pre>\r\n"},"comment":{"url":"https://api.github.com/repos/coinbase/toshi/issues/comments/128141290","html_url":"https://github.com/coinbase/toshi/issues/207#issuecomment-128141290","issue_url":"https://api.github.com/repos/coinbase/toshi/issues/207","id":128141290,"user":{"login":"aalness","id":4391003,"avatar_url":"https://avatars.githubusercontent.com/u/4391003?v=3","gravatar_id":"","url":"https://api.github.com/users/aalness","html_url":"https://github.com/aalness","followers_url":"https://api.github.com/users/aalness/followers","following_url":"https://api.github.com/users/aalness/following{/other_user}","gists_url":"https://api.github.com/users/aalness/gists{/gist_id}","starred_url":"https://api.github.com/users/aalness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalness/subscriptions","organizations_url":"https://api.github.com/users/aalness/orgs","repos_url":"https://api.github.com/users/aalness/repos","events_url":"https://api.github.com/users/aalness/events{/privacy}","received_events_url":"https://api.github.com/users/aalness/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T20:38:40Z","updated_at":"2015-08-05T20:38:40Z","body":"It's still getting current blocks from the network as they are announced while it syncs. Those will be orphans until you eventually sync the parent blocks. The heights there will be relative to the first orphan and aren't super useful. They'll be updated when they get connected to the main branch."}}