论文标题
用液体haskell验证的因果广播
Verified Causal Broadcast with Liquid Haskell
论文作者
论文摘要
确保消息以因果顺序传递的协议是分布式系统无处不在的构建块。例如,分布式数据存储系统可以使用因果订购的消息传递来确保因果关系的一致性,并且CRDT可以依靠基本的因果订购的消息传递层来简化其实现。因果交付协议可确保当消息传递到流程时,发送给同一流程的任何因果之前的消息已经交付给它。尽管因果交付协议被广泛使用,但对其正确性的验证较不常见,对可执行实现的机器检查证明较少。 我们在Haskell中实施了标准的因果广播协议,并使用了液体Haskell求解器验证系统来表达并机械地证明永远不会按违反因果关系的顺序传递消息。我们利用Liquid Haskell的基本SMT求解器来自动化证明的部分,并使用其其余部分的手动定理功能来自动化该属性,并证明其实现了我们的实现。然后,我们将经过验证的因果广播实现作为分布式钥匙值商店的基础工作。
Protocols to ensure that messages are delivered in causal order are a ubiquitous building block of distributed systems. For instance, distributed data storage systems can use causally ordered message delivery to ensure causal consistency, and CRDTs can rely on the existence of an underlying causally-ordered messaging layer to simplify their implementation. A causal delivery protocol ensures that when a message is delivered to a process, any causally preceding messages sent to the same process have already been delivered to it. While causal delivery protocols are widely used, verification of their correctness is less common, much less machine-checked proofs about executable implementations. We implemented a standard causal broadcast protocol in Haskell and used the Liquid Haskell solver-aided verification system to express and mechanically prove that messages will never be delivered to a process in an order that violates causality. We express this property using refinement types and prove that it holds of our implementation, taking advantage of Liquid Haskell's underlying SMT solver to automate parts of the proof and using its manual theorem-proving features for the rest. We then put our verified causal broadcast implementation to work as the foundation of a distributed key-value store.