Skip to content

Commit ef10ced

Browse files
Merge branch 'develop' of https://github.com/dashpay/dash into develop
2 parents ce3219c + be23e15 commit ef10ced

23 files changed

+459
-251
lines changed

.tx/config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[main]
22
host = https://www.transifex.com
33

4-
[dash.dash_ents]
4+
[o:dash:p:dash:r:dash_ents]
55
file_filter = src/qt/locale/dash_<lang>.ts
66
source_file = src/qt/locale/dash_en.xlf
77
source_lang = en

configure.ac

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -450,15 +450,6 @@ if test "$enable_werror" = "yes"; then
450450
fi
451451
ERROR_CXXFLAGS=$CXXFLAG_WERROR
452452

453-
dnl -Warray-bounds cause problems with GCC. Do not treat these warnings as errors.
454-
dnl Suppress -Warray-bounds entirely because of noisy output, currently unhappy with immer implementation.
455-
AX_CHECK_COMPILE_FLAG([-Warray-bounds], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-array-bounds"], [], [$CXXFLAG_WERROR], [AC_LANG_SOURCE([
456-
#if defined(__clang__) || defined(__INTEL_COMPILER) || !defined(__GNUC__)
457-
#error Non-GCC compiler detected, not setting flag
458-
#endif
459-
int main(void) { return 0; }
460-
])])
461-
462453
dnl -Wattributes cause problems with some versions of GCC. Do not treat these warnings as errors.
463454
AX_CHECK_COMPILE_FLAG([-Wattributes], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-error=attributes"], [], [$CXXFLAG_WERROR], [AC_LANG_SOURCE([
464455
#if defined(__clang__) || defined(__INTEL_COMPILER) || !defined(__GNUC__)
@@ -478,22 +469,31 @@ if test "$enable_werror" = "yes"; then
478469
#endif
479470
int main(void) { return 0; }
480471
])])
481-
482-
dnl -Wstringop-overread and -Wstringop-overflow are broken in GCC. Suppress warnings entirely to avoid noisy output.
483-
AX_CHECK_COMPILE_FLAG([-Wstringop-overread], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-stringop-overread"], [], [$CXXFLAG_WERROR], [AC_LANG_SOURCE([
484-
#if defined(__clang__) || defined(__INTEL_COMPILER) || !defined(__GNUC__)
485-
#error Non-GCC compiler detected, not setting flag
486-
#endif
487-
int main(void) { return 0; }
488-
])])
489-
AX_CHECK_COMPILE_FLAG([-Wstringop-overflow], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-stringop-overflow"], [], [$CXXFLAG_WERROR], [AC_LANG_SOURCE([
490-
#if defined(__clang__) || defined(__INTEL_COMPILER) || !defined(__GNUC__)
491-
#error Non-GCC compiler detected, not setting flag
492-
#endif
493-
int main(void) { return 0; }
494-
])])
495472
fi
496473

474+
dnl -Warray-bounds cause problems with GCC. Do not treat these warnings as errors.
475+
dnl Suppress -Warray-bounds entirely because of noisy output, currently unhappy with immer implementation.
476+
AX_CHECK_COMPILE_FLAG([-Warray-bounds], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-array-bounds"], [], [$CXXFLAG_WERROR], [AC_LANG_SOURCE([
477+
#if defined(__clang__) || defined(__INTEL_COMPILER) || !defined(__GNUC__)
478+
#error Non-GCC compiler detected, not setting flag
479+
#endif
480+
int main(void) { return 0; }
481+
])])
482+
483+
dnl -Wstringop-overread and -Wstringop-overflow are broken in GCC. Suppress warnings entirely to avoid noisy output.
484+
AX_CHECK_COMPILE_FLAG([-Wstringop-overread], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-stringop-overread"], [], [$CXXFLAG_WERROR], [AC_LANG_SOURCE([
485+
#if defined(__clang__) || defined(__INTEL_COMPILER) || !defined(__GNUC__)
486+
#error Non-GCC compiler detected, not setting flag
487+
#endif
488+
int main(void) { return 0; }
489+
])])
490+
AX_CHECK_COMPILE_FLAG([-Wstringop-overflow], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-stringop-overflow"], [], [$CXXFLAG_WERROR], [AC_LANG_SOURCE([
491+
#if defined(__clang__) || defined(__INTEL_COMPILER) || !defined(__GNUC__)
492+
#error Non-GCC compiler detected, not setting flag
493+
#endif
494+
int main(void) { return 0; }
495+
])])
496+
497497
AX_CHECK_COMPILE_FLAG([-Wall], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wall"], [], [$CXXFLAG_WERROR])
498498
AX_CHECK_COMPILE_FLAG([-Wextra], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wextra"], [], [$CXXFLAG_WERROR])
499499
AX_CHECK_COMPILE_FLAG([-Wgnu], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wgnu"], [], [$CXXFLAG_WERROR])

src/Makefile.test.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ BITCOIN_TESTS += wallet/test/db_tests.cpp
222222
endif
223223

224224
FUZZ_WALLET_SRC = \
225+
wallet/test/fuzz/coincontrol.cpp \
225226
wallet/test/fuzz/coinselection.cpp
226227

227228
if USE_SQLITE

src/evo/cbtx.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,6 @@ bool CheckCbTx(const CCbTx& cbTx, const CBlockIndex* pindexPrev, TxValidationSta
4343
return true;
4444
}
4545

46-
bool CheckCbTxMerkleRoots(const CBlock& block, const CCbTx& cbTx, const CBlockIndex* pindex,
47-
const llmq::CQuorumBlockProcessor& quorum_block_processor, BlockValidationState& state)
48-
{
49-
if (pindex && cbTx.nVersion >= CCbTx::Version::MERKLE_ROOT_QUORUMS) {
50-
uint256 calculatedMerkleRoot;
51-
if (!CalcCbTxMerkleRootQuorums(block, pindex->pprev, quorum_block_processor, calculatedMerkleRoot, state)) {
52-
// pass the state returned by the function above
53-
return false;
54-
}
55-
if (calculatedMerkleRoot != cbTx.merkleRootQuorums) {
56-
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-cbtx-quorummerkleroot");
57-
}
58-
}
59-
60-
return true;
61-
}
62-
6346
using QcHashMap = std::map<Consensus::LLMQType, std::vector<uint256>>;
6447
using QcIndexedHashMap = std::map<Consensus::LLMQType, std::map<int16_t, uint256>>;
6548

src/evo/cbtx.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ template<> struct is_serializable_enum<CCbTx::Version> : std::true_type {};
6565

6666
bool CheckCbTx(const CCbTx& cbTx, const CBlockIndex* pindexPrev, TxValidationState& state);
6767

68-
// This can only be done after the block has been fully processed, as otherwise we won't have the finished MN list
69-
bool CheckCbTxMerkleRoots(const CBlock& block, const CCbTx& cbTx, const CBlockIndex* pindex,
70-
const llmq::CQuorumBlockProcessor& quorum_block_processor, BlockValidationState& state);
7168
bool CalcCbTxMerkleRootQuorums(const CBlock& block, const CBlockIndex* pindexPrev,
7269
const llmq::CQuorumBlockProcessor& quorum_block_processor, uint256& merkleRootRet,
7370
BlockValidationState& state);

src/evo/specialtxman.cpp

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ bool CSpecialTxProcessor::ProcessSpecialTxsInBlock(const CBlock& block, const CB
497497
static int64_t nTimeQuorum = 0;
498498
static int64_t nTimeDMN = 0;
499499
static int64_t nTimeMerkleMNL = 0;
500-
static int64_t nTimeMerkle = 0;
500+
static int64_t nTimeMerkleQuorums = 0;
501501
static int64_t nTimeCbTxCL = 0;
502502
static int64_t nTimeMnehf = 0;
503503
static int64_t nTimePayload = 0;
@@ -599,62 +599,63 @@ bool CSpecialTxProcessor::ProcessSpecialTxsInBlock(const CBlock& block, const CB
599599
}
600600
}
601601

602-
int64_t nTime5_1 = GetTimeMicros();
603-
nTimeDMN += nTime5_1 - nTime5;
604-
605-
LogPrint(BCLog::BENCHMARK, " - m_dmnman: %.2fms [%.2fs]\n", 0.001 * (nTime5_1 - nTime5),
606-
nTimeDMN * 0.000001);
602+
int64_t nTime6 = GetTimeMicros();
603+
nTimeDMN += nTime6 - nTime5;
604+
LogPrint(BCLog::BENCHMARK, " - m_dmnman: %.2fms [%.2fs]\n", 0.001 * (nTime6 - nTime5), nTimeDMN * 0.000001);
607605

608606
if (opt_cbTx.has_value()) {
609-
uint256 calculatedMerkleRoot;
610-
if (!CalcCbTxMerkleRootMNList(calculatedMerkleRoot, mn_list.to_sml(), state)) {
607+
uint256 calculatedMerkleRootMNL;
608+
if (!CalcCbTxMerkleRootMNList(calculatedMerkleRootMNL, mn_list.to_sml(), state)) {
611609
// pass the state returned by the function above
612610
return false;
613611
}
614-
if (calculatedMerkleRoot != opt_cbTx->merkleRootMNList) {
612+
if (calculatedMerkleRootMNL != opt_cbTx->merkleRootMNList) {
615613
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-cbtx-mnmerkleroot");
616614
}
617615

618-
int64_t nTime5_2 = GetTimeMicros();
619-
nTimeMerkleMNL += nTime5_2 - nTime5_1;
616+
int64_t nTime6_1 = GetTimeMicros();
617+
nTimeMerkleMNL += nTime6_1 - nTime6;
620618
LogPrint(BCLog::BENCHMARK, " - CalcCbTxMerkleRootMNList: %.2fms [%.2fs]\n",
621-
0.001 * (nTime5_2 - nTime5_1), nTimeMerkleMNL * 0.000001);
622-
}
619+
0.001 * (nTime6_1 - nTime6), nTimeMerkleMNL * 0.000001);
623620

624-
int64_t nTime6 = GetTimeMicros();
625-
if (opt_cbTx.has_value()) {
626-
if (!CheckCbTxMerkleRoots(block, *opt_cbTx, pindex, m_qblockman, state)) {
627-
// pass the state returned by the function above
628-
return false;
621+
if (opt_cbTx->nVersion >= CCbTx::Version::MERKLE_ROOT_QUORUMS) {
622+
uint256 calculatedMerkleRootQuorums;
623+
if (!CalcCbTxMerkleRootQuorums(block, pindex->pprev, m_qblockman, calculatedMerkleRootQuorums, state)) {
624+
// pass the state returned by the function above
625+
return false;
626+
}
627+
if (calculatedMerkleRootQuorums != opt_cbTx->merkleRootQuorums) {
628+
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-cbtx-quorummerkleroot");
629+
}
629630
}
630-
}
631631

632-
int64_t nTime7 = GetTimeMicros();
633-
nTimeMerkle += nTime7 - nTime6;
632+
int64_t nTime6_2 = GetTimeMicros();
633+
nTimeMerkleQuorums += nTime6_2 - nTime6_1;
634634

635-
LogPrint(BCLog::BENCHMARK, " - CheckCbTxMerkleRoots: %.2fms [%.2fs]\n", 0.001 * (nTime7 - nTime6),
636-
nTimeMerkle * 0.000001);
635+
LogPrint(BCLog::BENCHMARK, " - CalcCbTxMerkleRootQuorums: %.2fms [%.2fs]\n",
636+
0.001 * (nTime6_2 - nTime6_1), nTimeMerkleQuorums * 0.000001);
637637

638-
if (opt_cbTx.has_value()) {
639638
if (!CheckCbTxBestChainlock(*opt_cbTx, pindex, m_clhandler, state)) {
640639
// pass the state returned by the function above
641640
return false;
642641
}
642+
643+
int64_t nTime6_3 = GetTimeMicros();
644+
nTimeCbTxCL += nTime6_3 - nTime6_2;
645+
LogPrint(BCLog::BENCHMARK, " - CheckCbTxBestChainlock: %.2fms [%.2fs]\n",
646+
0.001 * (nTime6_3 - nTime6_2), nTimeCbTxCL * 0.000001);
643647
}
644648

645-
int64_t nTime8 = GetTimeMicros();
646-
nTimeCbTxCL += nTime8 - nTime7;
647-
LogPrint(BCLog::BENCHMARK, " - CheckCbTxBestChainlock: %.2fms [%.2fs]\n", 0.001 * (nTime8 - nTime7),
648-
nTimeCbTxCL * 0.000001);
649+
int64_t nTime7 = GetTimeMicros();
649650

650651
if (!m_mnhfman.ProcessBlock(block, pindex, fJustCheck, state)) {
651652
// pass the state returned by the function above
652653
return false;
653654
}
654655

655-
int64_t nTime9 = GetTimeMicros();
656-
nTimeMnehf += nTime9 - nTime8;
657-
LogPrint(BCLog::BENCHMARK, " - m_mnhfman: %.2fms [%.2fs]\n", 0.001 * (nTime9 - nTime8), nTimeMnehf * 0.000001);
656+
int64_t nTime8 = GetTimeMicros();
657+
nTimeMnehf += nTime8 - nTime7;
658+
LogPrint(BCLog::BENCHMARK, " - m_mnhfman: %.2fms [%.2fs]\n", 0.001 * (nTime8 - nTime7), nTimeMnehf * 0.000001);
658659

659660
if (DeploymentActiveAfter(pindex, m_consensus_params, Consensus::DEPLOYMENT_V19) && bls::bls_legacy_scheme.load()) {
660661
// NOTE: The block next to the activation is the one that is using new rules.

src/llmq/dkgsessionmgr.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,9 @@ bool CDKGSessionManager::GetVerifiedContributions(Consensus::LLMQType llmqType,
317317
if (it == contributionsCache.end()) {
318318
CDataStream s(SER_DISK, CLIENT_VERSION);
319319
if (!db->ReadDataStream(std::make_tuple(DB_VVEC, llmqType, pQuorumBaseBlockIndex->GetBlockHash(), proTxHash), s)) {
320+
LogPrint(BCLog::LLMQ, "%s -- this node does not have vvec for llmq=%d block=%s protx=%s\n",
321+
__func__, ToUnderlying(llmqType), pQuorumBaseBlockIndex->GetBlockHash().ToString(),
322+
proTxHash.ToString());
320323
return false;
321324
}
322325
size_t vvec_size = ReadCompactSize(s);

src/llmq/quorums.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,11 +923,11 @@ void CQuorumManager::StartQuorumDataRecoveryThread(CConnman& connman, const CQuo
923923
{
924924
assert(m_mn_activeman);
925925

926-
if (pQuorum->fQuorumDataRecoveryThreadRunning) {
926+
bool expected = false;
927+
if (!pQuorum->fQuorumDataRecoveryThreadRunning.compare_exchange_strong(expected, true)) {
927928
LogPrint(BCLog::LLMQ, "CQuorumManager::%s -- Already running\n", __func__);
928929
return;
929930
}
930-
pQuorum->fQuorumDataRecoveryThreadRunning = true;
931931

932932
workerPool.push([&connman, pQuorum, pIndex, nDataMaskIn, this](int threadId) {
933933
size_t nTries{0};

src/test/miner_tests.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ struct MinerTestingSetup : public TestingSetup {
3939
bool TestSequenceLocks(const CTransaction& tx) EXCLUSIVE_LOCKS_REQUIRED(::cs_main, m_node.mempool->cs)
4040
{
4141
CCoinsViewMemPool view_mempool(&m_node.chainman->ActiveChainstate().CoinsTip(), *m_node.mempool);
42-
return CheckSequenceLocksAtTip(m_node.chainman->ActiveChain().Tip(), view_mempool, tx);
42+
CBlockIndex* tip{m_node.chainman->ActiveChain().Tip()};
43+
const std::optional<LockPoints> lock_points{CalculateLockPointsAtTip(tip, view_mempool, tx)};
44+
return lock_points.has_value() && CheckSequenceLocksAtTip(tip, *lock_points);
4345
}
4446
BlockAssembler AssemblerForTest(const CChainParams& params);
4547
};

0 commit comments

Comments
 (0)