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

The candidates can share the same bridge operator and other data #57

Closed
ducthotran2010 opened this issue Nov 4, 2022 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@ducthotran2010
Copy link
Contributor

    We should not allow validators to share the same admin, treasury, or bridge operator

Originally posted by @ducthotran2010 in #22 (comment)

uint256 _length = _candidates.length;
require(_length < maxValidatorCandidate(), "CandidateManager: exceeds maximum number of candidates");
require(!isValidatorCandidate(_consensusAddr), "CandidateManager: query for already existent candidate");
require(_commissionRate <= _MAX_PERCENTAGE, "CandidateManager: invalid comission rate");
_candidateIndex[_consensusAddr] = ~_length;
_candidates.push(_consensusAddr);
_candidateInfo[_consensusAddr] = ValidatorCandidate(
_admin,
_consensusAddr,
_treasuryAddr,
_bridgeOperatorAddr,
_commissionRate,
type(uint256).max,
new bytes(0)
);
emit CandidateGranted(_consensusAddr, _treasuryAddr, _admin, _bridgeOperatorAddr);

@ducthotran2010 ducthotran2010 added the bug Something isn't working label Nov 4, 2022
@nxqbao
Copy link
Contributor

nxqbao commented Nov 11, 2022

Are these three addresses need to be different from each other?

// Address of the validator that produces block, e.g. block.coinbase. This is so-called validator address.
address consensusAddr;
// Address to voting proposal
address governor;
// Address to voting bridge operators
address bridgeVoter;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants