Skip to content

Commit b2a42d2

Browse files
Merge #7610: test: wait for MN disconnect after in-place ProUpServ migration
107171b test: wait for MN disconnect after in-place ProUpServ migration (pasta) Pull request description: ## Issue being fixed or feature implemented - `feature_protx_version.py` flakes on the ASAN job because a post-v24 in-place `update_service` migration re-encodes `pubKeyOperator`. CMNAuth then drops verified connections, and the default `generate()` → `sync_all()` path asserts that every node still has at least one peer. - Same race this test already handles for revoke and registrar key rotation; this path was missing `sync_fun=self.no_op`. ## What was done? - Mine the ProUpServTx with `sync_fun=self.no_op`. - Wait for the migrated masternode's old peers to disconnect, reconnect it to node 0, then `sync_all()`. - Keep the `protx` / `getrawtransaction` checks on the mining node, which already has the block. ## How Has This Been Tested? - Compared against the existing revoke and `update_registrar` disconnect handling in the same file. - Root-caused from https://github.com/PastaPastaPasta/dash/actions/runs/31740186678/job/94598843934 (`feature_protx_version.py` failed 3/3 on `sync_blocks` peer-count assert; no AddressSanitizer report). - Did not re-run the full functional test locally; it is a long masternode test and the failure is a timing race that shows up under ASAN slowdown. ## Breaking Changes - None. ## 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 - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ This pull request was created by Codex. ACKs for top commit: knst: ACK 107171b Tree-SHA512: e019c170d94f0d6e2b477da2c9dfe84beeba64529f07cb1fade85ce94b80c5d571ffeb9217c6e570da21c02c6b8b975fca4b655fdd25d2b01ee232dc86fff0f4
2 parents b7da66f + 107171b commit b2a42d2

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

test/functional/feature_protx_version.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,18 +258,19 @@ def test_protx_v24_versioning(self, mn: MasternodeInfo, legacy_mn: MasternodeInf
258258
upserv_hash = surviving_legacy_mn.update_service(node, submit=True,
259259
addrs_core_p2p=[f'127.0.0.1:{surviving_legacy_mn.nodePort}'])
260260
self.bump_mocktime(10 * 60 + 1)
261-
tip = self.generate(node, 1)[0]
261+
# Same CMNAuth disconnect as a key rotation: SetStateVersion re-encodes pubKeyOperator, so
262+
# skip sync_all until the old peers are gone and this node is reconnected.
263+
assert surviving_legacy_mn.nodeIdx is not None
264+
old_peer_ids = self.get_peer_ids(surviving_legacy_mn.nodeIdx)
265+
tip = self.generate(node, 1, sync_fun=self.no_op)[0]
262266
assert_equal(node.getrawtransaction(upserv_hash, 1, tip)['proUpServTx']['version'], 3)
263267
state = node.protx('info', surviving_legacy_mn.proTxHash)['state']
264268
assert_equal(state['version'], 3) # migrated in place
265269
# Same operator key, re-encoded to the basic scheme (different hex, but not a rotation: the
266270
# masternode is not PoSe-banned).
267271
assert state['pubKeyOperator'] != key_before
268272
assert_equal(state['PoSeBanHeight'], -1)
269-
# The key re-encoding churns the migrated node's masternode connections, so reconnect it (as
270-
# the rotation path does) before syncing, then confirm the list still reloads from disk
271-
# identically after the in-place migration.
272-
assert surviving_legacy_mn.nodeIdx is not None
273+
self.wait_for_peers_disconnected(surviving_legacy_mn.nodeIdx, old_peer_ids)
273274
self.connect_nodes(surviving_legacy_mn.nodeIdx, 0)
274275
self.sync_all()
275276
list_before = self.nodes[1].masternodelist()

0 commit comments

Comments
 (0)