Skip to content

Commit c4cf446

Browse files
Merge pull request #5250 from PastaPastaPasta/v19/bump-rc.6
[v19.x] backport: backports and rc.6 bump
2 parents 4f97133 + cdb9d68 commit c4cf446

37 files changed

+515
-191
lines changed

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ AC_PREREQ([2.69])
22
define(_CLIENT_VERSION_MAJOR, 19)
33
define(_CLIENT_VERSION_MINOR, 0)
44
define(_CLIENT_VERSION_BUILD, 0)
5-
define(_CLIENT_VERSION_RC, 5)
5+
define(_CLIENT_VERSION_RC, 6)
66
define(_CLIENT_VERSION_IS_RELEASE, false)
77
define(_COPYRIGHT_YEAR, 2023)
88
define(_COPYRIGHT_HOLDERS,[The %s developers])

src/bls/bls.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -288,19 +288,24 @@ void CBLSSignature::SubInsecure(const CBLSSignature& o)
288288
cachedHash.SetNull();
289289
}
290290

291-
bool CBLSSignature::VerifyInsecure(const CBLSPublicKey& pubKey, const uint256& hash) const
291+
bool CBLSSignature::VerifyInsecure(const CBLSPublicKey& pubKey, const uint256& hash, const bool specificLegacyScheme) const
292292
{
293293
if (!IsValid() || !pubKey.IsValid()) {
294294
return false;
295295
}
296296

297297
try {
298-
return Scheme(bls::bls_legacy_scheme.load())->Verify(pubKey.impl, bls::Bytes(hash.begin(), hash.size()), impl);
298+
return Scheme(specificLegacyScheme)->Verify(pubKey.impl, bls::Bytes(hash.begin(), hash.size()), impl);
299299
} catch (...) {
300300
return false;
301301
}
302302
}
303303

304+
bool CBLSSignature::VerifyInsecure(const CBLSPublicKey& pubKey, const uint256& hash) const
305+
{
306+
return VerifyInsecure(pubKey, hash, bls::bls_legacy_scheme.load());
307+
}
308+
304309
bool CBLSSignature::VerifyInsecureAggregated(const std::vector<CBLSPublicKey>& pubKeys, const std::vector<uint256>& hashes) const
305310
{
306311
if (!IsValid()) {

src/bls/bls.h

+12-2
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,17 @@ class CBLSWrapper
190190
SetByteVector(vecBytes, specificLegacyScheme);
191191

192192
if (checkMalleable && !CheckMalleable(vecBytes, specificLegacyScheme)) {
193-
throw std::ios_base::failure("malleable BLS object");
193+
// If CheckMalleable failed with specificLegacyScheme, we need to try again with the opposite scheme.
194+
// Probably we received the BLS object sent with legacy scheme, but in the meanwhile the fork activated.
195+
SetByteVector(vecBytes, !specificLegacyScheme);
196+
if (!CheckMalleable(vecBytes, !specificLegacyScheme)) {
197+
// Both attempts failed
198+
throw std::ios_base::failure("malleable BLS object");
199+
} else {
200+
// Indeed the received vecBytes was in opposite scheme. But we can't keep it (mixing with the new scheme will lead to undefined behavior)
201+
// Therefore, resetting current object (basically marking it as invalid).
202+
Reset();
203+
}
194204
}
195205
}
196206

@@ -358,7 +368,7 @@ class CBLSSignature : public CBLSWrapper<bls::G2Element, BLS_CURVE_SIG_SIZE, CBL
358368
static CBLSSignature AggregateSecure(const std::vector<CBLSSignature>& sigs, const std::vector<CBLSPublicKey>& pks, const uint256& hash);
359369

360370
void SubInsecure(const CBLSSignature& o);
361-
371+
[[nodiscard]] bool VerifyInsecure(const CBLSPublicKey& pubKey, const uint256& hash, const bool specificLegacyScheme) const;
362372
[[nodiscard]] bool VerifyInsecure(const CBLSPublicKey& pubKey, const uint256& hash) const;
363373
[[nodiscard]] bool VerifyInsecureAggregated(const std::vector<CBLSPublicKey>& pubKeys, const std::vector<uint256>& hashes) const;
364374

src/chainparams.cpp

+21-20
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static CBlock FindDevNetGenesisBlock(const CBlock &prevBlock, const CAmount& rew
107107

108108
void CChainParams::AddLLMQ(Consensus::LLMQType llmqType)
109109
{
110-
assert(!HasLLMQ(llmqType));
110+
assert(!GetLLMQ(llmqType).has_value());
111111
for (const auto& llmq_param : Consensus::available_llmqs) {
112112
if (llmq_param.type == llmqType) {
113113
consensus.llmqs.push_back(llmq_param);
@@ -118,25 +118,14 @@ void CChainParams::AddLLMQ(Consensus::LLMQType llmqType)
118118
assert(false);
119119
}
120120

121-
const Consensus::LLMQParams& CChainParams::GetLLMQ(Consensus::LLMQType llmqType) const
121+
std::optional<Consensus::LLMQParams> CChainParams::GetLLMQ(Consensus::LLMQType llmqType) const
122122
{
123123
for (const auto& llmq_param : consensus.llmqs) {
124124
if (llmq_param.type == llmqType) {
125-
return llmq_param;
125+
return std::make_optional(llmq_param);
126126
}
127127
}
128-
error("CChainParams::%s: unknown LLMQ type %d", __func__, static_cast<uint8_t>(llmqType));
129-
assert(false);
130-
}
131-
132-
bool CChainParams::HasLLMQ(Consensus::LLMQType llmqType) const
133-
{
134-
for (const auto& llmq_param : consensus.llmqs) {
135-
if (llmq_param.type == llmqType) {
136-
return true;
137-
}
138-
}
139-
return false;
128+
return std::nullopt;
140129
}
141130

142131
/**
@@ -486,7 +475,7 @@ class CTestNetParams : public CChainParams {
486475

487476
// Deployment of Deployment of Basic BLS, AssetLocks, EHF
488477
consensus.vDeployments[Consensus::DEPLOYMENT_V19].bit = 8;
489-
consensus.vDeployments[Consensus::DEPLOYMENT_V19].nStartTime = 1678060800; // Tue, March 06, 2023 0:00:00
478+
consensus.vDeployments[Consensus::DEPLOYMENT_V19].nStartTime = 1678838400; // Wed, March 15, 2023 0:00:00
490479
consensus.vDeployments[Consensus::DEPLOYMENT_V19].nTimeout = 999999999999ULL;
491480
consensus.vDeployments[Consensus::DEPLOYMENT_V19].nWindowSize = 100;
492481
consensus.vDeployments[Consensus::DEPLOYMENT_V19].nThresholdStart = 80; // 80% of 100
@@ -1279,7 +1268,10 @@ void CDevNetParams::UpdateDevnetLLMQChainLocksFromArgs(const ArgsManager& args)
12791268
{
12801269
if (!args.IsArgSet("-llmqchainlocks")) return;
12811270

1282-
std::string strLLMQType = gArgs.GetArg("-llmqchainlocks", std::string(GetLLMQ(consensus.llmqTypeChainLocks).name));
1271+
const auto& llmq_params_opt = GetLLMQ(consensus.llmqTypeChainLocks);
1272+
assert(llmq_params_opt.has_value());
1273+
1274+
std::string strLLMQType = gArgs.GetArg("-llmqchainlocks", std::string(llmq_params_opt->name));
12831275

12841276
Consensus::LLMQType llmqType = Consensus::LLMQType::LLMQ_NONE;
12851277
for (const auto& params : consensus.llmqs) {
@@ -1301,7 +1293,10 @@ void CDevNetParams::UpdateDevnetLLMQInstantSendFromArgs(const ArgsManager& args)
13011293
{
13021294
if (!args.IsArgSet("-llmqinstantsend")) return;
13031295

1304-
std::string strLLMQType = gArgs.GetArg("-llmqinstantsend", std::string(GetLLMQ(consensus.llmqTypeInstantSend).name));
1296+
const auto& llmq_params_opt = GetLLMQ(consensus.llmqTypeInstantSend);
1297+
assert(llmq_params_opt.has_value());
1298+
1299+
std::string strLLMQType = gArgs.GetArg("-llmqinstantsend", std::string(llmq_params_opt->name));
13051300

13061301
Consensus::LLMQType llmqType = Consensus::LLMQType::LLMQ_NONE;
13071302
for (const auto& params : consensus.llmqs) {
@@ -1323,7 +1318,10 @@ void CDevNetParams::UpdateDevnetLLMQInstantSendDIP0024FromArgs(const ArgsManager
13231318
{
13241319
if (!args.IsArgSet("-llmqinstantsenddip0024")) return;
13251320

1326-
std::string strLLMQType = gArgs.GetArg("-llmqinstantsenddip0024", std::string(GetLLMQ(consensus.llmqTypeDIP0024InstantSend).name));
1321+
const auto& llmq_params_opt = GetLLMQ(consensus.llmqTypeDIP0024InstantSend);
1322+
assert(llmq_params_opt.has_value());
1323+
1324+
std::string strLLMQType = gArgs.GetArg("-llmqinstantsenddip0024", std::string(llmq_params_opt->name));
13271325

13281326
Consensus::LLMQType llmqType = Consensus::LLMQType::LLMQ_NONE;
13291327
for (const auto& params : consensus.llmqs) {
@@ -1345,7 +1343,10 @@ void CDevNetParams::UpdateDevnetLLMQPlatformFromArgs(const ArgsManager& args)
13451343
{
13461344
if (!args.IsArgSet("-llmqplatform")) return;
13471345

1348-
std::string strLLMQType = gArgs.GetArg("-llmqplatform", std::string(GetLLMQ(consensus.llmqTypePlatform).name));
1346+
const auto& llmq_params_opt = GetLLMQ(consensus.llmqTypePlatform);
1347+
assert(llmq_params_opt.has_value());
1348+
1349+
std::string strLLMQType = gArgs.GetArg("-llmqplatform", std::string(llmq_params_opt->name));
13491350

13501351
Consensus::LLMQType llmqType = Consensus::LLMQType::LLMQ_NONE;
13511352
for (const auto& params : consensus.llmqs) {

src/chainparams.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ class CChainParams
112112
const std::vector<std::string>& SporkAddresses() const { return vSporkAddresses; }
113113
int MinSporkKeys() const { return nMinSporkKeys; }
114114
bool BIP9CheckMasternodesUpgraded() const { return fBIP9CheckMasternodesUpgraded; }
115-
const Consensus::LLMQParams& GetLLMQ(Consensus::LLMQType llmqType) const;
116-
bool HasLLMQ(Consensus::LLMQType llmqType) const;
115+
std::optional<Consensus::LLMQParams> GetLLMQ(Consensus::LLMQType llmqType) const;
117116

118117
protected:
119118
CChainParams() {}

src/evo/cbtx.cpp

+12-5
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ auto CachedGetQcHashesQcIndexedHashes(const CBlockIndex* pindexPrev, const llmq:
189189
qcIndexedHashes_cached.clear();
190190

191191
for (const auto& [llmqType, vecBlockIndexes] : quorums) {
192-
bool rotation_enabled = llmq::utils::IsQuorumRotationEnabled(llmqType, pindexPrev);
192+
const auto& llmq_params_opt = llmq::GetLLMQParams(llmqType);
193+
assert(llmq_params_opt.has_value());
194+
bool rotation_enabled = llmq::utils::IsQuorumRotationEnabled(llmq_params_opt.value(), pindexPrev);
193195
auto& vec_hashes = qcHashes_cached[llmqType];
194196
vec_hashes.reserve(vecBlockIndexes.size());
195197
auto& map_indexed_hashes = qcIndexedHashes_cached[llmqType];
@@ -253,12 +255,16 @@ bool CalcCbTxMerkleRootQuorums(const CBlock& block, const CBlockIndex* pindexPre
253255
// having null commitments is ok but we don't use them here, move to the next tx
254256
continue;
255257
}
258+
const auto& llmq_params_opt = llmq::GetLLMQParams(qc.commitment.llmqType);
259+
if (!llmq_params_opt.has_value()) {
260+
return state.Invalid(ValidationInvalidReason::CONSENSUS, false, REJECT_INVALID, "bad-qc-commitment-type-calc-cbtx-quorummerkleroot");
261+
}
262+
const auto& llmq_params = llmq_params_opt.value();
256263
auto qcHash = ::SerializeHash(qc.commitment);
257-
if (llmq::utils::IsQuorumRotationEnabled(qc.commitment.llmqType, pindexPrev)) {
264+
if (llmq::utils::IsQuorumRotationEnabled(llmq_params, pindexPrev)) {
258265
auto& map_indexed_hashes = qcIndexedHashes[qc.commitment.llmqType];
259266
map_indexed_hashes[qc.commitment.quorumIndex] = qcHash;
260267
} else {
261-
const auto& llmq_params = llmq::GetLLMQParams(qc.commitment.llmqType);
262268
auto& vec_hashes = qcHashes[llmq_params.type];
263269
if (vec_hashes.size() == size_t(llmq_params.signingActiveQuorumCount)) {
264270
// we pop the last entry, which is actually the oldest quorum as GetMinedAndActiveCommitmentsUntilBlock
@@ -282,8 +288,9 @@ bool CalcCbTxMerkleRootQuorums(const CBlock& block, const CBlockIndex* pindexPre
282288
vec_hashes_final.reserve(CalcHashCountFromQCHashes(qcHashes));
283289

284290
for (const auto& [llmqType, vec_hashes] : qcHashes) {
285-
const auto& llmq_params = llmq::GetLLMQParams(llmqType);
286-
if (vec_hashes.size() > size_t(llmq_params.signingActiveQuorumCount)) {
291+
const auto& llmq_params_opt = llmq::GetLLMQParams(llmqType);
292+
assert(llmq_params_opt.has_value());
293+
if (vec_hashes.size() > size_t(llmq_params_opt->signingActiveQuorumCount)) {
287294
return state.Invalid(ValidationInvalidReason::CONSENSUS, false, REJECT_INVALID, "excess-quorums-calc-cbtx-quorummerkleroot");
288295
}
289296
// Copy vec_hashes into vec_hashes_final

src/evo/deterministicmns.cpp

+57-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void CDeterministicMN::ToJson(UniValue& obj) const
4848
obj.setObject();
4949

5050
UniValue stateObj;
51-
pdmnState->ToJson(stateObj);
51+
pdmnState->ToJson(stateObj, nType);
5252

5353
obj.pushKV("type", std::string(GetMnType(nType).description));
5454
obj.pushKV("proTxHash", proTxHash.ToString());
@@ -435,6 +435,48 @@ CDeterministicMNList CDeterministicMNList::ApplyDiff(const CBlockIndex* pindex,
435435
return result;
436436
}
437437

438+
// RepopulateUniquePropertyMap clears internal mnUniquePropertyMap, and repopulate it with currently MNs unique properties.
439+
// This is needed when the v19 fork activates, we need to store again pubKeyOperator in the mnUniquePropertyMap.
440+
// pubKeyOperator don't differ between the two schemes (legacy and basic(v19)) but their serialisation do: hence their hash.
441+
// And because mnUniquePropertyMap store only hashes, then we need to re-calculate hashes and repopulate.
442+
void CDeterministicMNList::RepopulateUniquePropertyMap() {
443+
decltype(mnUniquePropertyMap) mnUniquePropertyMapEmpty;
444+
mnUniquePropertyMap = mnUniquePropertyMapEmpty;
445+
446+
for (const auto &p: mnMap) {
447+
auto dmn = p.second;
448+
if (!AddUniqueProperty(*dmn, dmn->collateralOutpoint)) {
449+
throw (std::runtime_error(
450+
strprintf("%s: Can't add a masternode %s with a duplicate collateralOutpoint=%s", __func__,
451+
dmn->proTxHash.ToString(), dmn->collateralOutpoint.ToStringShort())));
452+
}
453+
if (dmn->pdmnState->addr != CService() && !AddUniqueProperty(*dmn, dmn->pdmnState->addr)) {
454+
throw (std::runtime_error(strprintf("%s: Can't add a masternode %s with a duplicate address=%s", __func__,
455+
dmn->proTxHash.ToString(),
456+
dmn->pdmnState->addr.ToStringIPPort(false))));
457+
}
458+
if (!AddUniqueProperty(*dmn, dmn->pdmnState->keyIDOwner)) {
459+
throw (std::runtime_error(
460+
strprintf("%s: Can't add a masternode %s with a duplicate keyIDOwner=%s", __func__,
461+
dmn->proTxHash.ToString(), EncodeDestination(PKHash(dmn->pdmnState->keyIDOwner)))));
462+
}
463+
if (dmn->pdmnState->pubKeyOperator.Get().IsValid() &&
464+
!AddUniqueProperty(*dmn, dmn->pdmnState->pubKeyOperator)) {
465+
throw (std::runtime_error(
466+
strprintf("%s: Can't add a masternode %s with a duplicate pubKeyOperator=%s", __func__,
467+
dmn->proTxHash.ToString(), dmn->pdmnState->pubKeyOperator.Get().ToString())));
468+
}
469+
470+
if (dmn->nType == MnType::HighPerformance) {
471+
if (!AddUniqueProperty(*dmn, dmn->pdmnState->platformNodeID)) {
472+
throw (std::runtime_error(
473+
strprintf("%s: Can't add a masternode %s with a duplicate platformNodeID=%s", __func__,
474+
dmn->proTxHash.ToString(), dmn->pdmnState->platformNodeID.ToString())));
475+
}
476+
}
477+
}
478+
}
479+
438480
void CDeterministicMNList::AddMN(const CDeterministicMNCPtr& dmn, bool fBumpTotalCount)
439481
{
440482
assert(dmn != nullptr);
@@ -617,11 +659,19 @@ bool CDeterministicMNManager::ProcessBlock(const CBlock& block, const CBlockInde
617659

618660
newList.SetBlockHash(block.GetHash());
619661

662+
// If the fork is active for pindex block, then we need to repopulate property map
663+
// (Check documentation of CDeterministicMNList::RepopulateUniquePropertyMap()).
664+
// This is needed only when base list is pre-v19 fork and pindex is post-v19 fork.
665+
bool v19_just_activated = pindex == llmq::utils::V19ActivationIndex(pindex);
666+
if (v19_just_activated) {
667+
newList.RepopulateUniquePropertyMap();
668+
}
669+
620670
oldList = GetListForBlock(pindex->pprev);
621671
diff = oldList.BuildDiff(newList);
622672

623673
m_evoDb.Write(std::make_pair(DB_LIST_DIFF, newList.GetBlockHash()), diff);
624-
if ((nHeight % DISK_SNAPSHOT_PERIOD) == 0 || oldList.GetHeight() == -1) {
674+
if ((nHeight % DISK_SNAPSHOT_PERIOD) == 0 || oldList.GetHeight() == -1 || v19_just_activated) {
625675
m_evoDb.Write(std::make_pair(DB_LIST_SNAPSHOT, newList.GetBlockHash()), newList);
626676
mnListsCache.emplace(newList.GetBlockHash(), newList);
627677
LogPrintf("CDeterministicMNManager::%s -- Wrote snapshot. nHeight=%d, mapCurMNs.allMNsCount=%d\n",
@@ -904,9 +954,12 @@ bool CDeterministicMNManager::BuildNewListFromBlock(const CBlock& block, const C
904954
return _state.Invalid(ValidationInvalidReason::CONSENSUS, false, REJECT_INVALID, "bad-qc-payload");
905955
}
906956
if (!qc.commitment.IsNull()) {
907-
const auto& llmq_params = llmq::GetLLMQParams(qc.commitment.llmqType);
957+
const auto& llmq_params_opt = llmq::GetLLMQParams(qc.commitment.llmqType);
958+
if (!llmq_params_opt.has_value()) {
959+
return _state.Invalid(ValidationInvalidReason::CONSENSUS, false, REJECT_INVALID, "bad-qc-commitment-type");
960+
}
908961
int qcnHeight = int(qc.nHeight);
909-
int quorumHeight = qcnHeight - (qcnHeight % llmq_params.dkgInterval) + int(qc.commitment.quorumIndex);
962+
int quorumHeight = qcnHeight - (qcnHeight % llmq_params_opt->dkgInterval) + int(qc.commitment.quorumIndex);
910963
auto pQuorumBaseBlockIndex = pindexPrev->GetAncestor(quorumHeight);
911964
if (!pQuorumBaseBlockIndex || pQuorumBaseBlockIndex->GetBlockHash() != qc.commitment.quorumHash) {
912965
// we should actually never get into this case as validation should have caught it...but let's be sure

src/evo/deterministicmns.h

+2
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ class CDeterministicMNList
375375
[[nodiscard]] CSimplifiedMNListDiff BuildSimplifiedDiff(const CDeterministicMNList& to, bool extended) const;
376376
[[nodiscard]] CDeterministicMNList ApplyDiff(const CBlockIndex* pindex, const CDeterministicMNListDiff& diff) const;
377377

378+
void RepopulateUniquePropertyMap();
379+
378380
void AddMN(const CDeterministicMNCPtr& dmn, bool fBumpTotalCount = true);
379381
void UpdateMN(const CDeterministicMN& oldDmn, const std::shared_ptr<const CDeterministicMNState>& pdmnState);
380382
void UpdateMN(const uint256& proTxHash, const std::shared_ptr<const CDeterministicMNState>& pdmnState);

src/evo/dmnstate.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ std::string CDeterministicMNState::ToString() const
3232
EncodeDestination(PKHash(keyIDOwner)), pubKeyOperator.Get().ToString(), EncodeDestination(PKHash(keyIDVoting)), addr.ToStringIPPort(false), payoutAddress, operatorPayoutAddress);
3333
}
3434

35-
void CDeterministicMNState::ToJson(UniValue& obj) const
35+
void CDeterministicMNState::ToJson(UniValue& obj, MnType nType) const
3636
{
3737
obj.clear();
3838
obj.setObject();
@@ -46,6 +46,11 @@ void CDeterministicMNState::ToJson(UniValue& obj) const
4646
obj.pushKV("revocationReason", nRevocationReason);
4747
obj.pushKV("ownerAddress", EncodeDestination(PKHash(keyIDOwner)));
4848
obj.pushKV("votingAddress", EncodeDestination(PKHash(keyIDVoting)));
49+
if (nType == MnType::HighPerformance) {
50+
obj.pushKV("platformNodeID", platformNodeID.ToString());
51+
obj.pushKV("platformP2PPort", platformP2PPort);
52+
obj.pushKV("platformHTTPPort", platformHTTPPort);
53+
}
4954

5055
CTxDestination dest;
5156
if (ExtractDestination(scriptPayout, dest)) {

src/evo/dmnstate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class CDeterministicMNState
200200

201201
public:
202202
std::string ToString() const;
203-
void ToJson(UniValue& obj) const;
203+
void ToJson(UniValue& obj, MnType nType) const;
204204
};
205205

206206
class CDeterministicMNStateDiff

src/evo/mnhftx.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ bool MNHFTx::Verify(const CBlockIndex* pQuorumIndex) const
2525
}
2626

2727
Consensus::LLMQType llmqType = Params().GetConsensus().llmqTypeMnhf;
28-
int signOffset{llmq::GetLLMQParams(llmqType).dkgInterval};
28+
const auto& llmq_params_opt = llmq::GetLLMQParams(llmqType);
29+
assert(llmq_params_opt.has_value());
30+
int signOffset{llmq_params_opt->dkgInterval};
2931

3032
const uint256 requestId = ::SerializeHash(std::make_pair(CBLSIG_REQUESTID_PREFIX, pQuorumIndex->nHeight));
3133
return llmq::CSigningManager::VerifyRecoveredSig(llmqType, *llmq::quorumManager, pQuorumIndex->nHeight, requestId, pQuorumIndex->GetBlockHash(), sig, 0) ||
@@ -53,7 +55,7 @@ bool CheckMNHFTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValidat
5355
return state.Invalid(ValidationInvalidReason::CONSENSUS, false, REJECT_INVALID, "bad-mnhf-quorum-hash");
5456
}
5557

56-
if (!Params().HasLLMQ(Params().GetConsensus().llmqTypeMnhf)) {
58+
if (!llmq::GetLLMQParams(Params().GetConsensus().llmqTypeMnhf).has_value()) {
5759
return state.Invalid(ValidationInvalidReason::CONSENSUS, false, REJECT_INVALID, "bad-mnhf-type");
5860
}
5961

src/governance/object.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ bool CGovernanceObject::CheckSignature(const CBLSPublicKey& pubKey) const
318318
const auto pindex = llmq::utils::V19ActivationIndex(::ChainActive().Tip());
319319
bool is_bls_legacy_scheme = pindex == nullptr || nTime < pindex->nTime;
320320
sig.SetByteVector(vchSig, is_bls_legacy_scheme);
321-
if (!sig.VerifyInsecure(pubKey, GetSignatureHash())) {
321+
if (!sig.VerifyInsecure(pubKey, GetSignatureHash(), is_bls_legacy_scheme)) {
322322
LogPrintf("CGovernanceObject::CheckSignature -- VerifyInsecure() failed\n");
323323
return false;
324324
}

0 commit comments

Comments
 (0)