<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def finalize_block(self, block: BaseBlock) -> BaseBlock: """ Perform any finalization steps like awarding the block mining reward, and persisting the final state root. """

        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))