dusk-network / dusk-blockchain

Reference implementation of the DUSK Network node, written in Golang
MIT License
102 stars 47 forks source link

Investigate and solve newblock msg errors #1443

Closed goshawk-3 closed 2 years ago

goshawk-3 commented 2 years ago

Describe the bug Error "newblock msg is not signed by a block generator" is reported by devnet. This may happen if the seed has changed while sortition is running but more data is needed to confirm the hypothesis.

To Reproduce Noticed on devnet only. Never on test-harness.

Expected behaviour In devnet, newblock should be always signed by the single block generator of the round/iteration pair.

Logs/Screenshot

{"error":"newblock msg is not signed by a block generator","level":"error","msg":"failed to verify newblock","msg_blockhash":"9e73ed55561971d5806bb6207ce2cedd9b3af05756192936c387e9066edea2e1","msg_pubkey":"8ecd3f2600396d2ea8105a740a0c10b0e7ee5a68e39e7c13d0155b4bba5f311d9822dd1cef7e16e0c4b338ef003fd0740c2ce8e51a62be00865441149a5aada4b97697997823e8d2a6eadc860cb94629901f4c4139d8fbe3190680a3fb755579","msg_round":109159,"msg_signature":"b88ba58da0dc630cf13a102eaad45f293b3d2858a07f25444b3db13e4c8571dbb8c118247480d7a376628217492ca714","msg_step":1,"phase":"selector","process":"consensus","seed":"94246cfdd2ea9ee18ac797520013c7c06de3bc5e330fc58c15dd981209ddc73dd057c5dfffdd9528975f6ba526053b47","time":"2022-07-26T13:44:58Z"}
{"error":"newblock msg is not signed by a block generator","level":"error","msg":"failed to verify newblock","msg_blockhash":"3e95b33ca2d1c83c9ff57c7a0b0c3b6f1071834af7c4d9e6d29c8d3d89e95b41","msg_pubkey":"b229f7bba8bccff42ff9fa6e249bb445ec95298439fad0cb28f70cbd6f6aeb85e0f69b4d2908a46c1e46d6b8e6f95ad80bffa6532876eead77d4620700648a7f2277bc781fa07072b7b236f34d45bd3d126921e5c4b53b5219117846e9b8e3d9","msg_round":109159,"msg_signature":"802b16ae1f316c48882f6335346f81fe510240e783fed7e8aee896c41dbaa066cc06d572b024351d482c05bd96148bb8","msg_step":4,"phase":"selector","process":"consensus","seed":"94246cfdd2ea9ee18ac797520013c7c06de3bc5e330fc58c15dd981209ddc73dd057c5dfffdd9528975f6ba526053b47","time":"2022-07-26T13:45:00Z"}
{"error":"newblock msg is not signed by a block generator","level":"error","msg":"failed to verify newblock","msg_blockhash":"d0da8c2dfd00214aec44cc230b56453ab5d4ccbca0026c4cb25494527c28d601","msg_pubkey":"912ee72e6fb34ebaf2c8f15de2716dfa656c3386c440316c3780336848b55932e061cb308e41490d4c1efcc8e165a50c1259c5b8025ac3913e8e5d404862db9e6475117270bdbe542ddca0cfe0ed66d19bd87f888b3989e92181b53f3b7e19b3","msg_round":109160,"msg_signature":"8f113aa92b3a6a131235de7d85e71d3d8a63417a994712243dcb824a03090ca7e0c42270a8c95f64309b3c75ebfa1cb2","msg_step":1,"phase":"selector","process":"consensus","seed":"958ffecf447e6ceeea52906974a0029ec77d41788c3884a3e822c2d884840d9079cf7687bf86d7679757c8d2cc6decdb","time":"2022-07-26T13:49:09Z"}
goshawk-3 commented 2 years ago

Additionally, a wrong check in ShouldProcess allows NewBlock messages from future blocks > round + 10 to be processed