File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -341,10 +341,14 @@ async def validate_block_body(
341341 # the generator ref list for this block (or 'one' bytes [0x01] if no generator)
342342 # 8b. The generator ref list length must be less than or equal to MAX_GENERATOR_REF_LIST_SIZE entries
343343 # 8c. The generator ref list must not point to a height >= this block's height
344- if block .transactions_generator_ref_list in ( None , []) :
344+ if block .transactions_generator_ref_list == [] :
345345 if block .transactions_info .generator_refs_root != bytes ([1 ] * 32 ):
346346 return Err .INVALID_TRANSACTIONS_GENERATOR_REFS_ROOT
347347 else :
348+ # With hard fork 2 we ban transactions_generator_ref_list.
349+ if prev_transaction_block_height >= constants .HARD_FORK2_HEIGHT :
350+ return Err .TOO_MANY_GENERATOR_REFS
351+
348352 # If we have a generator reference list, we must have a generator
349353 if block .transactions_generator is None :
350354 return Err .INVALID_TRANSACTIONS_GENERATOR_REFS_ROOT
Original file line number Diff line number Diff line change @@ -385,6 +385,10 @@ def setup_new_gen(
385385 transaction_data : Optional [SpendBundle ],
386386 block_refs : list [uint32 ],
387387 ) -> Optional [NewBlockGenerator ]:
388+ if prev_tx_height >= self .constants .HARD_FORK2_HEIGHT :
389+ assert block_refs == [], "block references are not allowed after hard fork 2"
390+ dummy_block_references = False
391+
388392 # we don't know if the new block will be a transaction
389393 # block or not, so even though we prepare a block
390394 # generator, we can't update our state (like,
You can’t perform that action at this time.
0 commit comments