Skip to content

Commit e539b89

Browse files
Merge #6703: fix: intermittent error in feature_dip3_v19.py
d1e820f fix: not just skip chainlock, but ignore only _best_ chainlock (Konstantin Akimov) cb42761 feat: just skip chainlock for cbtx if it is legacy scheme signed (Konstantin Akimov) 35161cb test: simplify feature_dip3_v19 test by excluding v20 out of scope (Konstantin Akimov) 63f509d fix: intermittent error in feature_dip3_v19.py (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented #6702 It can happen on Regtest or Devnet if v20 is just activated but the best chainlock is still in legacy (pre-v19) scheme. It causes errors on CI similar to this one: 2025-05-31T10:28:49.821000Z TestFramework (INFO): Checking that protxs with duplicate EvoNodes fields are rejected 2025-05-31T10:29:50.653000Z TestFramework (INFO): dynamically_prepare_masternode failed 2025-05-31T10:30:50.784000Z TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "DASH/test/functional/test_framework/test_framework.py", line 162, in main self.run_test() File "DASH/test/functional/feature_dip3_v19.py", line 87, in run_test self.dynamically_evo_update_service(evo_info_0, 8) File "DASH/test/functional/test_framework/test_framework.py", line 1384, in dynamically_evo_update_service tip = self.generate(self.nodes[0], 1)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "DASH/test/functional/test_framework/test_framework.py", line 805, in generate sync_fun() if sync_fun else self.sync_all() ^^^^^^^^^^^^^^^ File "DASH/test/functional/test_framework/test_framework.py", line 874, in sync_all self.sync_blocks(nodes) File "DASH/test/functional/test_framework/test_framework.py", line 840, in sync_blocks raise AssertionError("Block sync timed out after {}s:{}".format( AssertionError: Block sync timed out after 60s: '4227eea732e686fcf608bcbc5525a02336bb69c2eed70e8a59d6439b2122190f' '4227eea732e686fcf608bcbc5525a02336bb69c2eed70e8a59d6439b2122190f' '4227eea732e686fcf608bcbc5525a02336bb69c2eed70e8a59d6439b2122190f' '4227eea732e686fcf608bcbc5525a02336bb69c2eed70e8a59d6439b2122190f' '4227eea732e686fcf608bcbc5525a02336bb69c2eed70e8a59d6439b2122190f' '4227eea732e686fcf608bcbc5525a02336bb69c2eed70e8a59d6439b2122190f' '0ade04ee0ae89d1168792a65c28956557c9f2991d141180b9faf7a9ae986cf24' 2025-05-31T10:30:50.837000Z TestFramework (INFO): Stopping nodes While underlying error is `bad-cbtx-invalid-clsig`: 2025-05-31T10:28:49.932591Z [util/system.h:57] [error] ERROR: ConnectBlock(DASH): ProcessSpecialTxsInBlock for block 4f8767d0ad2e7c8882ba4b2819a1d8eb29fbc608ff8201ed1c857d6d3ec51cc9 failed with bad-cbtx-invalid-clsig 2025-05-31T10:28:49.932632Z [validationinterface.cpp:254] [BlockChecked] [validation] BlockChecked: block hash=4f8767d0ad2e7c8882ba4b2819a1d8eb29fbc608ff8201ed1c857d6d3ec51cc9 state=bad-cbtx-invalid-clsig 2025-05-31T10:28:49.932660Z [validation.cpp:1634] [InvalidChainFound] InvalidChainFound: invalid block=4f8767d0ad2e7c8882ba4b2819a1d8eb29fbc608ff8201ed1c857d6d3ec51cc9 height=202 log2_work=8.665336 date=2014-12-04T17:46:38Z 2025-05-31T10:28:49.932667Z [validation.cpp:1639] [InvalidChainFound] InvalidChainFound: current best=0ade04ee0ae89d1168792a65c28956557c9f2991d141180b9faf7a9ae986cf24 height=201 log2_work=8.658211 date=2014-12-04T17:36:30Z ## What was done? Chainlocks in CbTx can be only in Basic scheme. This PR splits activation of v19 and v20 to different blocks and wait until the best chainlocks will be formed in BASIC scheme. ## How Has This Been Tested? Run functional test `feature_dip3_v19.py` multiple times. ## Breaking Changes On RegTest `v20` is enforced to be activated after v19. In practice, any chainlocks in CbTx formed without v19 activated will stop the chain. Added assert for `regtest` to be sure that combination of various `-testactivationheight` won't stop chain ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone ACKs for top commit: UdjinM6: utACK d1e820f PastaPastaPasta: utACK d1e820f Tree-SHA512: 6e5e468f783341a9ef4f6946bdab996b96f0e1de1cb0cfc6dabd62300bf334c9184a862aa5bd151677f595fd0cf85f6190c673e5ddd17d15254f9737270dfb7e
2 parents ee34525 + d1e820f commit e539b89

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

src/chainparams.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,9 @@ class CRegTestParams : public CChainParams {
925925
UpdateLLMQTestParametersFromArgs(args, Consensus::LLMQType::LLMQ_TEST_INSTANTSEND);
926926
UpdateLLMQTestParametersFromArgs(args, Consensus::LLMQType::LLMQ_TEST_PLATFORM);
927927
UpdateLLMQInstantSendDIP0024FromArgs(args);
928+
// V20 features for CbTx (credit pool, CL) have no meaning without masternodes
928929
assert(consensus.V20Height >= consensus.DIP0003Height);
930+
// MN_RR reallocate part of reward to CreditPool which exits since V20
929931
assert(consensus.MN_RRHeight >= consensus.V20Height);
930932
}
931933

src/evo/cbtx.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@ bool CalcCbTxBestChainlock(const llmq::CChainLocksHandler& chainlock_handler, co
392392
uint32_t& bestCLHeightDiff, CBLSSignature& bestCLSignature)
393393
{
394394
auto best_clsig = chainlock_handler.GetBestChainLock();
395+
if (best_clsig.getHeight() < Params().GetConsensus().DeploymentHeight(Consensus::DEPLOYMENT_V19)) {
396+
// We don't want legacy BLS ChainLocks in CbTx (can happen on regtest/devenets)
397+
best_clsig = llmq::CChainLockSig{};
398+
}
395399
if (best_clsig.getHeight() == pindexPrev->nHeight) {
396400
// Our best CL is the newest one possible
397401
bestCLHeightDiff = 0;

src/test/evo_deterministicmns_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ struct TestChainV19Setup : public TestChainV19BeforeActivationSetup {
866866

867867
// 5 blocks earlier
868868
TestChainV19BeforeActivationSetup::TestChainV19BeforeActivationSetup() :
869-
TestChainSetup(494, {"-testactivationheight=v19@500"})
869+
TestChainSetup(494, {"-testactivationheight=v19@500", "-testactivationheight=v20@500", "-testactivationheight=mn_rr@500"})
870870
{
871871
bool v19_active{DeploymentActiveAfter(m_node.chainman->ActiveChain().Tip(), Params().GetConsensus(),
872872
Consensus::DEPLOYMENT_V19)};

src/test/util/setup_common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ TestChainSetup::TestChainSetup(int num_blocks, const std::vector<const char*>& e
399399
/*TestChainBRRBeforeActivationSetup=*/
400400
{ 497, uint256S("0x0857a9b5db51835b1c828f019f4c664b5fe6c28ac44a6d868436930f832d31e5") },
401401
/*TestChainV19BeforeActivationSetup=*/
402-
{ 494, uint256S("0x06ec12cb5419daf83e04455a24ff8f27fef76cfdbd3e8723ca4946fab91a2f11") },
402+
{ 494, uint256S("0x44ee5c8a5e5cbd4437d63c54ddc1d40329be811b25c492fa901e11cdf408f905") },
403403
}
404404
};
405405

0 commit comments

Comments
 (0)