axieinfinity/ronin-dpos-contracts

The candidates can share the same bridge operator and other data

ducthotran2010 opened this issue · 1 comments

    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);

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;