-
Notifications
You must be signed in to change notification settings - Fork 12
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
Feature request for AuRa: using getPendingValidators()
getter instead of InitiateChange
event
#49
Comments
The description ⬆️ was updated:
I'll update the contract's code accordingly. |
Important note: transaction of calling |
@varasev can it be called by |
@DemiMarie hmm, it's a good proposal. I'll check if this breaks something in the code. Thanks for the thought. |
@varasev The first thing that require(newValidatorSetCallable()); So we can just change it to: if (!newValidatorSetCallable()) {
// do nothing
return;
} and just call it from |
getPendingValidators()
getter instead of InitiateChange
event
Yes, I've modified the contracts in accordance with this: https://github.com/poanetwork/pos-contracts/blob/8d10a85ad87633a54a7444883b32687faf5b80bf/contracts/BlockRewardAuRa.sol#L38-L39 So, now we don't have to modify the AuRa source code for calling However, we still need to read I've updated the description above and changed the title. |
Fixed by #53 |
Reopening; see #71 (comment). |
@DemiMarie, @varasev: I see this has been reverted on |
@afck Yes, I'm closing this. |
We agreed that we'll use the
getValidators()
getPendingValidators()
getter instead of catching theInitiateChange
event. Parity should just read the current validator set withgetValidators()
getPendingValidators()
every block, and if it discovers that the set is changed in the contract, it launches changing of the set in the engine.The
finalizeChange()
function (described in https://wiki.parity.io/Validator-Set.html) should be called by Parity afternewValidatorSet()
is called and the internal list of validators is updated in engine (this is default behavior for AuRa in Parity, so I think the code of the engine shouldn't be changed for that).UPDATE: stroke out things below are already implemented by the contracts.
Parity must callnewValidatorSet()
function bySYSTEM_ADDRESS
once a week.Since in AuRa the block time is determined (5 seconds), theValidatorSet
contract will keep track of elapsed time by itself, so there is no need to measure 1 week in Parity.1 week = 120960 blocksParity must call thenewValidatorSetCallable()
getter every block and check whether to callnewValidatorSet
.So, ifnewValidatorSetCallable()
returnstrue
, thenewValidatorSet()
must be called at the end of the current block.Important note: transaction of callingnewValidatorSet()
must be included in a block before transaction of callingBlockReward.reward()
.The text was updated successfully, but these errors were encountered: