Skip to content
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

Replace Tendermint's PoS to VRF-based Random Sampling #48

Closed
torao opened this issue Mar 30, 2020 · 2 comments
Closed

Replace Tendermint's PoS to VRF-based Random Sampling #48

torao opened this issue Mar 30, 2020 · 2 comments
Assignees
Labels
C: enhancement Classification: New feature or its request, or improvement in maintainability of code

Comments

@torao
Copy link
Contributor

torao commented Mar 30, 2020

Modify current Proposer selection by round-robin in the ValidatorSet to a random selection using VRF. Using #32, #40, #45

While this modification may result in dead code for many of the priority adjustments that ValidatorSet currently have, it leaves the priority adjustment code intact because of the way the Priority in the Tendermint PoS is used to weighted random selection.

@torao torao self-assigned this Mar 30, 2020
@torao torao added the C: enhancement Classification: New feature or its request, or improvement in maintainability of code label Mar 30, 2020
@torao torao added this to the Evolve Leader Election into VRF milestone Mar 30, 2020
@torao
Copy link
Contributor Author

torao commented Mar 31, 2020

Investigation of modification

Where the ValidatorSet is used as a field

  • RoundState: Validators, LastValidators
    • The Proposer field holds only the Address and Index in ValidatorInfo.
  • HeightVoteSet: valSet
  • VoteSet: valSet
  • State: NextValidators, Validators, LastValidators

Where the ValidatorSet.Proposer is modified

  • NewValidatorSet()
    • GenesisDoc.ValidatorHash() → only called in test code
    • Handshaker.ReplayBlocks()
    • state.MakeGenesisState()
    • client.provider.getValidatorSet()
    • lite.privKeys.ToValidators()
    • http.http.ValidatorSet()
  • Copy()
    • CopyIncrementProposerPriority()
      • State.MakeGenesisState()
    • State.GetValidators()
    • State.enterNewRound()
  • GetProposer()
    • StringIndented()
      • String() → general interface method
    • RoundState.RoundStateSample()
      • State.GetRoundStateSimpleJSON()
        • consensus.ConsensusState()
    • RoundState.NewRoundEvent()
      • State.enterNewRound()
    • State.enterPropose()
    • State.isProposer()
    • State.defaultSetProposal()
  • IncrementProposerPriority()
    • CopyIncrementProposerPriority()
      • State.MakeGenesisState()
    • State.enterNewRound()
    • state.LoadValidators()
    • execution.updateState()
    • NewValidatorSet()
      • GenesisDoc.ValidatorHash() → only from test code

@torao
Copy link
Contributor Author

torao commented Apr 15, 2020

I've fixed the Proposer election to be done by VRF. However, a few tasks and discussions remain to be done.

  1. Some tests have been skipped. They assumed deterministic PoS behavior and assigned the role of Proposer to a fixed Validator, and that assumption is broken by the random selection by VRF. This is because it takes time to apply a (deterministic) randomly chosen Proposer in VRF to the same scenario.
  2. The ProposerPriority, which is no longer needed due to random selection based on VotingPower, is retained. We leave it to consider how about to use ProposerPriority rather than VotingPower for weighting in order to prevent a succession of favorable states due to the large stake amount.

@torao torao closed this as completed Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: enhancement Classification: New feature or its request, or improvement in maintainability of code
Projects
None yet
Development

No branches or pull requests

1 participant