paritytech / parity-zcash

Rust implementation of Zcash protocol
GNU General Public License v3.0
184 stars 40 forks source link

Disconnect multiple peers during sync #98

Closed wkarshat closed 5 years ago

wkarshat commented 5 years ago

As first mentioned in #95, it appears that valid peers are disconnected, after reporting one of several types of errors. Sequences of disconnect messages 24 hours apart show all the peers in the covered range (1-7 and 4561-4570) erroring out. Moreover, multiple consecutive peers are blamed for causing the very same error, which is a virtual impossibility, like disconnect of 2&3. All other disconnects shown, groups of peers 5-7 and 4561- (except 4562 and 4566) are blamed for the very same error.

2019-04-18 10:17:57 UTC WARN sync Disconnecting from peer#1 due to DoS: Provided wrong block 0000000003f9a4833161d37c1f31ef1a0b71ea8a3e2e9fa721bfcf046e1aab45
2019-04-18 10:18:05 UTC WARN sync Previous header of the first header from peer#2 `headers` message is unknown. First: 0003eb875fc001da4a57de8465f68a2730c24ca086f37c6f14780ac9ee3ea3d5. Previous: 00052461a5006c2e3b74ce48992a08695607912d5604c3eb8da25749b0900444
2019-04-18 10:18:05 UTC WARN sync Disconnecting from peer#2 due to misbehavior: Too many failures.
2019-04-18 10:18:06 UTC WARN sync Previous header of the first header from peer#3 `headers` message is unknown. First: 00000000027e2c0327c34a234ea8998eaf150717d6e72e0c713307df65817d20. Previous: 00000000022f316560ddbfe7c0ac819a5f3a4f476c70bb5e0fd77a6fafb86d6b
2019-04-18 10:18:06 UTC WARN sync Disconnecting from peer#3 due to misbehavior: Too many failures.
2019-04-18 10:18:07 UTC WARN sync Previous header of the first header from peer#4 `headers` message is unknown. First: 00000000027e2c0327c34a234ea8998eaf150717d6e72e0c713307df65817d20. Previous: 00000000022f316560ddbfe7c0ac819a5f3a4f476c70bb5e0fd77a6fafb86d6b
2019-04-18 10:18:07 UTC WARN sync Disconnecting from peer#4 due to misbehavior: Too many failures.
2019-04-18 10:18:36 UTC WARN sync Disconnecting from peer#6 due to misbehavior: Provided after dead-end block 0000000001e75867923b1993eeb5e623547537f02d42bfa39aae968ba96b3255
2019-04-18 10:18:36 UTC WARN sync Disconnecting from peer#5 due to misbehavior: Provided after dead-end block 0000000001e75867923b1993eeb5e623547537f02d42bfa39aae968ba96b3255
2019-04-18 10:18:46 UTC WARN sync Disconnecting from peer#7 due to misbehavior: Provided after dead-end block 0000000001e75867923b1993eeb5e623547537f02d42bfa39aae968ba96b3255
2019-04-19 09:52:57 UTC WARN sync Disconnecting from peer#4561 due to misbehavior: Provided after dead-end block 0000000001e75867923b1993eeb5e623547537f02d42bfa39aae968ba96b3255
2019-04-19 09:53:05 UTC WARN sync Disconnecting from peer#4562 due to misbehavior: Got 'headers' message without known blocks
2019-04-19 09:55:18 UTC WARN sync Disconnecting from peer#4563 due to misbehavior: Provided after dead-end block 0000000001e75867923b1993eeb5e623547537f02d42bfa39aae968ba96b3255
2019-04-19 09:59:35 UTC WARN sync Disconnecting from peer#4564 due to misbehavior: Provided after dead-end block 0000000001e75867923b1993eeb5e623547537f02d42bfa39aae968ba96b3255
2019-04-19 09:59:36 UTC WARN sync Disconnecting from peer#4565 due to misbehavior: Provided after dead-end block 0000000001e75867923b1993eeb5e623547537f02d42bfa39aae968ba96b3255
2019-04-19 10:00:35 UTC WARN sync Disconnecting from peer#4566 due to misbehavior: Got 'headers' message without known blocks
2019-04-19 10:00:46 UTC WARN sync Disconnecting from peer#4567 due to misbehavior: Provided after dead-end block 0000000001e75867923b1993eeb5e623547537f02d42bfa39aae968ba96b3255
2019-04-19 10:00:47 UTC WARN sync Disconnecting from peer#4568 due to misbehavior: Provided after dead-end block 0000000001e75867923b1993eeb5e623547537f02d42bfa39aae968ba96b3255
2019-04-19 10:19:36 UTC WARN sync Disconnecting from peer#4569 due to misbehavior: Provided after dead-end block 0000000001e75867923b1993eeb5e623547537f02d42bfa39aae968ba96b3255
2019-04-19 10:26:45 UTC WARN sync Disconnecting from peer#4570 due to misbehavior: Provided after dead-end block 0000000001e75867923b1993eeb5e623547537f02d42bfa39aae968ba96b3255
svyatonik commented 5 years ago

Thanks for reporting! This issue isn't actually about disconnecting peers. The question is why we have failed verification of block 0000000001e75867923b1993eeb5e623547537f02d42bfa39aae968ba96b3255. Do you have full logs for this sync?

wkarshat commented 5 years ago

Couple of days worth of logs, starting with a fresh sync: RUST_LOG=verification=trace ./target/release/pzec

pzec.zip

svyatonik commented 5 years ago

Thanks for the log! This issue (Block "0000000003f9a4833161d37c1f31ef1a0b71ea8a3e2e9fa721bfcf046e1aab45" verification failed with error "CoinbaseOverspend { expected_max: 1250142137, actual: 1250151542 }) has been fixed recently in #88 and #90 . Please update to latest master and retry