Adding Concurrency to Smart Contracts

Preprint English OPEN
Dickerson, Thomas ; Gazzillo, Paul ; Herlihy, Maurice ; Koskinen, Eric (2017)
  • Subject: Computer Science - Distributed, Parallel, and Cluster Computing

Modern cryptocurrency systems, such as Ethereum, permit complex financial transactions through scripts called smart contracts. These smart contracts are executed many, many times, always without real concurrency. First, all smart contracts are serially executed by miners before appending them to the blockchain. Later, those contracts are serially re-executed by validators to verify that the smart contracts were executed correctly by miners. Serial execution limits system throughput and fails to exploit today's concurrent multicore and cluster architectures. Nevertheless, serial execution appears to be required: contracts share state, and contract programming languages have a serial semantics. This paper presents a novel way to permit miners and validators to execute smart contracts in parallel, based on techniques adapted from software transactional memory. Miners execute smart contracts speculatively in parallel, allowing non-conflicting contracts to proceed concurrently, and "discovering" a serializable concurrent schedule for a block's transactions, This schedule is captured and encoded as a deterministic fork-join program used by validators to re-execute the miner's parallel schedule deterministically but concurrently. Smart contract benchmarks run on a JVM with ScalaSTM show that a speedup of of 1.33x can be obtained for miners and 1.69x for validators with just three concurrent threads.
  • References (14)
    14 references, page 1 of 2

    [1] R. D. Blumofe, C. F. Joerg, B. C. Kuszmaul, C. E. Leiserson, K. H. Randall, and Y. Zhou. Cilk: An e cient multithreaded runtime system. In Proceedings of the Fifth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPOPP '95, pages 207{216, New York, NY, USA, 1995. ACM.

    [2] R. L. Bocchino, Jr., V. S. Adve, S. V. Adve, and M. Snir. Parallel programming must be deterministic by default. In Proceedings of the First USENIX Conference on Hot Topics in Parallelism, HotPar'09, pages 4{4, Berkeley, CA, USA, 2009. USENIX Association.

    [3] N. G. Bronson, J. Casper, H. Cha , and K. Olukotun. Transactional predication: Highperformance concurrent sets and maps for stm. In Proceedings of the 29th ACM SIGACTSIGOPS Symposium on Principles of Distributed Computing, PODC '10, pages 6{15, New York, NY, USA, 2010. ACM.

    [4] DAO. Thedao smart contract. Retrieved 8 February 2017.

    [5] K. Delmolino, M. Arnett, A. Kosba, A. Miller, and E. Shi. Step by Step Towards Creating a Safe Smart Contract: Lessons and Insights from a Cryptocurrency Lab, pages 79{94. Springer Berlin Heidelberg, Berlin, Heidelberg, 2016.

    [6] Ethereum.

    [14] E. Koskinen, M. J. Parkinson, and M. Herlihy. Coarse-grained transactions. In Proceedings of the 37th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'10), pages 19{30. ACM, 2010.

    [15] L. Luu, D. Chu, H. Olickel, P. Saxena, and A. Hobor. Making smart contracts smarter. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, Vienna, Austria, October 24-28, 2016, pages 254{269, 2016.

    [16] L. Luu, J. Teutsch, R. Kulkarni, and P. Saxena. Demystifying incentives in the consensus computer. In Proceedings of the 22Nd ACM SIGSAC Conference on Computer and Communications Security, CCS '15, pages 706{719, New York, NY, USA, 2015. ACM.

    [17] S. Nakamoto. Bitcoin: A peer-to-peer electronic cash system. May 2009.

  • Metrics
    No metrics available
Share - Bookmark