Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
quorums_signing.h
Go to the documentation of this file.
70 unordered_lru_cache<std::pair<Consensus::LLMQType, uint256>, bool, StaticSaltedHasher, 30000> hasSigForIdCache;
101 void RemoveRecoveredSig(CDBBatch& batch, Consensus::LLMQType llmqType, const uint256& id, bool deleteHashKey, bool deleteTimeKey);
117 // when selecting a quorum for signing and verification, we use CQuorumManager::SelectQuorum with this offset as
118 // starting height for scanning. This is because otherwise the resulting signatures would not be verifiable by nodes
129 std::unordered_map<uint256, std::pair<CRecoveredSig, CQuorumCPtr>, StaticSaltedHasher> pendingReconstructedRecoveredSigs;
144 void ProcessMessage(CNode* pnode, const std::string& strCommand, CDataStream& vRecv, CConnman& connman);
146 // This is called when a recovered signature was was reconstructed from another P2P message and is known to be valid
148 void PushReconstructedRecoveredSig(const CRecoveredSig& recoveredSig, const CQuorumCPtr& quorum);
150 // This is called when a recovered signature can be safely removed from the DB. This is only safe when some other
151 // mechanism prevents possible conflicts. As an example, ChainLocks prevent conflicts in confirmed TXs InstantSend votes
152 // This won't completely remove all traces of the recovered sig but instead leave the hash entry in the DB. This
157 void ProcessMessageRecoveredSig(CNode* pfrom, const CRecoveredSig& recoveredSig, CConnman& connman);
162 std::unordered_map<std::pair<Consensus::LLMQType, uint256>, CQuorumCPtr, StaticSaltedHasher>& retQuorums);
164 bool ProcessPendingRecoveredSigs(CConnman& connman); // called from the worker thread of CSigSharesManager
165 void ProcessRecoveredSig(NodeId nodeId, const CRecoveredSig& recoveredSig, const CQuorumCPtr& quorum, CConnman& connman);
173 bool AsyncSignIfMember(Consensus::LLMQType llmqType, const uint256& id, const uint256& msgHash, bool allowReSign = false);
177 bool GetRecoveredSigForId(Consensus::LLMQType llmqType, const uint256& id, CRecoveredSig& retRecSig);
184 CQuorumCPtr SelectQuorumForSigning(Consensus::LLMQType llmqType, const uint256& selectionHash, int signHeight = -1 /*chain tip*/, int signOffset = SIGN_HEIGHT_OFFSET);
187 bool VerifyRecoveredSig(Consensus::LLMQType llmqType, int signedAtHeight, const uint256& id, const uint256& msgHash, const CBLSSignature& sig);
void SerializationOp(Stream &s, Operation ser_action)
Definition: quorums_signing.h:38
void CleanupOldVotes(int64_t maxAge)
Definition: quorums_signing.cpp:399
Definition: unordered_lru_cache.h:11
void ProcessRecoveredSig(NodeId nodeId, const CRecoveredSig &recoveredSig, const CQuorumCPtr &quorum, CConnman &connman)
Definition: quorums_signing.cpp:681
void PushReconstructedRecoveredSig(const CRecoveredSig &recoveredSig, const CQuorumCPtr &quorum)
Definition: quorums_signing.cpp:743
bool VerifyRecoveredSig(Consensus::LLMQType llmqType, int signedAtHeight, const uint256 &id, const uint256 &msgHash, const CBLSSignature &sig)
Definition: quorums_signing.cpp:931
void ProcessMessage(CNode *pnode, const std::string &strCommand, CDataStream &vRecv, CConnman &connman)
Definition: quorums_signing.cpp:474
void TruncateRecoveredSig(Consensus::LLMQType llmqType, const uint256 &id)
Definition: quorums_signing.cpp:313
void CollectPendingRecoveredSigsToVerify(size_t maxUniqueSessions, std::unordered_map< NodeId, std::list< CRecoveredSig >> &retSigShares, std::unordered_map< std::pair< Consensus::LLMQType, uint256 >, CQuorumCPtr, StaticSaltedHasher > &retQuorums)
Definition: quorums_signing.cpp:537
Definition: quorums_signing.h:64
void RegisterRecoveredSigsListener(CRecoveredSigsListener *l)
Definition: quorums_signing.cpp:771
Definition: dbwrapper.h:197
std::vector< CQuorumCPtr > GetActiveQuorumSet(Consensus::LLMQType llmqType, int signHeight)
Definition: univalue.h:20
CRecoveredSigsDb(CDBWrapper &_db)
Definition: quorums_signing.cpp:39
bool GetRecoveredSigForId(Consensus::LLMQType llmqType, const uint256 &id, CRecoveredSig &retRecSig)
Definition: quorums_signing.cpp:861
bool HasRecoveredSig(Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash)
Definition: quorums_signing.cpp:128
void ProcessMessageRecoveredSig(CNode *pfrom, const CRecoveredSig &recoveredSig, CConnman &connman)
Definition: quorums_signing.cpp:483
bool GetRecoveredSigById(Consensus::LLMQType llmqType, const uint256 &id, CRecoveredSig &ret)
Definition: quorums_signing.cpp:218
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:103
Definition: deterministicmns.h:26
bool AsyncSignIfMember(Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash, bool allowReSign=false)
Definition: quorums_signing.cpp:784
Definition: saltedhasher.h:64
bool ReadRecoveredSig(Consensus::LLMQType llmqType, const uint256 &id, CRecoveredSig &ret)
Definition: quorums_signing.cpp:190
bool HasRecoveredSigForHash(const uint256 &hash)
Definition: quorums_signing.cpp:172
virtual ~CRecoveredSigsListener()
Definition: quorums_signing.h:107
bool ProcessPendingRecoveredSigs(CConnman &connman)
Definition: quorums_signing.cpp:615
bool HasVotedOnId(Consensus::LLMQType llmqType, const uint256 &id)
Definition: quorums_signing.cpp:885
void UnregisterRecoveredSigsListener(CRecoveredSigsListener *l)
Definition: quorums_signing.cpp:777
bool HasRecoveredSig(Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash)
Definition: quorums_signing.cpp:846
bool GetVoteForId(Consensus::LLMQType llmqType, const uint256 &id, uint256 &msgHashRet)
Definition: quorums_signing.cpp:381
uint256 SerializeHash(const T &obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
Compute the 256-bit hash of an object's serialization.
Definition: hash.h:254
static const int SIGN_HEIGHT_OFFSET
Definition: quorums_signing.h:120
virtual void HandleNewRecoveredSig(const CRecoveredSig &recoveredSig)=0
std::unordered_map< NodeId, std::list< CRecoveredSig > > pendingRecoveredSigs
Definition: quorums_signing.h:128
unordered_lru_cache< uint256, bool, StaticSaltedHasher, 30000 > hasSigForHashCache
Definition: quorums_signing.h:72
CQuorumCPtr SelectQuorumForSigning(Consensus::LLMQType llmqType, const uint256 &selectionHash, int signHeight=-1, int signOffset=SIGN_HEIGHT_OFFSET)
Definition: quorums_signing.cpp:895
unordered_lru_cache< std::pair< Consensus::LLMQType, uint256 >, bool, StaticSaltedHasher, 30000 > hasSigForIdCache
Definition: quorums_signing.h:70
Definition: quorums_signing.h:112
Definition: bls.h:286
void ConvertInvalidTimeKeys()
Definition: quorums_signing.cpp:56
bool GetRecoveredSigForGetData(const uint256 &hash, CRecoveredSig &ret)
Definition: quorums_signing.cpp:462
bool GetRecoveredSigByHash(const uint256 &hash, CRecoveredSig &ret)
Definition: quorums_signing.cpp:207
Definition: quorums_signing.h:21
std::vector< CRecoveredSigsListener * > recoveredSigsListeners
Definition: quorums_signing.h:136
bool HasRecoveredSigForId(Consensus::LLMQType llmqType, const uint256 &id)
Definition: quorums_signing.cpp:134
void WriteVoteForId(Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash)
Definition: quorums_signing.cpp:387
void ProcessPendingReconstructedRecoveredSigs()
Definition: quorums_signing.cpp:603
std::unordered_map< uint256, std::pair< CRecoveredSig, CQuorumCPtr >, StaticSaltedHasher > pendingReconstructedRecoveredSigs
Definition: quorums_signing.h:129
static const int64_t DEFAULT_MAX_RECOVERED_SIGS_AGE
Definition: quorums_signing.h:115
void CleanupOldRecoveredSigs(int64_t maxAge)
Definition: quorums_signing.cpp:321
bool IsConflicting(Consensus::LLMQType llmqType, const uint256 &id, const uint256 &msgHash)
Definition: quorums_signing.cpp:869
void RemoveRecoveredSig(Consensus::LLMQType llmqType, const uint256 &id)
Definition: quorums_signing.cpp:303
bool HasRecoveredSigForId(Consensus::LLMQType llmqType, const uint256 &id)
Definition: quorums_signing.cpp:851
bool HasRecoveredSigForSession(const uint256 &signHash)
Definition: quorums_signing.cpp:856
bool AlreadyHave(const CInv &inv)
Definition: quorums_signing.cpp:447
bool HasRecoveredSigForSession(const uint256 &signHash)
Definition: quorums_signing.cpp:154
bool HasVotedOnId(Consensus::LLMQType llmqType, const uint256 &id)
Definition: quorums_signing.cpp:375
CSigningManager(CDBWrapper &llmqDb, bool fMemory)
Definition: quorums_signing.cpp:442
bool PreVerifyRecoveredSig(NodeId nodeId, const CRecoveredSig &recoveredSig, bool &retBan)
Definition: quorums_signing.cpp:513
Wrapped mutex: supports recursive locking, but no waiting TODO: We should move away from using the re...
Definition: sync.h:94
void TruncateRecoveredSig(Consensus::LLMQType llmqType, const uint256 &id)
Definition: quorums_signing.cpp:751
bool GetVoteForId(Consensus::LLMQType llmqType, const uint256 &id, uint256 &msgHashRet)
Definition: quorums_signing.cpp:890
void WriteRecoveredSig(const CRecoveredSig &recSig)
Definition: quorums_signing.cpp:223
unordered_lru_cache< uint256, bool, StaticSaltedHasher, 30000 > hasSigForSessionCache
Definition: quorums_signing.h:71