mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
feat(rpc): Added previousConsecutiveDKGFailures for rotation in quorum rpc (#5158)
## Issue being fixed or feature implemented Platform and research team have requested this change. ## What was done? `quorum info` was updated with the introduction of new field `previousConsecutiveDKGFailures` that be returned only for rotated LLMQs. This field will hold the number of previously consecutive failed DGKs for the corresponding quorumIndex before the currently active one. Note: If no previously commitments were found then 0 will be returned for `previousConsecutiveDKGFailures`. Example: - DKG `A` was successful - DKG `B` failed - DKG `C` failed - DKG `D` was successful - DKG `E` was successful - `previousConsecutiveDKGFailures` = 0 when requesting for quorum `A` (because `A` is the first ever created quorum for that quorumIndex) - `previousConsecutiveDKGFailures` = 2 when requesting for quorum `D` - `previousConsecutiveDKGFailures` = 0 when requesting for quorum `E` ## How Has This Been Tested? ## Breaking Changes ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation **For repository code-owners and collaborators only** - [x] I have assigned this pull request to a milestone Co-authored-by: thephez <thephez@users.noreply.github.com>
This commit is contained in:
parent
e7e48329f7
commit
f0009acfae
4
doc/release-notes-5158.md
Normal file
4
doc/release-notes-5158.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Updated RPCs
|
||||||
|
--------
|
||||||
|
|
||||||
|
- `quorum info`: The new `previousConsecutiveDKGFailures` field will be returned for rotated LLMQs. This field will hold the number of previous consecutive DKG failures for the corresponding quorumIndex before the currently active one. Note: If no previous commitments were found then 0 will be returned for `previousConsecutiveDKGFailures`.
|
@ -189,6 +189,17 @@ static UniValue BuildQuorumInfo(const llmq::CQuorumCPtr& quorum, bool includeMem
|
|||||||
ret.pushKV("quorumIndex", quorum->qc->quorumIndex);
|
ret.pushKV("quorumIndex", quorum->qc->quorumIndex);
|
||||||
ret.pushKV("minedBlock", quorum->minedBlockHash.ToString());
|
ret.pushKV("minedBlock", quorum->minedBlockHash.ToString());
|
||||||
|
|
||||||
|
if (quorum->params.useRotation) {
|
||||||
|
auto previousActiveCommitment = llmq::quorumBlockProcessor->GetLastMinedCommitmentsByQuorumIndexUntilBlock(quorum->params.type, quorum->m_quorum_base_block_index, quorum->qc->quorumIndex, 0);
|
||||||
|
if (previousActiveCommitment.has_value()) {
|
||||||
|
int previousConsecutiveDKGFailures = (quorum->m_quorum_base_block_index->nHeight - previousActiveCommitment.value()->nHeight) / quorum->params.dkgInterval - 1;
|
||||||
|
ret.pushKV("previousConsecutiveDKGFailures", previousConsecutiveDKGFailures);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ret.pushKV("previousConsecutiveDKGFailures", 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (includeMembers) {
|
if (includeMembers) {
|
||||||
UniValue membersArr(UniValue::VARR);
|
UniValue membersArr(UniValue::VARR);
|
||||||
for (size_t i = 0; i < quorum->members.size(); i++) {
|
for (size_t i = 0; i < quorum->members.size(); i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user