@@ -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.
0 commit comments