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

Manage Validators in a Contract #62

Open
heikoheiko opened this issue May 2, 2016 · 0 comments
Open

Manage Validators in a Contract #62

heikoheiko opened this issue May 2, 2016 · 0 comments

Comments

@heikoheiko
Copy link
Contributor

Currently the list of validators is managed in the configuration.

Task:

  • Write a smart contract that keeps track of the validators
  • Write an abstraction to retrieve the list of validators

Contract:
Stores

  • validators = Map(validator_address : (begin_block, end_block))
    while last_block can be zero if validation does not expire
  • proposals = Map(validator_address : (begin_block, end_block, voting_end_block))
  • proposal_votes Map(validator_address : [votes])

Logic:
The contract is consulted to get the list of validators for a certain block height.
New validators are proposed by anyone and voted on by the current set of validators. Validators are removed by proposing them with an end_block in the past. With every vote transaction the quorum (another contract member, settable as a fraction of the number of validators) is checked and if reached the validator is added/removed to the validator list. Also with every tx pending proposals are checked for voting_end_block.

Notes:

  • think about caching access to the validator set in the contract, since there are many requests to the validator set and looking it up in the contract is slow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant