Early Consensus in Message-Passing Systems Enriched with a Perfect Failure Detector and Its Application in the Theta Model