{"action":"closed","issue":{"url":"https://api.github.com/repos/libbitcoin/libbitcoin-blockchain/issues/118","labels_url":"https://api.github.com/repos/libbitcoin/libbitcoin-blockchain/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/libbitcoin/libbitcoin-blockchain/issues/118/comments","events_url":"https://api.github.com/repos/libbitcoin/libbitcoin-blockchain/issues/118/events","html_url":"https://github.com/libbitcoin/libbitcoin-blockchain/issues/118","id":110749959,"number":118,"title":"Block validation failures on intra-block dependency in testnet sync.","user":{"login":"evoskuil","id":1369335,"avatar_url":"https://avatars.githubusercontent.com/u/1369335?v=3","gravatar_id":"","url":"https://api.github.com/users/evoskuil","html_url":"https://github.com/evoskuil","followers_url":"https://api.github.com/users/evoskuil/followers","following_url":"https://api.github.com/users/evoskuil/following{/other_user}","gists_url":"https://api.github.com/users/evoskuil/gists{/gist_id}","starred_url":"https://api.github.com/users/evoskuil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evoskuil/subscriptions","organizations_url":"https://api.github.com/users/evoskuil/orgs","repos_url":"https://api.github.com/users/evoskuil/repos","events_url":"https://api.github.com/users/evoskuil/events{/privacy}","received_events_url":"https://api.github.com/users/evoskuil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/libbitcoin/libbitcoin-blockchain/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"evoskuil","id":1369335,"avatar_url":"https://avatars.githubusercontent.com/u/1369335?v=3","gravatar_id":"","url":"https://api.github.com/users/evoskuil","html_url":"https://github.com/evoskuil","followers_url":"https://api.github.com/users/evoskuil/followers","following_url":"https://api.github.com/users/evoskuil/following{/other_user}","gists_url":"https://api.github.com/users/evoskuil/gists{/gist_id}","starred_url":"https://api.github.com/users/evoskuil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evoskuil/subscriptions","organizations_url":"https://api.github.com/users/evoskuil/orgs","repos_url":"https://api.github.com/users/evoskuil/repos","events_url":"https://api.github.com/users/evoskuil/events{/privacy}","received_events_url":"https://api.github.com/users/evoskuil/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/libbitcoin/libbitcoin-blockchain/milestones/1","html_url":"https://github.com/libbitcoin/libbitcoin-blockchain/milestones/3.0","labels_url":"https://api.github.com/repos/libbitcoin/libbitcoin-blockchain/milestones/1/labels","id":1307369,"number":1,"title":"3.0","description":"","creator":{"login":"evoskuil","id":1369335,"avatar_url":"https://avatars.githubusercontent.com/u/1369335?v=3","gravatar_id":"","url":"https://api.github.com/users/evoskuil","html_url":"https://github.com/evoskuil","followers_url":"https://api.github.com/users/evoskuil/followers","following_url":"https://api.github.com/users/evoskuil/following{/other_user}","gists_url":"https://api.github.com/users/evoskuil/gists{/gist_id}","starred_url":"https://api.github.com/users/evoskuil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evoskuil/subscriptions","organizations_url":"https://api.github.com/users/evoskuil/orgs","repos_url":"https://api.github.com/users/evoskuil/repos","events_url":"https://api.github.com/users/evoskuil/events{/privacy}","received_events_url":"https://api.github.com/users/evoskuil/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":2,"state":"open","created_at":"2015-09-15T22:13:30Z","updated_at":"2015-10-17T08:27:28Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-10-09T23:03:37Z","updated_at":"2015-10-17T08:27:28Z","closed_at":"2015-10-17T08:27:28Z","body":"```\r\n17:13:34.805351 WARNING [validate] Failure fetching input transaction.\r\n17:13:34.805931 WARNING [validate] Invalid input [227ee87b49a652a23ae5c30de32d4dcedebdf442e7faced2789be7f7702667a9:189]\r\n17:13:34.806059 WARNING [validate] Invalid block [0000000000cecfb76203a34e6d55eac4994ddfaad9d513f80efd216df888b4fd] validation of inputs failed\r\n17:13:34.806179 ERROR [poller] Error storing block [0000000000cecfb76203a34e6d55eac4994ddfaad9d513f80efd216df888b4fd] validation of inputs failed\r\n```\r\nSee: [tx](https://testnet.blockexplorer.com/tx/227ee87b49a652a23ae5c30de32d4dcedebdf442e7faced2789be7f7702667a9) and [block](https://testnet.blockexplorer.com/block/0000000000cecfb76203a34e6d55eac4994ddfaad9d513f80efd216df888b4fd)\r\n```\r\n17:13:08.067268 WARNING [validate] Failure fetching input transaction.\r\n17:13:08.067858 WARNING [validate] Invalid input [3abacf2d0693eb7133b664e7e51f41dd0c5ec95cb6c481052bfd7585a76668b7:76]\r\n17:13:08.067931 WARNING [validate] Invalid block [0000000025c5182db4ca42ab7a7d22f965ff42974215177ebb6b2d6dceac3de3] validation of inputs failed\r\n17:13:08.067984 ERROR [poller] Error storing block [0000000025c5182db4ca42ab7a7d22f965ff42974215177ebb6b2d6dceac3de3] validation of inputs failed\r\n```\r\nSee: [tx](https://testnet.blockexplorer.com/tx/3abacf2d0693eb7133b664e7e51f41dd0c5ec95cb6c481052bfd7585a76668b7) and [block](https://testnet.blockexplorer.com/block/0000000025c5182db4ca42ab7a7d22f965ff42974215177ebb6b2d6dceac3de3)\r\n\r\nFor input validation, tx-based validation (for mempool acceptance) validates first against mempool txs and then against blockchain txs:\r\n\r\nhttps://github.com/libbitcoin/libbitcoin-blockchain/blob/version2/src/validate_transaction.cpp#L204\r\n\r\nBut block validation is limited to blockchain txs, and as one can see in this function, that is the source of the errors above:\r\n\r\nhttps://github.com/libbitcoin/libbitcoin-blockchain/blob/version2/src/validate_block.cpp#L482\r\n\r\nThe implementation must consider a block's own transaction set as well as previously-accepted blocks. "}}