@@ -34,7 +34,7 @@ def go_to_epoch_end(node):
3434 blocks_to_mine = epoch_info ["epoch_length" ] - epoch_info ["epoch_age" ] - 1
3535 node .generatetoaddress (blocks_to_mine , node .getnewaddress ())
3636
37- def validate_no_vote_op_true (node , block ):
37+ def validate_no_vote_op_true (node , block , first_dynafed_active_block ):
3838
3939 block_info = node .getblock (block )
4040 dynamic_parameters = block_info ["dynamic_parameters" ]
@@ -44,14 +44,13 @@ def validate_no_vote_op_true(node, block):
4444 # signblockscript is now the P2WSH-ification of OP_TRUE
4545 WSH_OP_TRUE = node .decodescript ("51" )["segwit" ]["hex" ]
4646 assert_equal (dynamic_parameters ["current" ]["signblockscript" ], WSH_OP_TRUE )
47- if block_height % 10 == 0 :
47+ if block_height % 10 == 0 or first_dynafed_active_block :
4848 assert_equal (dynamic_parameters ["current" ]["fedpegscript" ], "51" )
4949 assert_equal (dynamic_parameters ["current" ]["extension_space" ], initial_extension )
5050 else :
5151 assert_equal (dynamic_parameters ["current" ]["fedpegscript" ], "" )
5252 assert_equal (dynamic_parameters ["current" ]["extension_space" ], [])
53- # TODO workshop this bump, or commit to new value in chainparams instead
54- assert_equal (dynamic_parameters ["current" ]["max_block_witness" ], 75 )
53+ assert_equal (dynamic_parameters ["current" ]["max_block_witness" ], 74 )
5554 # nothing was proposed, null fields make impossible to be valid blockheader
5655 # due to script rules requiring bool true on stack
5756 assert_equal (dynamic_parameters ["proposed" ]["signblockscript" ], "" )
@@ -118,8 +117,9 @@ def test_dynafed_activation(self):
118117 # Next block is first dynamic federation block
119118 block = self .nodes [0 ].generatetoaddress (1 , self .nodes [0 ].getnewaddress ())[0 ]
120119 self .sync_all ()
120+ # We publish full block on BIP9 transition
121121 for i in range (self .num_nodes ):
122- validate_no_vote_op_true (self .nodes [i ], block )
122+ validate_no_vote_op_true (self .nodes [i ], block , True )
123123
124124 def test_illegal_proposals (self ):
125125
@@ -148,14 +148,14 @@ def test_no_vote(self):
148148
149149 for i in range (self .num_nodes ):
150150 for block in blocks :
151- validate_no_vote_op_true (self .nodes [i ], block )
151+ validate_no_vote_op_true (self .nodes [i ], block , False )
152152
153153 # Now transition using vanilla getnewblockhex, nothing changed
154154 block = self .nodes [0 ].generatetoaddress (1 , self .nodes [0 ].getnewaddress ())[0 ]
155155 self .sync_all ()
156156
157157 for i in range (self .num_nodes ):
158- validate_no_vote_op_true (self .nodes [i ], block )
158+ validate_no_vote_op_true (self .nodes [i ], block , False )
159159
160160 def test_under_vote (self ):
161161 self .log .info ("Testing failed voting epoch..." )
@@ -176,7 +176,7 @@ def test_under_vote(self):
176176 self .sync_all ()
177177
178178 for i in range (self .num_nodes ):
179- validate_no_vote_op_true (self .nodes [i ], block )
179+ validate_no_vote_op_true (self .nodes [i ], block , False )
180180
181181 def test_four_fifth_vote (self ):
182182 self .log .info ("Testing just-successful transition epoch..." )
@@ -192,7 +192,7 @@ def test_four_fifth_vote(self):
192192 chain_info = self .nodes [i ].getblockchaininfo ()
193193 fedpeg_info = self .nodes [i ].getsidechaininfo ()
194194 assert_equal (chain_info ["current_signblock_hex" ], WSH_OP_TRUE )
195- assert_equal (chain_info ["max_block_witness" ], 75 )
195+ assert_equal (chain_info ["max_block_witness" ], 74 )
196196 assert_equal (chain_info ["extension_space" ], initial_extension )
197197 assert_equal (fedpeg_info ["current_fedpegscripts" ], ["51" , "51" ])
198198
@@ -210,7 +210,7 @@ def test_four_fifth_vote(self):
210210 chain_info = self .nodes [i ].getblockchaininfo ()
211211 fedpeg_info = self .nodes [i ].getsidechaininfo ()
212212 assert_equal (chain_info ["current_signblock_hex" ], WSH_OP_TRUE )
213- assert_equal (chain_info ["max_block_witness" ], 75 )
213+ assert_equal (chain_info ["max_block_witness" ], 74 )
214214 assert_equal (chain_info ["extension_space" ], initial_extension )
215215 assert_equal (fedpeg_info ["current_fedpegscripts" ], ["51" , "51" ])
216216
0 commit comments