Groundhog: Linearly-Scalable Smart Contracting via Commutative Transaction Semantics (2404.03201v1)
Abstract: Groundhog is a novel design for a smart contract execution engine based around concurrent execution of blocks of transactions. Unlike prior work, transactions within a block in Groundhog are not ordered relative to one another. Instead, our key design insights are first, to design a set of commutative semantics that lets the Groundhog runtime deterministically resolve concurrent accesses to shared data. Second, some storage accesses (such as withdrawing money from an account) conflict irresolvably; Groundhog therefore enforces validity constraints on persistent storage accesses via a reserve-commit process. These two ideas give Groundhog a set of semantics that, while not as powerful as traditional sequential semantics, are flexible enough to implement a wide variety of important applications, and are strictly more powerful than the semantics used in some production blockchains today. Unlike prior smart contract systems, transactions throughput never suffers from contention between transactions. Using 96 CPU cores, Groundhog can process more than half a million payment transactions per second, whether between 10M accounts or just 2.
- Cow protocol overview: The batch auction optimization problem. https://web.archive.org/web/20220614183101/https://docs.cow.fi/off-chain-services/in-depth-solver-specification/the-batch-auction-optimization-problem. Accessed 10/19/2022.
- The maker protocol: Makerdao’s multi-collateral dai (mcd) system. https://makerdao.com/en/whitepaper/. Accessed 12/14/2021.
- The penumbra protocol: Sealed-bid batch swaps. https://web.archive.org/web/20220614034906/https://protocol.penumbra.zone/main/zswap/swap.html. Accessed 10/19/2022.
- Solana documentation: Rent. https://web.archive.org/web/20220903121658/https://docs.solana.com/implemented-proposals/rent.
- A technical introduction to the serum dex. https://web.archive.org/web/20221112173940/https://docs.google.com/document/d/1isGJES4jzQutI0GtQGuqtrBUqeHxl_xJNXdtOv4SdII/edit. Accessed 12/11/22.
- wasm3: The fastest webassembly interpreter, and the most universal runtime. https://github.com/wasm3/wasm3.
- Loopring 3 design doc. https://web.archive.org/web/20220411224154/https://github.com/Loopring/protocols/blob/master/packages/loopring_v3/DESIGN.md#results, 2021.
- Compound iii docs. https://docs.compound.finance/, 2022.
- Cosmwasm documentation: Actor model for contract calls. https://web.archive.org/web/20220811195538/https://docs.cosmwasm.com/docs/1.0/architecture/actor/, 2022.
- Near documentation: Cross-contract calls. https://web.archive.org/web/20221021051657/https://docs.near.org/develop/contracts/crosscontract, 2022.
- Wasm-instrument: Instrument and transform wasm modules. https://github.com/paritytech/wasm-instrument, 2022.
- Compound finance. https://web.archive.org/web/20230414212550/https://compound.finance/, 2023. Accessed 04/14/2023.
- Uniswap v2 core. 2020.
- Improved price oracles: Constant function market makers. In Proceedings of the 2nd ACM Conference on Advances in Financial Technologies, pages 80–91, 2020.
- Efficient concurrent execution of smart contracts in blockchains using object-based transactional memory. In International Conference on Networked Systems, pages 77–93. Springer, 2020.
- An efficient framework for optimistic concurrent execution of smart contracts. In 2019 27th Euromicro International Conference on Parallel, Distributed and Network-Based Processing (PDP), pages 83–92. IEEE, 2019.
- Prism: Deconstructing the blockchain to approach physical limits. In Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, pages 585–602, 2019.
- A true concurrent model of smart contracts executions. In International Conference on Coordination Languages and Models, pages 243–260. Springer, 2020.
- Vitalik Buterin. A state expiry and statelessness roadmap. https://web.archive.org/web/20220916204724/https://notes.ethereum.org/@vbuterin/verkle_and_state_expiry_proposal, 2021.
- Practical byzantine fault tolerance. In 3rd Symposium on Operating Systems Design and Implementation, pages 173–186, New Orleans, LA, February 1999.
- Forerunner: Constraint-based speculative transaction execution for ethereum (full version). 2021.
- The scalable commutativity rule: Designing scalable software for multicore processors. ACM Transactions on Computer Systems (TOCS), 32(4):1–47, 2015.
- Clockwork: An exchange protocol for proofs of non front-running.
- CoinGecko. Cryptocurrency prices by market cap. https://web.archive.org/web/20221210015628/https://www.coingecko.com/.
- Flash boys 2.0: Frontrunning, transaction reordering, and consensus instability in decentralized exchanges. arXiv preprint arXiv:1904.05234, 2019.
- Narwhal and tusk: a dag-based mempool and efficient bft consensus. In Proceedings of the Seventeenth European Conference on Computer Systems, pages 34–50, 2022.
- Efficient cross-shard transaction execution in sharded blockchains. arXiv preprint arXiv:2007.14521, 2020.
- Understanding and effectively preventing the aba problem in descriptor-based lock-free designs. In 2010 13th IEEE international symposium on object/component/service-oriented real-time distributed computing, pages 185–192. IEEE, 2010.
- Adding concurrency to smart contracts. Distributed Computing, pages 1–17, 2019.
- OpenZeppelin Documentation. Erc20. https://docs.openzeppelin.com/contracts/2.x/api/token/erc20. Accessed 12/10/22.
- Rethinking serializable multiversion concurrency control. arXiv preprint arXiv:1412.2324, 2014.
- Utilizing parallelism in smart contracts on decentralized blockchains by taming application-inherent conflicts. arXiv preprint arXiv:2201.03749, 2022.
- Block-stm: Scaling blockchain execution by turning ordering curse to a performance blessing. In Proceedings of the 28th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming, pages 232–244, 2023.
- Algorand: Scaling byzantine agreements for cryptocurrencies. In Proceedings of the 26th Symposium on Operating Systems Principles, SOSP ’17, page 51–68, New York, NY, USA, 2017. Association for Computing Machinery.
- On the optionality and fairness of atomic swaps. In Proceedings of the 1st ACM Conference on Advances in Financial Technologies, pages 62–75, 2019.
- A universal modular actor formalism for artificial intelligence. In Advance Papers of the Conference, volume 3, page 235. Stanford Research Institute Menlo Park, CA, 1973.
- Graydon Hoare. Core advancement protocol 46-05: Smart contract data. https://web.archive.org/web/20221212214501/https://github.com/stellar/stellar-protocol/blob/master/core/cap-0046-05.md, May 2022.
- An event driven framework for smart contract execution. In Proceedings of the 15th ACM International Conference on Distributed and Event-based Systems, pages 78–89, 2021.
- Arbitrum: Scalable, private smart contracts. In 27th {normal-{\{{USENIX}normal-}\}} Security Symposium ({normal-{\{{USENIX}normal-}\}} Security 18), pages 1353–1370, 2018.
- All about eve: Execute-verify replication for multi-core servers. In Presented as part of the 10th {normal-{\{{USENIX}normal-}\}} Symposium on Operating Systems Design and Implementation ({normal-{\{{OSDI}normal-}\}} 12), pages 237–250, 2012.
- All you need is dag. In Proceedings of the 2021 ACM Symposium on Principles of Distributed Computing, pages 165–175, 2021.
- Order-fairness for byzantine consensus. In Annual International Cryptology Conference, pages 451–480. Springer, 2020.
- Compound: The money market protocol. White Paper, 2019.
- Automating the choice of consistency levels in replicated systems. In 2014 USENIX Annual Technical Conference (USENIX ATC 14), pages 281–292, 2014.
- Making {{\{{Geo-Replicated}}\}} systems fast as possible, consistent when necessary. In 10th USENIX Symposium on Operating Systems Design and Implementation (OSDI 12), pages 265–278, 2012.
- Fine-grained consistency for geo-replicated systems. In 2018 USENIX Annual Technical Conference (USENIX ATC 18), pages 359–372, 2018.
- Operation-level concurrent transaction execution for blockchains. arXiv preprint arXiv:2211.07911, 2022.
- Don’t settle for eventual: Scalable causal consistency for wide-area storage with cops. In Proceedings of the Twenty-Third ACM Symposium on Operating Systems Principles, pages 401–416, 2011.
- Fast and secure global payments with stellar. In Proceedings of the 27th ACM Symposium on Operating Systems Principles, SOSP ’19, page 80–96, New York, NY, USA, 2019. Association for Computing Machinery.
- Hamilton: A High-Performance transaction processor for central bank digital currencies. In 20th USENIX Symposium on Networked Systems Design and Implementation (NSDI 23), pages 901–915, Boston, MA, April 2023. USENIX Association.
- Satoshi Nakamoto. Bitcoin: A peer-to-peer electronic cash system, 2008. http://bitcoin.org/bitcoin.pdf.
- Plasma: Scalable autonomous smart contracts. White paper, pages 1–47, 2017.
- The bitcoin lightning network: Scalable off-chain instant payments, 2016.
- Handling highly contended oltp workloads using fast dynamic partitioning. In Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data, pages 527–542, 2020.
- Bidl: A high-throughput, low-latency permissioned blockchain framework for datacenter networks. In Proceedings of the ACM SIGOPS 28th Symposium on Operating Systems Principles, SOSP ’21, page 18–34, New York, NY, USA, 2021. Association for Computing Machinery.
- Quantifying blockchain extractable value: How dark is the forest? In 2022 IEEE Symposium on Security and Privacy (SP), pages 198–214. IEEE, 2022.
- Fair ordering via streaming social choice theory. arXiv preprint arXiv:2304.02730, 2023.
- SPEEDEX: A scalable, parallelizable, and economically efficient decentralized EXchange. In 20th USENIX Symposium on Networked Systems Design and Implementation (NSDI 23), pages 849–875, Boston, MA, April 2023. USENIX Association.
- A transactional perspective on execute-order-validate blockchains. In Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data, pages 543–557, 2020.
- An empirical study of speculative concurrency in ethereum smart contracts. arXiv preprint arXiv:1901.01376, 2019.
- Leopold Schabel. Reflections on solana’s sept 14 outage. https://web.archive.org/web/20211104012332/https://jumpcrypto.com/reflections-on-the-sept-14-solana-outage/, Oct 2021. Accessed 12/7/2021.
- Secure causal atomic broadcast, 2021.
- Conflict-free replicated data types. In Symposium on Self-Stabilizing Systems, pages 386–400. Springer, 2011.
- Basil: Breaking up bft with acid (transactions). In Proceedings of the ACM SIGOPS 28th Symposium on Operating Systems Principles, pages 1–17, 2021.
- NEAR Team. Near launches nightshade sharding, paving the way for mass adoption. https://web.archive.org/web/20221007081239/https://near.org/blog/near-launches-nightshade-sharding-paving-the-way-for-mass-adoption/, November 2021. Accessed 10/18/2022.
- SundaeSwap Team. Sundaeswap scalability. https://web.archive.org/web/20220523234648/https://sundaeswap.finance/posts/sundaeswap-scalability, November 2021.
- Erc20 api: An attack vector on the approve/transferfrom methods. https://web.archive.org/web/20221108114451/https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/edit.
- Eip 20: Erc-20 token standard. Ethereum Improvement Proposals, 20, 2015.
- Tom Walther. An optimization model for multi-asset batch auctions with uniform clearing prices. In Operations Research Proceedings 2018: Selected Papers of the Annual International Conference of the German Operations Research Society (GOR), Brussels, Belgium, September 12-14, 2018, pages 225–231. Springer, 2019.
- 0x: An open protocol for decentralized exchange on the ethereum blockchain. 2017.
- Gavin Wood. Polkadot: Vision for a heterogeneous multi-chain framework. White Paper, 21, 2016.
- Litm: a lightweight deterministic software transactional memory system. In Proceedings of the 10th International Workshop on Programming Models and Applications for Multicores and Manycores, pages 1–10, 2019.
- Hotstuff: Bft consensus with linearity and responsiveness. In Proceedings of the 2019 ACM Symposium on Principles of Distributed Computing, PODC ’19, page 347–356, New York, NY, USA, 2019. Association for Computing Machinery.
- A parallel smart contract model. In Proceedings of the 2018 International Conference on Machine Learning and Machine Intelligence, pages 72–77, 2018.
- Flash freezing flash boys: Countering blockchain front-running. In The Workshop on Decentralized Internet, Networks, Protocols, and Systems (DINPS), 2022.
- Skychain: A deep reinforcement learning-empowered dynamic blockchain sharding system. In 49th International Conference on Parallel Processing-ICPP, pages 1–11, 2020.
- Byzantine ordered consensus without byzantine oligarchy. In 14th {normal-{\{{USENIX}normal-}\}} Symposium on Operating Systems Design and Implementation ({normal-{\{{OSDI}normal-}\}} 20), pages 633–649, 2020.