Manager to create NegativeUNL votes.
More...
|
void | addTx (LedgerIndex seq, PublicKey const &vp, NegativeUNLModify modify, std::shared_ptr< SHAMap > const &initialSet) |
| Add a ttUNL_MODIFY Tx to the transaction set. More...
|
|
NodeID | choose (uint256 const &randomPadData, std::vector< NodeID > const &candidates) |
| Pick one candidate from a vector of candidates. More...
|
|
std::optional< hash_map< NodeID, std::uint32_t > > | buildScoreTable (std::shared_ptr< Ledger const > const &prevLedger, hash_set< NodeID > const &unl, RCLValidations &validations) |
| Build a reliability measurement score table of validators' validation messages in the last flag ledger period. More...
|
|
const Candidates | findAllCandidates (hash_set< NodeID > const &unl, hash_set< NodeID > const &negUnl, hash_map< NodeID, std::uint32_t > const &scoreTable) |
| Process the score table and find all disabling and re-enabling candidates. More...
|
|
void | purgeNewValidators (LedgerIndex seq) |
| Purge validators that are not new anymore. More...
|
|
Manager to create NegativeUNL votes.
Definition at line 46 of file NegativeUNLVote.h.
◆ NegativeUNLModify
A flag indicating whether a UNLModify Tx is to disable or to re-enable a validator.
Enumerator |
---|
ToDisable | |
ToReEnable | |
Definition at line 83 of file NegativeUNLVote.h.
◆ NegativeUNLVote()
Constructor.
- Parameters
-
myId | the NodeID of the local node |
j | log |
Definition at line 27 of file NegativeUNLVote.cpp.
◆ ~NegativeUNLVote()
ripple::NegativeUNLVote::~NegativeUNLVote |
( |
| ) |
|
|
default |
◆ doVoting()
Cast our local vote on the NegativeUNL candidates.
- Parameters
-
prevLedger | the parent ledger |
unlKeys | the trusted master keys of validators in the UNL |
validations | the validation message container |
- Note
- validations is an in/out parameter. It contains validation messages that will be deleted when no longer needed by other consensus logic. This function asks it to keep the validation messages long enough for this function to use.
- Parameters
-
initialSet | the transactions set for adding ttUNL_MODIFY Tx if any |
Definition at line 33 of file NegativeUNLVote.cpp.
◆ newValidators()
Notify NegativeUNLVote that new validators are added.
So that they don't get voted to the NegativeUNL immediately.
- Parameters
-
seq | the current LedgerIndex when adding the new validators |
nowTrusted | the new validators |
Definition at line 317 of file NegativeUNLVote.cpp.
◆ addTx()
Add a ttUNL_MODIFY Tx to the transaction set.
- Parameters
-
seq | the LedgerIndex when adding the Tx |
vp | the master public key of the validator |
modify | disabling or re-enabling the validator |
initialSet | the transaction set |
Definition at line 107 of file NegativeUNLVote.cpp.
◆ choose()
Pick one candidate from a vector of candidates.
- Parameters
-
randomPadData | the data used for picking a candidate. |
- Note
- Nodes must use the same randomPadData for picking the same candidate. The hash of the parent ledger is used.
- Parameters
-
candidates | the vector of candidates |
- Returns
- the picked candidate
Definition at line 139 of file NegativeUNLVote.cpp.
◆ buildScoreTable()
Build a reliability measurement score table of validators' validation messages in the last flag ledger period.
- Parameters
-
prevLedger | the parent ledger |
unl | the trusted master keys |
validations | the validation container |
- Note
- validations is an in/out parameter. It contains validation messages that will be deleted when no longer needed by other consensus logic. This function asks it to keep the validation messages long enough for this function to use.
- Returns
- the built scoreTable or empty optional if table could not be built
Definition at line 158 of file NegativeUNLVote.cpp.
◆ findAllCandidates()
Process the score table and find all disabling and re-enabling candidates.
- Parameters
-
unl | the trusted master keys |
negUnl | the NegativeUNL |
scoreTable | the score table |
- Returns
- the candidates to disable and the candidates to re-enable
Definition at line 242 of file NegativeUNLVote.cpp.
◆ purgeNewValidators()
void ripple::NegativeUNLVote::purgeNewValidators |
( |
LedgerIndex |
seq | ) |
|
|
private |
Purge validators that are not new anymore.
- Parameters
-
seq | the current LedgerIndex |
Definition at line 334 of file NegativeUNLVote.cpp.
◆ test::NegativeUNLVoteInternal_test
◆ test::NegativeUNLVoteScoreTable_test
◆ negativeUNLLowWaterMark
constexpr size_t ripple::NegativeUNLVote::negativeUNLLowWaterMark |
|
staticconstexpr |
Initial value:
A validator is considered unreliable if its validations is less than negativeUNLLowWaterMark in the last flag ledger period.
An unreliable validator is a candidate to be disabled by the NegativeUNL protocol.
Definition at line 55 of file NegativeUNLVote.h.
◆ negativeUNLHighWaterMark
constexpr size_t ripple::NegativeUNLVote::negativeUNLHighWaterMark |
|
staticconstexpr |
Initial value:
An unreliable validator must have more than negativeUNLHighWaterMark validations in the last flag ledger period to be re-enabled.
Definition at line 61 of file NegativeUNLVote.h.
◆ negativeUNLMinLocalValsToVote
constexpr size_t ripple::NegativeUNLVote::negativeUNLMinLocalValsToVote |
|
staticconstexpr |
Initial value:
The minimum number of validations of the local node for it to participate in the voting.
Definition at line 67 of file NegativeUNLVote.h.
◆ newValidatorDisableSkip
We don't want to disable new validators immediately after adding them.
So we skip voting for disabling them for 2 flag ledgers.
Definition at line 73 of file NegativeUNLVote.h.
◆ negativeUNLMaxListed
constexpr float ripple::NegativeUNLVote::negativeUNLMaxListed = 0.25 |
|
staticconstexpr |
We only want to put 25% of the UNL on the NegativeUNL.
Definition at line 77 of file NegativeUNLVote.h.
◆ myId_
const NodeID ripple::NegativeUNLVote::myId_ |
|
private |
◆ j_
◆ mutex_
◆ newValidators_