Closed phahulin closed 6 years ago
@phahulin this is probably a dumb question, but what are MoC s?
MoC stands for Master of Ceremony. In a network like ours, he's the initial validator who starts the network and deploys required contracts to get it into operational state. Then he invites first "real" validators to join the network.
After that the "Ceremony" is over, and MoC only supports the network by producing blocks, he does not have any voting rights. This is why he doesn't have a voting key, only the mining key. The first validator on the list https://validators.poa.network is MoC.
That said, I think this should cover all cases at once including MoC:
0x0000000000000000000000000000000000000000
or 0x0
or 0x00
or 0x
) - take mining key instead@unjapones To retrieve voting key by mining key, you can use KeysManager.getVotingByMining
public method: https://github.com/poanetwork/poa-network-consensus-contracts/blob/e6e04e926e3b44a2e48a897c03225726a241537f/contracts/KeysManager.sol#L337 - it will always return zero address for the wrong (or zero) mining key.
@phahulin https://github.com/poanetwork/poa-dapps-validators/pull/84 has been merged. Are there any pending items that I should check?
If not, after verifying that the merged code works as expected, feel free to close this issue (not sure about the process).
It turns out, most validators use their voting key to send postcards in PoPA.
So it would be better to fetched physical addresses based on that key (except for MoC who doesn't have voting key). If there are no addresses on that voting key or voting key doesn't exist - retry fetching by mining key.