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

Update DPoS library to snapshot totalVotesReceived to voteWeight in consensus state #4938

Closed
shuse2 opened this issue Mar 9, 2020 · 0 comments · Fixed by #5060
Closed

Update DPoS library to snapshot totalVotesReceived to voteWeight in consensus state #4938

shuse2 opened this issue Mar 9, 2020 · 0 comments · Fixed by #5060
Assignees
Milestone

Comments

@shuse2
Copy link
Collaborator

shuse2 commented Mar 9, 2020

Description

Update DPoS library to snapshot totalVotesReceived instead of forgers list at the end of the round.
During the snapshot,

  • banned delegate should not be included in the snapshot
  • Vote weight of punished delegate should be set to 0
  • While undoing, irrelevant snapshots can be removed. (ie: list which will be used more than 2 rounds ahead can be changed, so it can be deleted)
  • Save the list with key: round to next round + offset(2)
  • Vote weight should be capped to the self vote * 10

Motivation

In order to calculate the correct forger list with the offset, delegate weight needs to be stored.

Acceptance Criteria

  • Test case where there are banned delegates
  • Test case where there are punished delegates
  • Test case for first 3 rounds, which should be created at the startup
  • Test case when undo, future list is removed.
  • Test case where vote weight is capped by self vote

Related issues

#4915

@shuse2 shuse2 changed the title Update DPoS library to snapshot totalVotedDelegates to voteWeight in chain state Update DPoS library to snapshot totalVotedDelegates to voteWeight in consensus state Mar 12, 2020
@shuse2 shuse2 changed the title Update DPoS library to snapshot totalVotedDelegates to voteWeight in consensus state Update DPoS library to snapshot totalVotesReceived to voteWeight in consensus state Mar 13, 2020
@sridharmeganathan sridharmeganathan added this to the Next Sprint milestone Mar 23, 2020
@shuse2 shuse2 self-assigned this Mar 26, 2020
shuse2 added a commit that referenced this issue Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants