LiskArchive / lisk-sdk

🔩 Lisk software development kit
https://lisk.com
Apache License 2.0
2.72k stars 455 forks source link

forger:block:missed event returns a wrong delegate #6827

Closed przemerr closed 10 months ago

przemerr commented 3 years ago

Expected behavior

forger:block:missed should always return a correct delegate

Actual behavior

Sometimes when the event is fired, forger:block:missed returns a wrong delegate that missed the block. It's probably when the missed block is the last block in the round and the forger list gets reshuffled after the miss.

Which version(s) does this affect? (Environment, OS, etc...)

Lisk-SDK 5.1.4

przemerr commented 3 years ago

I believe it comes down to https://github.com/LiskHQ/lisk-sdk/blob/c2bd9bd483c2a9e765dfa471bbcb02b9e9925f80/framework-plugins/lisk-framework-forger-plugin/src/forger_plugin.ts#L406 being to late.

The bugged scenario would look like this: 102 forged -> a red delegate -> 103 forged -> forging list get reshuffled due to new round -> forgerlist query -> emitting wrong delegate

shuse2 commented 10 months ago

Closing this issue since this is no longer valid