Manager to create NegativeUNL votes.
More...
#include <NegativeUNLVote.h>
Manager to create NegativeUNL votes.
Definition at line 26 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 60 of file NegativeUNLVote.h.
◆ NegativeUNLVote()
Constructor.
- Parameters
-
| myId | the NodeID of the local node |
| j | log |
Definition at line 9 of file NegativeUNLVote.cpp.
◆ ~NegativeUNLVote()
| xrpl::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 14 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 286 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 87 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 117 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 134 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 212 of file NegativeUNLVote.cpp.
◆ purgeNewValidators()
| void xrpl::NegativeUNLVote::purgeNewValidators |
( |
LedgerIndex |
seq | ) |
|
|
private |
Purge validators that are not new anymore.
- Parameters
-
| seq | the current LedgerIndex |
Definition at line 300 of file NegativeUNLVote.cpp.
◆ test::NegativeUNLVoteInternal_test
◆ test::NegativeUNLVoteScoreTable_test
◆ negativeUNLLowWaterMark
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 35 of file NegativeUNLVote.h.
◆ negativeUNLHighWaterMark
An unreliable validator must have more than negativeUNLHighWaterMark validations in the last flag ledger period to be re-enabled.
Definition at line 40 of file NegativeUNLVote.h.
◆ negativeUNLMinLocalValsToVote
| constexpr size_t xrpl::NegativeUNLVote::negativeUNLMinLocalValsToVote = FLAG_LEDGER_INTERVAL * 90 / 100 |
|
staticconstexpr |
The minimum number of validations of the local node for it to participate in the voting.
Definition at line 45 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 50 of file NegativeUNLVote.h.
◆ negativeUNLMaxListed
| constexpr float xrpl::NegativeUNLVote::negativeUNLMaxListed = 0.25 |
|
staticconstexpr |
We only want to put 25% of the UNL on the NegativeUNL.
Definition at line 54 of file NegativeUNLVote.h.
◆ myId_
| NodeID const xrpl::NegativeUNLVote::myId_ |
|
private |
◆ j_
◆ mutex_
◆ newValidators_