Skip to content

Commit 67eb2e4

Browse files
committed
fix: activate dip0008 in feature_dip4_coinbasemerkleroots without extra blocks
It also remove custom helper
1 parent 0cd82fe commit 67eb2e4

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

test/functional/feature_dip4_coinbasemerkleroots.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -253,17 +253,6 @@ def test_getmnlistdiff_base(self, baseBlockHash, blockHash):
253253

254254
return d
255255

256-
def activate_dip8(self, slow_mode=False):
257-
# NOTE: set slow_mode=True if you are activating dip8 after a huge reorg
258-
# or nodes might fail to catch up otherwise due to a large
259-
# (MAX_BLOCKS_IN_TRANSIT_PER_PEER = 16 blocks) reorg error.
260-
self.log.info("Wait for dip0008 activation")
261-
while self.nodes[0].getblockcount() < DIP0008_HEIGHT:
262-
self.bump_mocktime(10)
263-
self.generate(self.nodes[0], 10, sync_fun=self.no_op)
264-
if slow_mode:
265-
self.sync_blocks()
266-
self.sync_blocks()
267256

268257
def test_dip8_quorum_merkle_root_activation(self, with_initial_quorum, slow_mode=False):
269258
if with_initial_quorum:
@@ -279,7 +268,9 @@ def test_dip8_quorum_merkle_root_activation(self, with_initial_quorum, slow_mode
279268
cbtx = self.nodes[0].getblock(self.nodes[0].getbestblockhash(), 2)["tx"][0]
280269
assert cbtx["cbTx"]["version"] == 1
281270

282-
self.activate_dip8(slow_mode)
271+
self.activate_by_name('dip0008', expected_activation_height=DIP0008_HEIGHT)
272+
self.log.info("Mine one more block with new rules of dip0008")
273+
self.generate(self.nodes[0], 1)
283274

284275
# Assert that merkleRootQuorums is present and 0 (we have no quorums yet)
285276
cbtx = self.nodes[0].getblock(self.nodes[0].getbestblockhash(), 2)["tx"][0]

test/functional/test_framework/test_framework.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ def set_dash_test_params(self, num_nodes, masterodes_count, extra_args=None, evo
12061206
self.quorum_data_request_expiration_timeout = 360
12071207

12081208

1209-
def activate_by_name(self, name, expected_activation_height=None):
1209+
def activate_by_name(self, name, expected_activation_height=None, slow_mode=True):
12101210
assert not softfork_active(self.nodes[0], name)
12111211
self.log.info("Wait for " + name + " activation")
12121212

@@ -1217,7 +1217,7 @@ def activate_by_name(self, name, expected_activation_height=None):
12171217
self.wait_for_sporks_same()
12181218

12191219
# mine blocks in batches
1220-
batch_size = 50
1220+
batch_size = 50 if not slow_mode else 10
12211221
if expected_activation_height is not None:
12221222
height = self.nodes[0].getblockcount()
12231223
assert height < expected_activation_height

0 commit comments

Comments
 (0)