make the function get_next_active_checkpoint referential transparency