FastVer2: A Provably Correct Monitor for Concurrent, Key-Value Stores

Arvind Arasu, Tahina Ramananandro, Aseem Rastogi, Nikhil Swamy, Aymeric Fromherz, Kesha Hietala, Bryan Parno, Ravi RamamurthyCPP 2023

Abstract

FastVer2 is the first formally verified, high-performance monitor for concurrent key-value stores that provides an end-to-end proof from high-level logic down to executable C code. By leveraging the Steel framework and a novel "ghost-state" construction called Fractional Anchored Preorder (FRAP), it achieves a throughput of over 10 million operations per second while mathematically guaranteeing sequential consistency. This work bridges the gap between high-level protocol verification and low-level implementation safety.

Introduction

Key-value stores, such as Redis and RocksDB, serve as the foundational storage layer for modern cloud infrastructure. Ensuring the integrity of these systems—specifically their adherence to sequential consistency—is paramount. Sequential consistency guarantees that every 'get' operation returns the result of the most recent 'put' operation. However, the complexity and performance requirements of modern databases make full formal verification of the engine itself extremely challenging.

An alternative approach is external monitoring: a small, trusted component observes the operations of an untrusted, high-performance database to verify its correctness. While the original FastVer protocol established a verified high-level design, its implementation in unverified C++ left a "verification gap" where low-level bugs could persist. FastVer2 addresses this by providing a monitor that is both formally proven correct and optimized for production-level performance.

Technical Methodology

FastVer2 is implemented using Steel, a domain-specific language embedded within the F proof assistant. Steel utilizes Concurrent Separation Logic (CSL)*, enabling rigorous reasoning about thread interactions and shared memory.

FRAP: Fractional Anchored Preorder

A central challenge in verifying concurrent systems is that threads progress at different rates. FastVer2 introduces FRAP (Fractional Anchored Preorder), a novel ghost-state construction. Ghost state refers to data used exclusively for the mathematical proof rather than program execution.

The FRAP ghost-state construction allows concurrent threads (V1...Vn) to track their progress relative to a shared state, ensuring global consistency without heavy synchronization.

As shown in the figure above, FRAP allows individual verifier threads to "anchor" their progress. A thread can verify a subset of operations up to a certain epoch and guarantee that the global certified state remains consistent with its local view. This mechanism avoids the need for expensive global locks, which is essential for maintaining high throughput on multi-core systems.

Verified Toolchain and Refinement

The development process employed refinement layers to prove that the low-level, imperative C code matches a high-level functional specification. The system integrates with EverParse for verified message parsing and EverCrypt for cryptographic primitives. Furthermore, FastVer2 is designed for deployment within Trusted Execution Environments (TEEs) like Intel SGX, ensuring the monitor's integrity even if the host environment is compromised.

Evaluation and Performance

The authors evaluated FastVer2 by integrating it with Faster, a high-performance concurrent key-value store. Testing was conducted using the YCSB (Yahoo! Cloud Serving Benchmark) Workload A, featuring a 50/50 mix of read and write operations on a database of 16 million records.

Key Results

  • Throughput: FastVer2 achieves a peak throughput exceeding 10 million operations per second.
  • Scalability: The system demonstrates near-linear performance scaling with the number of CPU cores (tested up to 32 cores).
  • Verification Overhead: While FastVer2 is approximately 5x slower than its unverified C++ predecessor, it remains 2-3 orders of magnitude faster than existing verified database systems like FSCQ.

Analysis revealed that roughly 50% of the performance gap is attributed to the software-based Blake2 hash used in the verified toolchain, compared to the hardware-accelerated AES-NI instructions used in the unverified version.

Conclusion

FastVer2 demonstrates that formal verification and high performance are not mutually exclusive. By focusing on a monitor rather than the entire database engine, the authors achieved "verified-level" security with production-grade speed. During development, the verification process even identified bugs in the original unverified implementation related to thread re-entrancy. Future work will focus on integrating hardware-accelerated cryptographic libraries and reducing memory allocation overhead to further narrow the performance gap.

Summary updated

BibTeX
@inproceedings{arasu2023fastver,
  author = {Arvind Arasu and Tahina Ramananandro and Aseem Rastogi and Nikhil Swamy and Aymeric Fromherz and Kesha Hietala and Bryan Parno and Ravi Ramamurthy},
  title = {{FastVer2: A Provably Correct Monitor for Concurrent, Key-Value Stores}},
  booktitle = {CPP},
  year = {2023},
  doi = {10.1145/3573105.3575687},
}
Figure