dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

Target epoch in the future error during initial sync #988

Closed Nizametdinov closed 5 years ago

Nizametdinov commented 5 years ago

Describe the bug There are a lot of error messages target_epoch=<...> is in the future in debug.log during initial sync.

2019-04-16 07:31:14 [finalization] ERROR: IsVotable: target_epoch=5 is in the future.
.
2019-04-16 07:31:14 [finalization] ERROR: ValidateVote: not votable. validator=fd64a72c0bab62b8274efc0d0ac5e7bab5493156 target=05629f84b51028f76e3cf56a3d289e466a5514dfd02ac73c56e8f8cb957fdc34 source_epoch=4 target_epoch=5

Some of them are followed by mempoolrej.

2019-04-16 07:39:23 [finalization] Checking VOTE with id 0fcc2bb8d11197eb0f0a24d4b704c64cf7e9e9819e01dc72b8b9882c93a8f24b
2019-04-16 07:39:23 [finalization] ERROR: IsVotable: target_epoch=155 is in the future.
.
2019-04-16 07:39:23 [finalization] ERROR: ValidateVote: not votable. validator=a7f4737d9a64c37a721fff3d360a537d0f51686d target=9a685bd7b28ae78408ff61e2686f03b87bf9c7b46adf9742097e9c0e6cb562ff source_epoch=154 target_epoch=155
.
2019-04-16 07:39:23 [finalization] ERROR: IsVotable: target_epoch=155 is in the future.
.
2019-04-16 07:39:23 [finalization] ERROR: ValidateVote: not votable. validator=a7f4737d9a64c37a721fff3d360a537d0f51686d target=9a685bd7b28ae78408ff61e2686f03b87bf9c7b46adf9742097e9c0e6cb562ff source_epoch=154 target_epoch=155
.
2019-04-16 07:39:23 [finalization] ERROR: VOTE (0fcc2bb8d11197eb0f0a24d4b704c64cf7e9e9819e01dc72b8b9882c93a8f24b) check failed: bad-vote-invalid
2019-04-16 07:39:23 [  mempoolrej] 0fcc2bb8d11197eb0f0a24d4b704c64cf7e9e9819e01dc72b8b9882c93a8f24b from peer=3 was not accepted: bad-vote-invalid (code 16)

To Reproduce Start unit-e on the testnet with clean datadir.

Expected behavior The error message should not appear.

Environment

Nizametdinov commented 5 years ago

Here is the full log target-in-future.log.gz.

frolosofsky commented 5 years ago

Some of them are followed by mempoolrej.

These ones are ok in my opinion, we simply reject vote transaction during initial sync, because they are so far.

990 fixes other messages.

dsaveliev commented 5 years ago

Also have a message: has already voted for target_epoch=167 Full log: debug.log.gz

358622-2019-04-16 08:58:27 [         net] received: tx (329 bytes) peer=13
358623-2019-04-16 08:58:27 [finalization] Checking VOTE with id 86f205dab783125ead2815d1070659e6de837226a08554df0bccef0f9db57aec
358624:2019-04-16 08:58:27 [finalization] ERROR: IsVotable: validator=b84a15fd16b22d8548fc5f55896d460e74501228 has already voted for target_epoch=167.
358625-.
358626:2019-04-16 08:58:27 [finalization] ERROR: ValidateVote: not votable. validator=b84a15fd16b22d8548fc5f55896d460e74501228 target=5382e81f06c96adae2f9b06f3054f2963e8a8d28393d79cd386de0714ee6ea50 source_epoch=166 target_epoch=167
358627-.
358628-2019-04-16 08:58:27 [finalization] RecordVote: Slashable event found. Sending signal to the wallet.
358629:2019-04-16 08:58:27 [finalization] ERROR: IsVotable: validator=b84a15fd16b22d8548fc5f55896d460e74501228 has already voted for target_epoch=167.
358630-.
358631:2019-04-16 08:58:27 [finalization] ERROR: ValidateVote: not votable. validator=b84a15fd16b22d8548fc5f55896d460e74501228 target=5382e81f06c96adae2f9b06f3054f2963e8a8d28393d79cd386de0714ee6ea50 source_epoch=166 target_epoch=167
358632-.
358633:2019-04-16 08:58:27 [finalization] ERROR: VOTE (86f205dab783125ead2815d1070659e6de837226a08554df0bccef0f9db57aec) check failed: bad-vote-invalid
358634-2019-04-16 08:58:27 [  mempoolrej] 86f205dab783125ead2815d1070659e6de837226a08554df0bccef0f9db57aec from peer=13 was not accepted: bad-vote-invalid (code 16)
358635-2019-04-16 08:58:27 [         net] sending reject (53 bytes) peer=13
frolosofsky commented 5 years ago

I suggest moving https://github.com/dtr-org/unit-e/issues/988#issuecomment-483584890 to separate issue as it detected double vote and tried to slash finalizer. It seems not to be connected to initial sync process anyhow.

Ruteri commented 5 years ago

Old related issue https://github.com/dtr-org/unit-e/issues/849