def METHOD_NAME(self, db: Session, reward_program_id: str):
    o = (
        db.query(models.Root)
        .filter(models.Root.rewardProgramId == reward_program_id)
        .order_by(models.Root.blockNumber.desc())
        .first()
    )
    return o.blockNumber if o is not None else 0