diff --git a/src/bench/bls.cpp b/src/bench/bls.cpp index b9fd3ac163f17..c22321da40d10 100644 --- a/src/bench/bls.cpp +++ b/src/bench/bls.cpp @@ -29,12 +29,12 @@ static void BuildTestVectors(size_t count, size_t invalidCount, secKeys[i].MakeNewKey(); pubKeys[i] = secKeys[i].GetPublicKey(); msgHashes[i] = GetRandHash(); - sigs[i] = secKeys[i].Sign(msgHashes[i]); + sigs[i] = secKeys[i].Sign(msgHashes[i], false); if (invalid[i]) { CBLSSecretKey s; s.MakeNewKey(); - sigs[i] = s.Sign(msgHashes[i]); + sigs[i] = s.Sign(msgHashes[i], false); } } } @@ -71,8 +71,8 @@ static void BLS_SignatureAggregate_Normal(benchmark::Bench& bench) CBLSSecretKey secKey1, secKey2; secKey1.MakeNewKey(); secKey2.MakeNewKey(); - CBLSSignature sig1 = secKey1.Sign(hash); - CBLSSignature sig2 = secKey2.Sign(hash); + CBLSSignature sig1 = secKey1.Sign(hash, false); + CBLSSignature sig2 = secKey2.Sign(hash, false); // Benchmark. bench.run([&] { @@ -89,7 +89,7 @@ static void BLS_Sign_Normal(benchmark::Bench& bench) // Benchmark. bench.minEpochIterations(100).run([&] { uint256 hash = GetRandHash(); - sig = secKey.Sign(hash); + sig = secKey.Sign(hash, false); }); } diff --git a/src/bls/bls.cpp b/src/bls/bls.cpp index 85a96c3e3e219..09f192cd67b52 100644 --- a/src/bls/bls.cpp +++ b/src/bls/bls.cpp @@ -117,11 +117,6 @@ CBLSPublicKey CBLSSecretKey::GetPublicKey() const return pubKey; } -CBLSSignature CBLSSecretKey::Sign(const uint256& hash) const -{ - return Sign(hash, bls::bls_legacy_scheme.load()); -} - CBLSSignature CBLSSecretKey::Sign(const uint256& hash, const bool specificLegacyScheme) const { if (!IsValid()) { diff --git a/src/bls/bls.h b/src/bls/bls.h index b1b0eb5f75764..0e3671b5a0e61 100644 --- a/src/bls/bls.h +++ b/src/bls/bls.h @@ -57,10 +57,6 @@ class CBLSWrapper static constexpr size_t SerSize = _SerSize; explicit CBLSWrapper() = default; - explicit CBLSWrapper(Span vecBytes) : CBLSWrapper() - { - SetByteVector(vecBytes, bls::bls_legacy_scheme.load()); - } CBLSWrapper(const CBLSWrapper& ref) = default; CBLSWrapper& operator=(const CBLSWrapper& ref) = default; @@ -131,11 +127,6 @@ class CBLSWrapper return impl.Serialize(specificLegacyScheme); } - std::vector ToByteVector() const - { - return ToByteVector(bls::bls_legacy_scheme.load()); - } - const uint256& GetHash() const { if (cachedHash.IsNull()) { @@ -215,11 +206,6 @@ class CBLSWrapper return true; } - inline bool CheckMalleable(Span vecBytes) const - { - return CheckMalleable(vecBytes, bls::bls_legacy_scheme.load()); - } - inline std::string ToString(const bool specificLegacyScheme) const { std::vector buf = ToByteVector(specificLegacyScheme); @@ -263,6 +249,7 @@ class CBLSId : public CBLSWrapper explicit CBLSId(const uint256& nHash); }; +//! CBLSSecretKey is invariant to BLS scheme for Creation / Serialization / Deserialization class CBLSSecretKey : public CBLSWrapper { public: @@ -272,6 +259,11 @@ class CBLSSecretKey : public CBLSWrapper vecBytes) + { + // The second param here is not 'is_legacy', but `modOrder` + SetByteVector(vecBytes, false); + } CBLSSecretKey(const CBLSSecretKey&) = default; CBLSSecretKey& operator=(const CBLSSecretKey&) = default; @@ -279,12 +271,14 @@ class CBLSSecretKey : public CBLSWrapper sks); #ifndef BUILD_BITCOIN_INTERNAL + //! MakeNewKey() is invariant to BLS scheme void MakeNewKey(); #endif + //! SecretKeyShare() is invariant to BLS scheme bool SecretKeyShare(Span msk, const CBLSId& id); + //! GetPublicKey() is invariant to BLS scheme [[nodiscard]] CBLSPublicKey GetPublicKey() const; - [[nodiscard]] CBLSSignature Sign(const uint256& hash) const; [[nodiscard]] CBLSSignature Sign(const uint256& hash, const bool specificLegacyScheme) const; }; @@ -338,6 +332,10 @@ class CBLSSignature : public CBLSWrapper bytes, bool is_serialized_legacy) + { + SetByteVector(bytes, is_serialized_legacy); + } CBLSSignature(const CBLSSignature&) = default; CBLSSignature& operator=(const CBLSSignature&) = default; diff --git a/src/bls/bls_ies.cpp b/src/bls/bls_ies.cpp index 1068e078fc9b2..e6282c02853a5 100644 --- a/src/bls/bls_ies.cpp +++ b/src/bls/bls_ies.cpp @@ -9,8 +9,7 @@ #include -template -static bool EncryptBlob(const void* in, size_t inSize, Out& out, const void* symKey, const void* iv) +static bool EncryptBlob(const void* in, size_t inSize, std::vector& out, const void* symKey, const void* iv) { out.resize(inSize); @@ -38,24 +37,6 @@ uint256 CBLSIESEncryptedBlob::GetIV(size_t idx) const return iv; } -bool CBLSIESEncryptedBlob::Encrypt(size_t idx, const CBLSPublicKey& peerPubKey, const void* plainTextData, size_t dataSize) -{ - CBLSSecretKey ephemeralSecretKey; - ephemeralSecretKey.MakeNewKey(); - ephemeralPubKey = ephemeralSecretKey.GetPublicKey(); - - CBLSPublicKey pk; - if (!pk.DHKeyExchange(ephemeralSecretKey, peerPubKey)) { - return false; - } - - std::vector symKey = pk.ToByteVector(); - symKey.resize(32); - - uint256 iv = GetIV(idx); - return EncryptBlob(plainTextData, dataSize, data, symKey.data(), iv.begin()); -} - bool CBLSIESEncryptedBlob::Decrypt(size_t idx, const CBLSSecretKey& secretKey, CDataStream& decryptedDataRet) const { CBLSPublicKey pk; @@ -63,7 +44,7 @@ bool CBLSIESEncryptedBlob::Decrypt(size_t idx, const CBLSSecretKey& secretKey, C return false; } - std::vector symKey = pk.ToByteVector(); + std::vector symKey = pk.ToByteVector(false); symKey.resize(32); uint256 iv = GetIV(idx); @@ -75,24 +56,6 @@ bool CBLSIESEncryptedBlob::IsValid() const return ephemeralPubKey.IsValid() && !data.empty() && !ivSeed.IsNull(); } - -bool CBLSIESMultiRecipientBlobs::Encrypt(const std::vector& recipients, const BlobVector& _blobs) -{ - if (recipients.size() != _blobs.size()) { - return false; - } - - InitEncrypt(_blobs.size()); - - for (size_t i = 0; i < _blobs.size(); i++) { - if (!Encrypt(i, recipients[i], _blobs[i])) { - return false; - } - } - - return true; -} - void CBLSIESMultiRecipientBlobs::InitEncrypt(size_t count) { ephemeralSecretKey.MakeNewKey(); @@ -117,7 +80,7 @@ bool CBLSIESMultiRecipientBlobs::Encrypt(size_t idx, const CBLSPublicKey& recipi return false; } - std::vector symKey = pk.ToByteVector(); + std::vector symKey = pk.ToByteVector(false); symKey.resize(32); return EncryptBlob(blob.data(), blob.size(), blobs[idx], symKey.data(), ivVector[idx].begin()); @@ -134,7 +97,7 @@ bool CBLSIESMultiRecipientBlobs::Decrypt(size_t idx, const CBLSSecretKey& sk, Bl return false; } - std::vector symKey = pk.ToByteVector(); + std::vector symKey = pk.ToByteVector(false); symKey.resize(32); uint256 iv = ivSeed; diff --git a/src/bls/bls_ies.h b/src/bls/bls_ies.h index 002d41a86bdf8..72633e1aa5086 100644 --- a/src/bls/bls_ies.h +++ b/src/bls/bls_ies.h @@ -8,6 +8,11 @@ #include #include +/** + * All objects in this module working from assumption that basic scheme is + * available on all masternodes. Serialization of public key for Encrypt and + * Decrypt by bls_ies.h done using Basic Scheme. + */ class CBLSIESEncryptedBlob { public: @@ -22,7 +27,6 @@ class CBLSIESEncryptedBlob READWRITE(obj.ephemeralPubKey, obj.ivSeed, obj.data); } - bool Encrypt(size_t idx, const CBLSPublicKey& peerPubKey, const void* data, size_t dataSize); bool Decrypt(size_t idx, const CBLSSecretKey& secretKey, CDataStream& decryptedDataRet) const; bool IsValid() const; }; @@ -40,17 +44,6 @@ class CBLSIESEncryptedObject : public CBLSIESEncryptedBlob data = dataIn; } - bool Encrypt(size_t idx, const CBLSPublicKey& peerPubKey, const Object& obj, int nVersion) - { - try { - CDataStream ds(SER_NETWORK, nVersion); - ds << obj; - return CBLSIESEncryptedBlob::Encrypt(idx, peerPubKey, ds.data(), ds.size()); - } catch (const std::exception&) { - return false; - } - } - bool Decrypt(size_t idx, const CBLSSecretKey& secretKey, Object& objRet, int nVersion) const { CDataStream ds(SER_NETWORK, nVersion); @@ -80,8 +73,6 @@ class CBLSIESMultiRecipientBlobs CBLSSecretKey ephemeralSecretKey; std::vector ivVector; - bool Encrypt(const std::vector& recipients, const BlobVector& _blobs); - void InitEncrypt(size_t count); bool Encrypt(size_t idx, const CBLSPublicKey& recipient, const Blob& blob); bool Decrypt(size_t idx, const CBLSSecretKey& sk, Blob& blobRet) const; @@ -96,28 +87,6 @@ template class CBLSIESMultiRecipientObjects : public CBLSIESMultiRecipientBlobs { public: - using ObjectVector = std::vector; - - bool Encrypt(const std::vector& recipients, const ObjectVector& _objects, int nVersion) - { - BlobVector blobs; - blobs.resize(_objects.size()); - - try { - CDataStream ds(SER_NETWORK, nVersion); - for (size_t i = 0; i < _objects.size(); i++) { - ds.clear(); - - ds << _objects[i]; - blobs[i].assign(UCharCast(ds.data()), UCharCast(ds.data() + ds.size())); - } - } catch (const std::exception&) { - return false; - } - - return CBLSIESMultiRecipientBlobs::Encrypt(recipients, blobs); - } - bool Encrypt(size_t idx, const CBLSPublicKey& recipient, const Object& obj, int nVersion) { CDataStream ds(SER_NETWORK, nVersion); diff --git a/src/bls/bls_worker.cpp b/src/bls/bls_worker.cpp index f5197e8fa53af..4767d02ed394a 100644 --- a/src/bls/bls_worker.cpp +++ b/src/bls/bls_worker.cpp @@ -762,7 +762,7 @@ bool CBLSWorker::VerifyVerificationVectors(Span vvecs) void CBLSWorker::AsyncSign(const CBLSSecretKey& secKey, const uint256& msgHash, const CBLSWorker::SignDoneCallback& doneCallback) { workerPool.push([secKey, msgHash, doneCallback](int threadId) { - doneCallback(secKey.Sign(msgHash)); + doneCallback(secKey.Sign(msgHash, bls::bls_legacy_scheme.load())); }); } diff --git a/src/coinjoin/coinjoin.cpp b/src/coinjoin/coinjoin.cpp index 74fc644a70911..976633bb77175 100644 --- a/src/coinjoin/coinjoin.cpp +++ b/src/coinjoin/coinjoin.cpp @@ -62,7 +62,7 @@ bool CCoinJoinQueue::Sign(const CActiveMasternodeManager& mn_activeman) bool CCoinJoinQueue::CheckSignature(const CBLSPublicKey& blsPubKey) const { - if (!CBLSSignature(Span{vchSig}).VerifyInsecure(blsPubKey, GetSignatureHash(), false)) { + if (!CBLSSignature(Span{vchSig}, false).VerifyInsecure(blsPubKey, GetSignatureHash(), false)) { LogPrint(BCLog::COINJOIN, "CCoinJoinQueue::CheckSignature -- VerifyInsecure() failed\n"); return false; } @@ -101,7 +101,7 @@ bool CCoinJoinBroadcastTx::Sign(const CActiveMasternodeManager& mn_activeman) bool CCoinJoinBroadcastTx::CheckSignature(const CBLSPublicKey& blsPubKey) const { - if (!CBLSSignature(Span{vchSig}).VerifyInsecure(blsPubKey, GetSignatureHash(), false)) { + if (!CBLSSignature(Span{vchSig}, false).VerifyInsecure(blsPubKey, GetSignatureHash(), false)) { LogPrint(BCLog::COINJOIN, "CCoinJoinBroadcastTx::CheckSignature -- VerifyInsecure() failed\n"); return false; } diff --git a/src/evo/assetlocktx.h b/src/evo/assetlocktx.h index 531183fd0a075..d63ef4092e32c 100644 --- a/src/evo/assetlocktx.h +++ b/src/evo/assetlocktx.h @@ -5,7 +5,7 @@ #ifndef BITCOIN_EVO_ASSETLOCKTX_H #define BITCOIN_EVO_ASSETLOCKTX_H -#include +#include #include #include #include diff --git a/src/evo/mnauth.cpp b/src/evo/mnauth.cpp index 36c6c17524c40..7eb2e18ce5439 100644 --- a/src/evo/mnauth.cpp +++ b/src/evo/mnauth.cpp @@ -51,7 +51,8 @@ void CMNAuth::PushMNAUTH(CNode& peer, CConnman& connman, const CActiveMasternode mnauth.proRegTxHash = mn_activeman.GetProTxHash(); - mnauth.sig = mn_activeman.Sign(signHash); + // all clients uses basic BLS + mnauth.sig = mn_activeman.Sign(signHash, false); LogPrint(BCLog::NET_NETCONN, "CMNAuth::%s -- Sending MNAUTH, peer=%d\n", __func__, peer.GetId()); connman.PushMessage(&peer, CNetMsgMaker(peer.GetCommonVersion()).Make(NetMsgType::MNAUTH, mnauth)); @@ -86,7 +87,8 @@ PeerMsgRet CMNAuth::ProcessMessage(CNode& peer, ServiceFlags node_services, CCon } if (!mnauth.sig.IsValid()) { - LogPrint(BCLog::NET_NETCONN, "CMNAuth::ProcessMessage -- invalid mnauth for protx=%s with sig=%s\n", mnauth.proRegTxHash.ToString(), mnauth.sig.ToString()); + LogPrint(BCLog::NET_NETCONN, "CMNAuth::ProcessMessage -- invalid mnauth for protx=%s with sig=%s\n", + mnauth.proRegTxHash.ToString(), mnauth.sig.ToString(false)); return tl::unexpected{MisbehavingError{100, "invalid mnauth signature"}}; } @@ -112,7 +114,7 @@ PeerMsgRet CMNAuth::ProcessMessage(CNode& peer, ServiceFlags node_services, CCon } LogPrint(BCLog::NET_NETCONN, "CMNAuth::%s -- constructed signHash for nVersion %d, peer=%d\n", __func__, peer.nVersion, peer.GetId()); - if (!mnauth.sig.VerifyInsecure(dmn->pdmnState->pubKeyOperator.Get(), signHash)) { + if (!mnauth.sig.VerifyInsecure(dmn->pdmnState->pubKeyOperator.Get(), signHash, false)) { // Same as above, MN seems to not know its fate yet, so give it a chance to update. If this is a // malicious node (DoSing us), it'll get banned soon. return tl::unexpected{MisbehavingError{10, "mnauth signature verification failed"}}; diff --git a/src/evo/providertx.h b/src/evo/providertx.h index 5734ead9449c3..73ec27ba61f68 100644 --- a/src/evo/providertx.h +++ b/src/evo/providertx.h @@ -112,7 +112,7 @@ class CProRegTx return obj; } - bool IsTriviallyValid(bool is_bls_legacy_scheme, TxValidationState& state) const; + bool IsTriviallyValid(bool is_basic_scheme_active, TxValidationState& state) const; }; class CProUpServTx @@ -192,7 +192,7 @@ class CProUpServTx return obj; } - bool IsTriviallyValid(bool is_bls_legacy_scheme, TxValidationState& state) const; + bool IsTriviallyValid(bool is_basic_scheme_active, TxValidationState& state) const; }; class CProUpRegTx @@ -257,7 +257,7 @@ class CProUpRegTx return obj; } - bool IsTriviallyValid(bool is_bls_legacy_scheme, TxValidationState& state) const; + bool IsTriviallyValid(bool is_basic_scheme_active, TxValidationState& state) const; }; class CProUpRevTx @@ -321,7 +321,7 @@ class CProUpRevTx return obj; } - bool IsTriviallyValid(bool is_bls_legacy_scheme, TxValidationState& state) const; + bool IsTriviallyValid(bool is_basic_scheme_active, TxValidationState& state) const; }; template diff --git a/src/evo/specialtxman.cpp b/src/evo/specialtxman.cpp index 969efa2703055..1e1ebd87e48a7 100644 --- a/src/evo/specialtxman.cpp +++ b/src/evo/specialtxman.cpp @@ -206,7 +206,7 @@ bool CSpecialTxProcessor::ProcessSpecialTxsInBlock(const CBlock& block, const CB nTimeMnehf += nTime7 - nTime6; LogPrint(BCLog::BENCHMARK, " - m_mnhfman: %.2fms [%.2fs]\n", 0.001 * (nTime7 - nTime6), nTimeMnehf * 0.000001); - if (Params().GetConsensus().V19Height == pindex->nHeight + 1) { + if (DeploymentActiveAfter(pindex, m_consensus_params, Consensus::DEPLOYMENT_V19) && bls::bls_legacy_scheme.load()) { // NOTE: The block next to the activation is the one that is using new rules. // V19 activated just activated, so we must switch to the new rules here. bls::bls_legacy_scheme.store(false); @@ -227,7 +227,7 @@ bool CSpecialTxProcessor::UndoSpecialTxsInBlock(const CBlock& block, const CBloc auto bls_legacy_scheme = bls::bls_legacy_scheme.load(); try { - if (Params().GetConsensus().V19Height == pindex->nHeight + 1) { + if (!DeploymentActiveAt(*pindex, m_consensus_params, Consensus::DEPLOYMENT_V19) && !bls_legacy_scheme) { // NOTE: The block next to the activation is the one that is using new rules. // Removing the activation block here, so we must switch back to the old rules. bls::bls_legacy_scheme.store(true); diff --git a/src/llmq/dkgsession.cpp b/src/llmq/dkgsession.cpp index b63ebf45a4e0f..6f0b2a903dae1 100644 --- a/src/llmq/dkgsession.cpp +++ b/src/llmq/dkgsession.cpp @@ -84,7 +84,8 @@ CDKGSession::CDKGSession(const CBlockIndex* pQuorumBaseBlockIndex, const Consens m_mn_metaman(mn_metaman), m_mn_activeman(mn_activeman), m_sporkman(sporkman), - m_quorum_base_block_index{pQuorumBaseBlockIndex} + m_quorum_base_block_index{pQuorumBaseBlockIndex}, + m_use_legacy_bls{!DeploymentActiveAfter(m_quorum_base_block_index, Params().GetConsensus(), Consensus::DEPLOYMENT_V19)} { } @@ -215,7 +216,7 @@ void CDKGSession::SendContributions(CDKGPendingMessages& pendingMessages, PeerMa logger.Batch("encrypted contributions. time=%d", t1.count()); - qc.sig = m_mn_activeman->Sign(qc.GetSignHash()); + qc.sig = m_mn_activeman->Sign(qc.GetSignHash(), m_use_legacy_bls); logger.Flush(); @@ -527,7 +528,7 @@ void CDKGSession::SendComplaint(CDKGPendingMessages& pendingMessages, PeerManage logger.Batch("sending complaint. badCount=%d, complaintCount=%d", badCount, complaintCount); - qc.sig = m_mn_activeman->Sign(qc.GetSignHash()); + qc.sig = m_mn_activeman->Sign(qc.GetSignHash(), m_use_legacy_bls); logger.Flush(); @@ -721,7 +722,7 @@ void CDKGSession::SendJustification(CDKGPendingMessages& pendingMessages, PeerMa return; } - qj.sig = m_mn_activeman->Sign(qj.GetSignHash()); + qj.sig = m_mn_activeman->Sign(qj.GetSignHash(), m_use_legacy_bls); logger.Flush(); @@ -1011,19 +1012,17 @@ void CDKGSession::SendCommitment(CDKGPendingMessages& pendingMessages, PeerManag (*commitmentHash.begin())++; } - qc.sig = m_mn_activeman->Sign(commitmentHash); - qc.quorumSig = skShare.Sign(commitmentHash); + qc.sig = m_mn_activeman->Sign(commitmentHash, m_use_legacy_bls); + qc.quorumSig = skShare.Sign(commitmentHash, m_use_legacy_bls); if (lieType == 3) { - const bool is_bls_legacy = bls::bls_legacy_scheme.load(); - std::vector buf = qc.sig.ToByteVector(is_bls_legacy); + std::vector buf = qc.sig.ToByteVector(m_use_legacy_bls); buf[5]++; - qc.sig.SetByteVector(buf, is_bls_legacy); + qc.sig.SetByteVector(buf, m_use_legacy_bls); } else if (lieType == 4) { - const bool is_bls_legacy = bls::bls_legacy_scheme.load(); - std::vector buf = qc.quorumSig.ToByteVector(is_bls_legacy); + std::vector buf = qc.quorumSig.ToByteVector(m_use_legacy_bls); buf[5]++; - qc.quorumSig.SetByteVector(buf, is_bls_legacy); + qc.quorumSig.SetByteVector(buf, m_use_legacy_bls); } t3.stop(); diff --git a/src/llmq/dkgsession.h b/src/llmq/dkgsession.h index 82a1263b923e6..1482e35e08033 100644 --- a/src/llmq/dkgsession.h +++ b/src/llmq/dkgsession.h @@ -288,6 +288,7 @@ class CDKGSession const CSporkManager& m_sporkman; const CBlockIndex* const m_quorum_base_block_index; + bool m_use_legacy_bls; int quorumIndex{0}; private: diff --git a/src/llmq/dkgsessionmgr.cpp b/src/llmq/dkgsessionmgr.cpp index d6fb0715c1014..d0842c0bcd7ae 100644 --- a/src/llmq/dkgsessionmgr.cpp +++ b/src/llmq/dkgsessionmgr.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include diff --git a/src/llmq/dkgsessionmgr.h b/src/llmq/dkgsessionmgr.h index eaa5dc79deae3..fd984247023b9 100644 --- a/src/llmq/dkgsessionmgr.h +++ b/src/llmq/dkgsessionmgr.h @@ -6,7 +6,6 @@ #define BITCOIN_LLMQ_DKGSESSIONMGR_H #include -#include #include #include #include @@ -14,6 +13,11 @@ #include #include +template +class CBLSIESMultiRecipientObjects; +template +class CBLSIESEncryptedObject; + class CActiveMasternodeManager; class CBlockIndex; class CChainState; diff --git a/src/llmq/signing_shares.cpp b/src/llmq/signing_shares.cpp index 6bcc0e8996524..489ca42d28861 100644 --- a/src/llmq/signing_shares.cpp +++ b/src/llmq/signing_shares.cpp @@ -1541,7 +1541,7 @@ std::optional CSigSharesManager::CreateSigShare(const CQuorumCPtr& qu CSigShare sigShare(quorum->params.type, quorum->qc->quorumHash, id, msgHash, uint16_t(memberIdx), {}); uint256 signHash = sigShare.buildSignHash(); - sigShare.sigShare.Set(skShare.Sign(signHash), bls::bls_legacy_scheme.load()); + sigShare.sigShare.Set(skShare.Sign(signHash, bls::bls_legacy_scheme.load()), bls::bls_legacy_scheme.load()); if (!sigShare.sigShare.Get().IsValid()) { LogPrintf("CSigSharesManager::%s -- failed to sign sigShare. signHash=%s, id=%s, msgHash=%s, time=%s\n", __func__, signHash.ToString(), sigShare.getId().ToString(), sigShare.getMsgHash().ToString(), t.count()); diff --git a/src/masternode/node.cpp b/src/masternode/node.cpp index 0a0b51deef7d8..ecf1d8f75a0fa 100644 --- a/src/masternode/node.cpp +++ b/src/masternode/node.cpp @@ -174,7 +174,6 @@ void CActiveMasternodeManager::InitInternal(const CBlockIndex* pindex) m_info.proTxHash = dmn->proTxHash; m_info.outpoint = dmn->collateralOutpoint; - m_info.legacy = dmn->pdmnState->nVersion == CProRegTx::LEGACY_BLS_VERSION; m_state = MasternodeState::READY; } @@ -276,12 +275,6 @@ template bool CActiveMasternodeManager::Decrypt(const CBLSIESEncryptedObject& obj, size_t idx, CBLSSecretKey& ret_obj, int version) const; -[[nodiscard]] CBLSSignature CActiveMasternodeManager::Sign(const uint256& hash) const -{ - AssertLockNotHeld(cs); - return WITH_READ_LOCK(cs, return m_info.blsKeyOperator.Sign(hash)); -} - [[nodiscard]] CBLSSignature CActiveMasternodeManager::Sign(const uint256& hash, const bool is_legacy) const { AssertLockNotHeld(cs); diff --git a/src/masternode/node.h b/src/masternode/node.h index 713161ee065eb..f1a54ed2cc705 100644 --- a/src/masternode/node.h +++ b/src/masternode/node.h @@ -22,7 +22,6 @@ struct CActiveMasternodeInfo { uint256 proTxHash; COutPoint outpoint; CService service; - bool legacy{true}; CActiveMasternodeInfo(const CBLSSecretKey& blsKeyOperator, const CBLSPublicKey& blsPubKeyOperator) : blsKeyOperator(blsKeyOperator), blsPubKeyOperator(blsPubKeyOperator) {}; @@ -66,7 +65,6 @@ class CActiveMasternodeManager final : public CValidationInterface template