Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3572848.3577524acmconferencesArticle/Chapter ViewAbstractPublication PagesppoppConference Proceedingsconference-collections
research-article

Block-STM: Scaling Blockchain Execution by Turning Ordering Curse to a Performance Blessing

Published: 21 February 2023 Publication History

Abstract

Block-STM is a parallel execution engine for smart contracts, built around the principles of Software Transactional Memory. Transactions are grouped in blocks, and every execution of the block must yield the same deterministic outcome. Block-STM further enforces that the outcome is consistent with executing transactions according to a preset order, leveraging this order to dynamically detect dependencies and avoid conflicts during speculative transaction execution. At the core of Block-STM is a novel, low-overhead collaborative scheduler of execution and validation tasks.
Block-STM is implemented on the main branch of the Diem Blockchain code-base and runs in production at Aptos. Our evaluation demonstrates that Block-STM is adaptive to workloads with different conflict rates and utilizes the inherent parallelism therein. Block-STM achieves up to 110k tps in the Diem benchmarks and up to 170k tps in the Aptos Benchmarks, which is a 20x and 17x improvement over the sequential baseline with 32 threads, respectively. The throughput on a contended workload is up to 50k tps and 80k tps in Diem and Aptos benchmarks, respectively.

References

[1]
[n.d.]. Aptos codebase. https://github.com/aptos-labs/aptos-core.
[2]
[n.d.]. Aptos whitepaper. https://github.com/aptos-labs/aptos-core/blob/main/developer-docs-site/static/papers/whitepaper.pdf.
[3]
[n.d.]. BlockSTM implementation. https://github.com/danielxiangzl/Block-STM.
[4]
[n.d.]. Diem codebase. https://github.com/diem/diem/tree/main.
[5]
[n.d.]. Polygon codebase. https://github.com/maticnetwork/bor.
[6]
Dan Alistarh, Justin Kopinsky, Jerry Li, and Nir Shavit. 2015. The spraylist: A scalable relaxed priority queue. In Proceedings of the 20th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming. 11--20.
[7]
Mohammad Javad Amiri, Divyakant Agrawal, and Amr El Abbadi. 2019. ParBlockchain: Leveraging Transaction Parallelism in Permissioned Blockchain Systems. In proceedings of the IEEE 39th International Conference on Distributed Computing Systems (ICDCS). 1337--1347.
[8]
Elli Androulaki, Artem Barger, Vita Bortnikov, Christian Cachin, Konstantinos Christidis, Angelo De Caro, David Enyeart, Christopher Ferris, Gennady Laventman, Yacov Manevich, et al. 2018. Hyperledger fabric: a distributed operating system for permissioned blockchains. In Proceedings of the thirteenth EuroSys conference. 1--15.
[9]
Parwat Singh Anjana, Hagit Attiya, Sweta Kumari, Sathya Peri, and Archit Somani. 2020. Efficient concurrent execution of smart contracts in blockchains using object-based transactional memory. In International Conference on Networked Systems. Springer, 77--93.
[10]
Parwat Singh Anjana, Sweta Kumari, Sathya Peri, Sachin Rathor, and Archit Somani. 2021. OptSmart: A Space Efficient Optimistic Concurrent Execution of Smart Contracts. arXiv:2102.04875 [cs.DC]
[11]
Hagit Attiya and Jennifer Welch. 2004. Distributed computing: fundamentals, simulations, and advanced topics. Vol. 19. John Wiley & Sons.
[12]
Philip A Bernstein and Nathan Goodman. 1983. Multiversion concurrency control---theory and algorithms. ACM Transactions on Database Systems (TODS) 8, 4 (1983), 465--483.
[13]
Sam Blackshear, Evan Cheng, David L Dill, Victor Gao, Ben Maurer, Todd Nowacki, Alistair Pott, Shaz Qadeer, Dario Russi Rain, Stephane Sezer, et al. 2019. Move: A language with programmable resources. Libra Assoc. (2019).
[14]
Edward Bortnikov, Eshcar Hillel, Idit Keidar, Ivan Kelly, Matthieu Morel, Sameer Paranjpye, Francisco Perez-Sorrosal, and Ohad Shacham. 2017. Omid, Reloaded: Scalable and {Highly-Available} Transaction Processing. In 15th USENIX Conference on File and Storage Technologies (FAST 17). 167--180.
[15]
Joao Cachopo and António Rito-Silva. 2006. Versioned boxes as the basis for memory transactions. Science of Computer Programming 63, 2 (2006), 172--185.
[16]
Calin Cascaval, Colin Blundell, Maged Michael, Harold W Cain, Peng Wu, Stefanie Chiras, and Siddhartha Chatterjee. 2008. Software transactional memory: Why is it only a research toy? Commun. ACM 51, 11 (2008), 40--46.
[17]
Yang Chen, Zhongxin Guo, Runhuai Li, Shuo Chen, Lidong Zhou, Yajin Zhou, and Xian Zhang. 2021. Forerunner: Constraint-based speculative transaction execution for ethereum. In Proceedings of the ACM SIGOPS 28th Symposium on Operating Systems Principles. 570--587.
[18]
Philip Daian, Steven Goldfeder, Tyler Kell, Yunqi Li, Xueyuan Zhao, Iddo Bentov, Lorenz Breidenbach, and Ari Juels. 2019. Flash boys 2.0: Frontrunning, transaction reordering, and consensus instability in decentralized exchanges. arXiv preprint arXiv:1904.05234 (2019).
[19]
Dave Dice, Ori Shalev, and Nir Shavit. 2006. Transactional locking II. In International Symposium on Distributed Computing. Springer, 194--208.
[20]
Thomas Dickerson, Paul Gazzillo, Maurice Herlihy, and Eric Koskinen. 2020 (ArXiv version 2017). Adding concurrency to smart contracts. Distributed Computing 33, 3 (2020 (ArXiv version 2017)), 209--225.
[21]
Aleksandar Dragojević, Pascal Felber, Vincent Gramoli, and Rachid Guerraoui. 2011. Why STM can be more than a research toy. Commun. ACM 54, 4 (2011), 70--77.
[22]
Avner Elizarov, Guy Golan-Gueta, and Erez Petrank. 2019. LOFT: lock-free transactional data structures. In Proceedings of the 24th Symposium on Principles and Practice of Parallel Programming. 425--426.
[23]
Alvaro Estebanez, Diego R Llanos, and Arturo Gonzalez-Escribano. 2016. A survey on thread-level speculation techniques. ACM Computing Surveys (CSUR) 49, 2 (2016), 1--39.
[24]
Jose M Faleiro and Daniel J Abadi. 2015. Rethinking serializable multi-version concurrency control. Proceedings of the VLDB Endowment 8, 11 (2015), 1190--1201.
[25]
Pascal Felber, Christof Fetzer, and Torvald Riegel. 2008. Dynamic performance tuning of word-based software transactional memory. In Proceedings of the 13th ACM SIGPLAN Symposium on Principles and practice of parallel programming. 237--246.
[26]
Rati Gelashvili, Alexander Spiegelman, Zhuolun Xiang, George Danezis, Zekun Li, Yu Xia, Runtian Zhou, and Dahlia Malkhi. 2022. Block-STM: Scaling Blockchain Execution by Turning Ordering Curse to a Performance Blessing. arXiv preprint arXiv:2203.06871 (2022).
[27]
Rachid Guerraoui and Michal Kapalka. 2008. On the correctness of transactional memory. In Proceedings of the 13th ACM SIGPLAN Symposium on Principles and practice of parallel programming. 175--184.
[28]
Rachid Guerraoui, Michal Kapalka, and Jan Vitek. 2006. Stmbench7: a benchmark for software transactional memory. Technical Report.
[29]
Ahmed Hassan, Roberto Palmieri, and Binoy Ravindran. 2014. Optimistic transactional boosting. In Proceedings of the 19th ACM SIGPLAN symposium on Principles and practice of parallel programming. 387--388.
[30]
Danny Hendler, Itai Incze, Nir Shavit, and Moran Tzafrir. 2010. Flat combining and the synchronization-parallelism tradeoff. In Proceedings of the twenty-second annual ACM symposium on Parallelism in algorithms and architectures. 355--364.
[31]
Maurice Herlihy and Eric Koskinen. 2008. Transactional boosting: a methodology for highly-concurrent transactional objects. In Proceedings of the 13th ACM SIGPLAN Symposium on Principles and practice of parallel programming. 207--216.
[32]
Maurice Herlihy and J Eliot B Moss. 1993. Transactional memory: Architectural support for lock-free data structures. In Proceedings of the 20th annual international symposium on Computer architecture. 289--300.
[33]
Nathaniel Herman, Jeevana Priya Inala, Yihe Huang, Lillian Tsai, Eddie Kohler, Barbara Liskov, and Liuba Shrira. 2016. Type-aware transactions for faster concurrent code. In Proceedings of the Eleventh European Conference on Computer Systems. 1--16.
[34]
Hsiang-Tsung Kung and John T Robinson. 1981. On optimistic methods for concurrency control. ACM Transactions on Database Systems (TODS) 6, 2 (1981), 213--226.
[35]
Pierre LaBorde, Lance Lebanoff, Christina Peterson, Deli Zhang, and Damian Dechev. 2019. Wait-free dynamic transactions for linked data structures. In Proceedings of the 10th International Workshop on Programming Models and Applications for Multicores and Manycores. 41--50.
[36]
Paul E McKenney and John D Slingwine. 1998. Read-copy update: Using execution history to solve concurrency problems. In Parallel and Distributed Computing and Systems, Vol. 509518.
[37]
Mojtaba Mehrara, Jeff Hao, Po-Chun Hsu, and Scott Mahlke. 2009. Parallelizing sequential applications on commodity hardware using a low-cost software transactional memory. ACM Sigplan Notices 44, 6 (2009), 166--176.
[38]
Donald Nguyen, Andrew Lenharth, and Keshav Pingali. 2014. Deterministic Galois: On-demand, portable and parameterless. ACM SIGPLAN Notices 49, 4 (2014), 499--512.
[39]
Dmitri Perelman, Rui Fan, and Idit Keidar. 2010. On maintaining multiple versions in STM. In Proceedings of the 29th ACM SIGACT-SIGOPS symposium on Principles of distributed computing. 16--25.
[40]
Kaushik Ravichandran, Ada Gavrilovska, and Santosh Pande. 2014. DeSTM: harnessing determinism in STMs for application development. In Proceedings of the 23rd international conference on Parallel architectures and compilation. 213--224.
[41]
Torvald Riegel, Pascal Felber, and Christof Fetzer. 2006. A lazy snapshot algorithm with eager validation. In International Symposium on Distributed Computing. Springer, 284--298.
[42]
Hamza Rihani, Peter Sanders, and Roman Dementiev. 2015. Multi-queues: Simple relaxed concurrent priority queues. In Proceedings of the 27th ACM symposium on Parallelism in Algorithms and Architectures. 80--82.
[43]
Pingcheng Ruan, Dumitrel Loghin, Quang-Trung Ta, Meihui Zhang, Gang Chen, and Beng Chin Ooi. 2020. A transactional perspective on execute-order-validate blockchains. In Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data. 543--557.
[44]
Mohamed M Saad, Masoomeh Javidi Kishi, Shihao Jing, Sandeep Hans, and Roberto Palmieri. 2019. Processing transactions in a predefined order. In Proceedings of the 24th Symposium on Principles and Practice of Parallel Programming. 120--132.
[45]
Ankur Sharma, Felix Martin Schuhknecht, Divya Agrawal, and Jens Dittrich. 2019. Blurring the lines between blockchains and database systems: the case of hyperledger fabric. In Proceedings of the 2019 International Conference on Management of Data. 105--122.
[46]
Nir Shavit and Dan Touitou. 1997. Software transactional memory. Distributed Computing 10, 2 (1997), 99--116.
[47]
Julian Shun, Guy E Blelloch, Jeremy T Fineman, Phillip B Gibbons, Aapo Kyrola, Harsha Vardhan Simhadri, and Kanat Tangwongsan. 2012. Brief announcement: the problem based benchmark suite. In Proceedings of the twenty-fourth annual ACM symposium on Parallelism in algorithms and architectures. 68--70.
[48]
Alexander Spiegelman, Guy Golan-Gueta, and Idit Keidar. 2016. Transactional data structure libraries. ACM SIGPLAN Notices 51, 6 (2016), 682--696.
[49]
The Aptos Team. [n.d.]. BlockStm: Aptos parallel execution engine. https://medium.com/aptoslabs/block-stm-how-we-execute-over-160k-transactions-per-second-on-the-aptos-blockchain-3b003657e4ba.
[50]
The DiemBFT Team. 2021. State machine replication in the Diem Blockchain. https://developers.diem.com/docs/technical-papers/state-machine- replication-paper.
[51]
Alexander Thomson, Thaddeus Diamond, Shu-Chun Weng, Kun Ren, Philip Shao, and Daniel J. Abadi. 2012. Calvin: Fast Distributed Transactions for Partitioned Database Systems. In SIGMOD.
[52]
Tiago M Vale, João A Silva, Ricardo J Dias, and João M Lourenço. 2016. Pot: Deterministic transactional execution. ACM Transactions on Architecture and Code Optimization (TACO) 13, 4 (2016), 1--24.
[53]
Christoph Von Praun, Luis Ceze, and Calin Caşcaval. 2007. Implicit parallelism with ordered transactions. In Proceedings of the 12th ACM SIGPLAN symposium on Principles and practice of parallel programming. 79--89.
[54]
Maximilian Wohrer and Uwe Zdun. 2018. Smart contracts: security patterns in the ethereum ecosystem and solidity. In 2018 International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2--8.
[55]
Yu Xia, Xiangyao Yu, William Moses, Julian Shun, and Srinivas Devadas. 2019. LiTM: A Lightweight Deterministic Software Transactional Memory System. In Proceedings of the 10th International Workshop on Programming Models and Applications for Multicores and Many-cores. 1--10.

Cited By

View all
  • (2024)POSTER: OCToPus: Semantic-aware Concurrency Control for Blockchain TransactionsProceedings of the 29th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming10.1145/3627535.3638494(463-465)Online publication date: 2-Mar-2024
  • (2024)Parallel Transaction Execution in Blockchain and the Ambiguous State Representation Problem2024 19th European Dependable Computing Conference (EDCC)10.1109/EDCC61798.2024.00035(131-138)Online publication date: 8-Apr-2024
  • (2023)When Concurrency Matters: Behaviour-Oriented ConcurrencyProceedings of the ACM on Programming Languages10.1145/36228527:OOPSLA2(1531-1560)Online publication date: 16-Oct-2023
  • Show More Cited By

Index Terms

  1. Block-STM: Scaling Blockchain Execution by Turning Ordering Curse to a Performance Blessing

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      PPoPP '23: Proceedings of the 28th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming
      February 2023
      480 pages
      ISBN:9798400700156
      DOI:10.1145/3572848
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      Sponsors

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 21 February 2023

      Permissions

      Request permissions for this article.

      Check for updates

      Badges

      Author Tags

      1. STM
      2. blockchain
      3. parallel execution

      Qualifiers

      • Research-article

      Conference

      PPoPP '23

      Acceptance Rates

      Overall Acceptance Rate 230 of 1,014 submissions, 23%

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)309
      • Downloads (Last 6 weeks)19
      Reflects downloads up to 16 Oct 2024

      Other Metrics

      Citations

      Cited By

      View all
      • (2024)POSTER: OCToPus: Semantic-aware Concurrency Control for Blockchain TransactionsProceedings of the 29th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming10.1145/3627535.3638494(463-465)Online publication date: 2-Mar-2024
      • (2024)Parallel Transaction Execution in Blockchain and the Ambiguous State Representation Problem2024 19th European Dependable Computing Conference (EDCC)10.1109/EDCC61798.2024.00035(131-138)Online publication date: 8-Apr-2024
      • (2023)When Concurrency Matters: Behaviour-Oriented ConcurrencyProceedings of the ACM on Programming Languages10.1145/36228527:OOPSLA2(1531-1560)Online publication date: 16-Oct-2023
      • (2023)Exploring Locality in Ethereum Transactions2023 5th Conference on Blockchain Research & Applications for Innovative Networks and Services (BRAINS)10.1109/BRAINS59668.2023.10317054(1-8)Online publication date: 11-Oct-2023
      • (2023)Aion: Secure Transaction Ordering Using TEEsComputer Security – ESORICS 202310.1007/978-3-031-51482-1_17(332-350)Online publication date: 25-Sep-2023
      • (2023)Executing and Proving Over Dirty LedgersFinancial Cryptography and Data Security10.1007/978-3-031-47754-6_1(3-20)Online publication date: 1-May-2023
      • (2023)DeFi and NFTs Hinder Blockchain ScalabilityFinancial Cryptography and Data Security10.1007/978-3-031-47751-5_17(291-309)Online publication date: 1-May-2023
      • (2023)DAG-Based Efficient Parallel Scheduler for Blockchains: Hyperledger Sawtooth as a Case StudyEuro-Par 2023: Parallel Processing10.1007/978-3-031-39698-4_13(184-198)Online publication date: 28-Aug-2023

      View Options

      Get Access

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media