Edge computing is an emerging paradigm that extends cloud computing by allocating a range of (edge) servers at or near the user to provide necessary networking, storage, and computing services. Cyber-physical systems (CPS) connect physical devices to the Internet and to each other. This research explores the marriage between edge computing and CPS, namely edge-based CPS. It has attracted a tremendous amount of attention from both academia and industry because it is expected to fundamentally change the way people interact with engineered systems. One essential element –the study of fault-tolerant distributed primitives– is still missing in the literature. This research is focused on distributed consensus primitives that allow a collection of nodes to work as a coherent entity in the presence of various failures and cyberattacks. Concretely, there are three interrelated tasks: (i) identifying fundamental properties, limitations, and trade-offs in the context of edge-based CPS; (ii) designing algorithms that automatically adapt under changing conditions and varying cyberattacks to maintain good performance; and (iii) designing and implementing a realistic simulator to study performance under practical scenarios. The expected outcomes will enable efficient and fault-tolerant services for edge-based CPS, allowing more innovation in CPS applications. This research is expected to advance the state of knowledge by identifying a set of principles, fault-tolerance tools, and analyses for designing distributed fault-tolerant primitives. The work will emphasize models and primitives that allow for practical implementation, with plans for realistic demonstrations of their fault-tolerance and performance advantages. <br/><br/>Edge computing and CPS are expected to be key components of next-generation infrastructure, so making edge-based CPS fault-tolerant can yield large-scale benefits. Conversely, missed opportunities for improvements caused by a lack of foundational understanding could have significant performance and fault-tolerance consequences. This research helps address these issues by identifying trade-offs and limitations. The proposed research also plans to develop new pedagogical material on distributed systems that the PI plans to teach, both through courses at Boston College and in online tutorials made available to the public. In addition, the research and outreach work will benefit society by providing principles to help industry and academia design fault-tolerant primitives for edge-based CPS; increasing partnerships between academia and industry; involving women, persons with disabilities, and underrepresented groups in STEM; and increasing public scientific literacy and public engagement with science and technology.<br/><br/>This award reflects NSF's statutory mission and has been deemed worthy of support through evaluation using the Foundation's intellectual merit and broader impacts review criteria.