code: def finalize_block(self, block: BaseBlock) -> BaseBlock:
          
          if block.number > 0:
              self._assign_block_rewards(block)
  
          # We need to call `persist` here since the state db batches
          # all writes until we tell it to write to the underlying db
          self.state.persist()
  
          return block.copy(header=block.header.copy(state_root=self.state.state_root))
docs: Perform any finalization steps like awarding the block mining reward,
          and persisting the final state root.