Program Logics for Compositional Specification and Verification of Distributed Systems

Lead Research Organisation: University College London
Department Name: Computer Science

Abstract

It is hard to overstate the significance and ubiquity of distributed services in many aspects of the modern life, such as health care, online commerce, transportation, entertainment and cloud-based applications. Given the importance of distributed software and its complexity, stemming from its concurrent nature and the necessity to tolerate reordering and loss of packets, it is nowadays considered vital in industry to have a rigorous verification methodology for establishing its correctness properties, ensuring that, once a distributed system is up and running, it will never go wrong and will eventually complete its goals.

Real-world applications, including distributed ones, are not developed as standalone, monolithic pieces of code: they are rather built from multiple components, by composing the program machinery implemented in different modules, developed independently and then linked together. The benefit of such a compositional approach is thus the separation of concerns, which makes the development process modular: in order to use an implementation of a distributed protocol as a library, one should know what it does without bothering to understand how it works.

Alas, the potential of what is considered to be a good practice in modular software development, is not yet fully realised in the area of formal reasoning about distributed software. The existing approaches for specification and verification of distributed applications are predominantly focused on reasoning about systems as of standalone protocols, whose behavior is described using invariants of their execution histories, which are then checked using the protocols' abstract models. The absence of a uniform way of specifying and verifying implementations of distributed protocols and their clients (which might be themselves protocol implementations) introduces a gap in vertical compositionality of the formal reasoning: in order to prove correctness of a distributed library's client program, one should rely on the correctness result, established with respect to the library's model rather than its actual implementation. Furthermore, the way a distributed protocol is specified might employ a particular correctness condition, fixing its history invariants, such as linearizability, eventual or causal consistency, forcing one to adopt the corresponding verification methodology for the sake of reasoning about the protocol's clients. This diversity poses challenges with respect to horizontal compositionality, making it non-trivial to reason about non-toy applications that combine several protocols.

This project proposes to develop a uniform and modular approach for formally specifying and verifying implementations of distributed applications, in a machine-checked framework, addressing both issues of vertical and horizontal compositionality. The suggested methodology builds on the ideas of Hoare-style program logics for effectful concurrent programs and their mechanisation using dependent types. The proposed approach will thus establish a connecting link between the good practices of modular software development in the area of distributed computing and ideas of compositional reasoning about programs, as a way to formally verify them, therefore, delivering the strongest guarantees of their correctness.

Planned Impact

The first set of general contributions of this research is in the development of sound logical foundations for compositional reasoning about distributed computations. A foundational approach to logic-based program verification has been historically established in the UK by the works of Hoare in '60s and more recently continued by a series of works by O'Hearn and his collaborators, resulting in the practical adoption and industrial acclaim of Infer, a static analysis tool, based on Separation Logic, which is now being actively used at Facebook. The work proposed here directly builds on those ideas, taking them to the new area of computing, and contributes to the Information and Communication Technologies (ICT) portfolio of EPSRC, within the area of Verification and Correctness.

The second set of contributions would come from enhancing the design of modern programming languages and frameworks for distributed computations, incorporating the ideas of protocols and dependent types to specify and compose their properties. This aspect fits into the ICT portfolio within the area of Programming Languages and Compilers. Furthermore, with the recent shift in the industry towards the multicore architectures attempting to leverage massive parallelism for efficient computations, one should be able to formally ensure the correctness of the corresponding system implementations. Therefore, this proposal will be of importance for the cross-cutting ICT priority concerned with Many-core architectures and concurrency in distributed and embedded systems.

Finally, in the longer term the proposed work contributes to applications in the EPSRC's Global uncertainties theme, providing a theoretical basis for creating robust distributed systems, resilient to cybersecurity threats in a world of communicating entities.
 
Description > What were the most significant achievements from the award?

A suite of novel methods for implementing and reasoning about modern distributed services and their applications.

> To what extent were the award objectives met? If you can, briefly explain why any key objectives were not met.

To date, all three work packages, stated as award objectives, are fully completed:

- WP 1: Developing a meta-theory of a Hoare-style program logic for reasoning about distributed systems and proving its soundness [Done]
- WP 2: Verifying common distributed protocols and their clients [Done]
- WP 3: Implementing a domain-specific language for automating proofs about distributed applications.
Exploitation Route The findings are already in the process of being adopted by industrial companies, such as Facebook Inc. and Zilliqa (https://www.zilliqa.com/), in the scope of projects targeting formally verified distributed systems.
Sectors Digital/Communication/Information Technologies (including Software)

 
Description Several research results made possible by this award, were published at prestigious conferences, and are in the process of being adopted and expanded by industrial companies and other research institutions: 1. The paper "Programming and proving with distributed protocols" (published at POPL'18) started a series of ongoing research projects on semi-automated verification of distributed systems, in collaboration with Facebook Inc. and Galois Inc. 2. The paper "Mechanising blockchain consensus" (published at CPP'18) made a foundation for an independent research project at University of Illinois Urbana-Champaign, which builds on our results. 3. The papers "Scilla: a Smart Contract Intermediate-Level LAnguage" and "Finding The Greedy, Prodigal, and Suicidal Contracts at Scale" (currently under submission) was featured in a number of popular online magazines, including Vice/Motherboard and MIT Technology Review: https://motherboard.vice.com/en_us/article/8xddka/millions-of-dollars-in-ethereum-are-vulnerable-to-hackers-right-now-smart-contract-bugs https://www.technologyreview.com/s/610392/ethereums-smart-contracts-are-full-of-holes/ This work has provoked a lot of discussion on safety and security of contemporary distributed services and shaped my future research agenda in this direction.
First Year Of Impact 2017
Sector Digital/Communication/Information Technologies (including Software),Security and Diplomacy
Impact Types Economic

 
Description Google Research Award: Distributed System Optimizations as Network Semantics Transformations
Amount $55,000 (USD)
Organisation Google 
Department Research at Google
Sector Private
Country United States
Start 04/2018 
End 04/2019
 
Title Disel - Distributed Separation Logic 
Description A new general mathematical framework to verify distributed system implementations. 
Type Of Material Improvements to research infrastructure 
Year Produced 2018 
Provided To Others? Yes  
Impact The framework is now being assessed for adaptation for industrial-scale used at Facebook Inc. 
URL http://distributedcomponents.net/
 
Description Collaboration with University of Washington 
Organisation University of Washington
Country United States 
Sector Academic/University 
PI Contribution Collaborated on the main research project of the award, resulting in two conference publications.
Collaborator Contribution Contributed to the prototype implementation and paper writing.
Impact (1) Programming and Proving with Distributed Protocols. By Ilya Sergey, James R. Wilcox, and Zachary Tatlock. Published in the proceedings of the 45th ACM SIGPLAN Symposium on Principles of Programming Languages (POPL 2018). Los Angeles, CA, USA, January 2018. ACM. (2) Programming Language Abstractions for Modularly Verified Distributed Systems. By James R. Wilcox, Ilya Sergey, and Zachary Tatlock. Published in the proceedings of the 2nd Summit oN Advances in Programming Languages (SNAPL 2017), Pacific Grove, CA, USA, May 2017.
Start Year 2017
 
Title Disel: Distributed Separation Logic 
Description A mechanised framework for compositional verification of distributed systems. 
Type Of Technology Software 
Year Produced 2018 
Open Source License? Yes  
Impact Advanced the state of the art in mechanically verified software. Is being used as a building block in other groups' projects. 
URL http://distributedcomponents.net/
 
Title Toychain 
Description A minimalistic blockchain consensus implemented and verified in Coq. 
Type Of Technology Software 
Year Produced 2018 
Open Source License? Yes  
Impact The first mechanised implementation of a blockchain consensus protocol. 
 
Description S-REPLS 6 workshop 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact > Activities supported or undertaken by you or a member of your research team

I used the grant funding was used to organise a workshop at UCL with a focus on distribution, concurrency and verification. Here's the workshop page:

http://srepls6.cs.ucl.ac.uk/

The meeting has attracted speakers from 10 institutions from France, New Zealand, Singapore, UK, USA, and has been attended by approximately 90 researchers, students, and industry practitioners.
Year(s) Of Engagement Activity 2017
URL http://srepls6.cs.ucl.ac.uk/