Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Add missing unit tests for DPos module #7259

Closed
Tracked by #7245
sitetester opened this issue Jun 28, 2022 · 1 comment
Closed
Tracked by #7245

Add missing unit tests for DPos module #7259

sitetester opened this issue Jun 28, 2022 · 1 comment
Assignees
Milestone

Comments

@sitetester
Copy link
Contributor

Description

Genesis Processing

  • When genesis block initDelegates contains more delegates than round length (Genesis block should be rejected)
  • When genesis block initDelegates contains an address which is not a delegate account (Genesis block should be rejected)
  • When genesis block is accepted (It should update all registered usernames)

After block apply

  • When block is forged and finalized height is changed (It should clear vote weight cache)
  • During bootstrap period when its last block of round (It should create vote weight snapshot)
  • After bootstrap period when its last block of round (It should update the 2 validators who are not participating in consensus)
  • After bootstrap period when delegate missed the block (It should increment the consecutiveMissedBlocks)
  • After bootstrap period when delegate forged a block (It should reset consecutiveMissedBlocks to zero)
  • After bootstrap period when delegate forged a block (It should update lastForgedHeight to current height)

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

@has5aan
Copy link
Contributor

has5aan commented Nov 3, 2023

Genesis Processing

  • When genesis block initDelegates contains an address which is not a delegate account (Genesis block should be rejected)

The scenario Init validators includes non existing validator address covers the suggested scenario.

  • When genesis block initDelegates contains an address which is not a delegate account (Genesis block should be rejected)

A stricter check against number of active validators covers this suggestion.

After Transaction Execute

  • During bootstrap period when its last block of round (It should create vote weight snapshot)
  • After bootstrap period when its last block of round (It should update the 2 validators who are not participating in consensus)
  • After bootstrap period when delegate missed the block (It should increment the consecutiveMissedBlocks)
  • After bootstrap period when delegate forged a block (It should update lastForgedHeight to current height)

The tests should update validators and should create stake weight snapshot covers the reported scenarios post restructuring.

Recent updates to the implementation attempts to aligns it to the LIP definition, the parts that are not are logged under #8020

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants