New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make usage of delegate list BFT compliant - Closes #3681 #4397
Make usage of delegate list BFT compliant - Closes #3681 #4397
Conversation
This reverts commit c23651f.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one feedback, but all looks good to me.
Invert params on Dpos methods to make use of default value of delegateListRoundOffset
fcc62f5
to
7dd644a
Compare
… into 3681-failed_verify_slot_after_101
f23d160
to
a217e92
Compare
async getForgerPublicKeysForRound(round) { | ||
async getForgerPublicKeysForRound(round, delegateListRoundOffset) { | ||
// Delegate list is generated from round 1 hence `roundWithOffset` can't be less than 1 | ||
const roundWithOffset = Math.max(round - delegateListRoundOffset, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think adding a check against negative offset values make sense? For instance, if round: 6 and I provide offset: -2 I can get the list for round 8. Just saying..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point but I would prefer doing this in another ticket to avoid more changes and tests broken in this PR 😬
What was the problem?
List of delegates used to verify block forger was different from the on used to forge.
The delegate list round offset was not being used to calculate delegates who missed the slot in order to update
missedBlocks
property.How did I solve it?
delegateListRoundOffset
to apply/undo/getForgerPublicKeysForRound.DELEGATE_LIST_ROUND_OFFSET
to set thedelegateListRoundOffset
default value for Dpos moduleHow to manually test it?
Review checklist