![]() |
PIVX Core
5.6.99
P2P Digital Currency
|
The DKG session is a single instance of the DKG process. More...
#include <quorums_dkgsession.h>
Public Member Functions | |
| CDKGSession (const Consensus::LLMQParams &_params, CBLSWorker &_blsWorker, CDKGSessionManager &_dkgManager) | |
| bool | Init (const CBlockIndex *_pindexQuorum, const std::vector< CDeterministicMNCPtr > &mns, const uint256 &_myProTxHash) |
| size_t | GetMyMemberIndex () const |
| void | Contribute (CDKGPendingMessages &pendingMessages) |
| The following sets of methods are for the first 4 phases handled in the session. More... | |
| void | SendContributions (CDKGPendingMessages &pendingMessages) |
| bool | PreVerifyMessage (const CDKGContribution &qc, bool &retBan) const |
| void | ReceiveMessage (const uint256 &hash, const CDKGContribution &qc, bool &retBan) |
| void | VerifyPendingContributions () |
| void | VerifyAndComplain (CDKGPendingMessages &pendingMessages) |
| void | VerifyConnectionAndMinProtoVersions () |
| void | SendComplaint (CDKGPendingMessages &pendingMessages) |
| bool | PreVerifyMessage (const CDKGComplaint &qc, bool &retBan) const |
| void | ReceiveMessage (const uint256 &hash, const CDKGComplaint &qc, bool &retBan) |
| void | VerifyAndJustify (CDKGPendingMessages &pendingMessages) |
| void | SendJustification (CDKGPendingMessages &pendingMessages, const std::set< uint256 > &forMembers) |
| bool | PreVerifyMessage (const CDKGJustification &qj, bool &retBan) const |
| void | ReceiveMessage (const uint256 &hash, const CDKGJustification &qj, bool &retBan) |
| void | VerifyAndCommit (CDKGPendingMessages &pendingMessages) |
| void | SendCommitment (CDKGPendingMessages &pendingMessages) |
| bool | PreVerifyMessage (const CDKGPrematureCommitment &qc, bool &retBan) const |
| void | ReceiveMessage (const uint256 &hash, const CDKGPrematureCommitment &qc, bool &retBan) |
| std::vector< CFinalCommitment > | FinalizeCommitments () |
| bool | AreWeMember () const |
| void | MarkBadMember (CDKGMember *member) |
| void | RelayInvToParticipants (const CInv &inv) const |
| CDKGMember * | GetMember (const uint256 &proTxHash) const |
Private Member Functions | |
| bool | ShouldSimulateError (const std::string &error_type) |
Private Attributes | |
| const Consensus::LLMQParams & | params |
| CBLSWorker & | blsWorker |
| CBLSWorkerCache | cache |
| CDKGSessionManager & | dkgManager |
| const CBlockIndex * | pindexQuorum |
| std::vector< std::unique_ptr< CDKGMember > > | members |
| std::map< uint256, size_t > | membersMap |
| std::set< uint256 > | relayMembers |
| BLSVerificationVectorPtr | vvecContribution |
| BLSSecretKeyVector | skContributions |
| BLSIdVector | memberIds |
| std::vector< BLSVerificationVectorPtr > | receivedVvecs |
| BLSSecretKeyVector | receivedSkContributions |
| uint256 | myProTxHash |
| CBLSId | myId |
| size_t | myIdx {(size_t)-1} |
| RecursiveMutex | invCs |
| std::map< uint256, CDKGContribution > | contributions |
| std::map< uint256, CDKGComplaint > | complaints |
| std::map< uint256, CDKGJustification > | justifications |
| std::map< uint256, CDKGPrematureCommitment > | prematureCommitments |
| std::set< uint256 > | seenMessages |
| std::vector< size_t > | pendingContributionVerifications |
| std::set< uint256 > | validCommitments |
Friends | |
| class | CDKGSessionHandler |
| class | CDKGSessionManager |
| class | CDKGLogger |
| template<typename Message > | |
| class | CDKGMessageHandler |
The DKG session is a single instance of the DKG process.
It is owned and called by CDKGSessionHandler, which passes received DKG messages to the session. The session is not persistent and will loose it's state (the whole object is discarded) when it finishes (after the mining phase) or is aborted.
When incoming contributions are received and the verification vector is valid, it is passed to CDKGSessionManager which will store it in the evo DB. Secret key contributions which are meant for the local member are also passed to CDKGSessionManager to store them in the evo DB. If verification of the SK contribution initially fails, it is not passed to CDKGSessionManager. If the justification phase later gives a valid SK contribution from the same member, it is then passed to CDKGSessionManager and after this handled the same way.
The contributions stored by CDKGSessionManager are then later loaded by the quorum instances and used for signing sessions, but only if the local node is a member of the quorum.
Definition at line 229 of file quorums_dkgsession.h.
|
inline |
Definition at line 278 of file quorums_dkgsession.h.
|
inline |
Definition at line 327 of file quorums_dkgsession.h.
| void llmq::CDKGSession::Contribute | ( | CDKGPendingMessages & | pendingMessages | ) |
The following sets of methods are for the first 4 phases handled in the session.
The flow of message calls is identical for all phases:
Definition at line 140 of file quorums_dkgsession.cpp.
| std::vector< CFinalCommitment > llmq::CDKGSession::FinalizeCommitments | ( | ) |
| CDKGMember * llmq::CDKGSession::GetMember | ( | const uint256 & | proTxHash | ) | const |
|
inline |
Definition at line 283 of file quorums_dkgsession.h.
| bool llmq::CDKGSession::Init | ( | const CBlockIndex * | _pindexQuorum, |
| const std::vector< CDeterministicMNCPtr > & | mns, | ||
| const uint256 & | _myProTxHash | ||
| ) |
| void llmq::CDKGSession::MarkBadMember | ( | CDKGMember * | member | ) |
| bool llmq::CDKGSession::PreVerifyMessage | ( | const CDKGComplaint & | qc, |
| bool & | retBan | ||
| ) | const |
| bool llmq::CDKGSession::PreVerifyMessage | ( | const CDKGContribution & | qc, |
| bool & | retBan | ||
| ) | const |
| bool llmq::CDKGSession::PreVerifyMessage | ( | const CDKGJustification & | qj, |
| bool & | retBan | ||
| ) | const |
| bool llmq::CDKGSession::PreVerifyMessage | ( | const CDKGPrematureCommitment & | qc, |
| bool & | retBan | ||
| ) | const |
| void llmq::CDKGSession::ReceiveMessage | ( | const uint256 & | hash, |
| const CDKGComplaint & | qc, | ||
| bool & | retBan | ||
| ) |
| void llmq::CDKGSession::ReceiveMessage | ( | const uint256 & | hash, |
| const CDKGContribution & | qc, | ||
| bool & | retBan | ||
| ) |
| void llmq::CDKGSession::ReceiveMessage | ( | const uint256 & | hash, |
| const CDKGJustification & | qj, | ||
| bool & | retBan | ||
| ) |
| void llmq::CDKGSession::ReceiveMessage | ( | const uint256 & | hash, |
| const CDKGPrematureCommitment & | qc, | ||
| bool & | retBan | ||
| ) |
| void llmq::CDKGSession::RelayInvToParticipants | ( | const CInv & | inv | ) | const |
Definition at line 1314 of file quorums_dkgsession.cpp.
| void llmq::CDKGSession::SendCommitment | ( | CDKGPendingMessages & | pendingMessages | ) |
Definition at line 925 of file quorums_dkgsession.cpp.
| void llmq::CDKGSession::SendComplaint | ( | CDKGPendingMessages & | pendingMessages | ) |
Definition at line 479 of file quorums_dkgsession.cpp.
| void llmq::CDKGSession::SendContributions | ( | CDKGPendingMessages & | pendingMessages | ) |
Definition at line 160 of file quorums_dkgsession.cpp.
| void llmq::CDKGSession::SendJustification | ( | CDKGPendingMessages & | pendingMessages, |
| const std::set< uint256 > & | forMembers | ||
| ) |
Definition at line 670 of file quorums_dkgsession.cpp.
|
private |
Definition at line 57 of file quorums_dkgsession.cpp.
| void llmq::CDKGSession::VerifyAndCommit | ( | CDKGPendingMessages & | pendingMessages | ) |
| void llmq::CDKGSession::VerifyAndComplain | ( | CDKGPendingMessages & | pendingMessages | ) |
| void llmq::CDKGSession::VerifyAndJustify | ( | CDKGPendingMessages & | pendingMessages | ) |
| void llmq::CDKGSession::VerifyConnectionAndMinProtoVersions | ( | ) |
Definition at line 445 of file quorums_dkgsession.cpp.
| void llmq::CDKGSession::VerifyPendingContributions | ( | ) |
Definition at line 358 of file quorums_dkgsession.cpp.
|
friend |
Definition at line 233 of file quorums_dkgsession.h.
|
friend |
Definition at line 234 of file quorums_dkgsession.h.
|
friend |
Definition at line 231 of file quorums_dkgsession.h.
|
friend |
Definition at line 232 of file quorums_dkgsession.h.
|
private |
Definition at line 239 of file quorums_dkgsession.h.
|
private |
Definition at line 240 of file quorums_dkgsession.h.
|
private |
Definition at line 266 of file quorums_dkgsession.h.
|
private |
Definition at line 265 of file quorums_dkgsession.h.
|
private |
Definition at line 241 of file quorums_dkgsession.h.
|
mutableprivate |
Definition at line 264 of file quorums_dkgsession.h.
|
private |
Definition at line 267 of file quorums_dkgsession.h.
|
private |
Definition at line 251 of file quorums_dkgsession.h.
|
private |
Definition at line 245 of file quorums_dkgsession.h.
|
private |
Definition at line 246 of file quorums_dkgsession.h.
|
private |
Definition at line 257 of file quorums_dkgsession.h.
|
private |
Definition at line 258 of file quorums_dkgsession.h.
|
private |
Definition at line 256 of file quorums_dkgsession.h.
|
private |
Definition at line 237 of file quorums_dkgsession.h.
|
private |
Definition at line 272 of file quorums_dkgsession.h.
|
private |
Definition at line 243 of file quorums_dkgsession.h.
|
private |
Definition at line 268 of file quorums_dkgsession.h.
|
private |
Definition at line 254 of file quorums_dkgsession.h.
|
private |
Definition at line 252 of file quorums_dkgsession.h.
|
private |
Definition at line 247 of file quorums_dkgsession.h.
|
private |
Definition at line 270 of file quorums_dkgsession.h.
|
private |
Definition at line 249 of file quorums_dkgsession.h.
|
private |
Definition at line 275 of file quorums_dkgsession.h.
|
private |
Definition at line 248 of file quorums_dkgsession.h.