Skip to main content
Erschienen in: Distributed Computing 3-4/2020

06.07.2019

Adding concurrency to smart contracts

verfasst von: Thomas Dickerson, Paul Gazzillo, Maurice Herlihy, Eric Koskinen

Erschienen in: Distributed Computing | Ausgabe 3-4/2020

Einloggen

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

Modern cryptocurrency systems, such as the Ethereum project, 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. We have proved that the validator’s execution is equivalent to miner’s execution. Smart contract benchmarks run on a JVM with ScalaSTM show that a speedup of 1.39\(\times \) can be obtained for miners and 1.59\(\times \) for validators with just three concurrent threads.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Fußnoten
1
Following blockchain terminology, a transaction is a payment or set of payments, not an atomic unit of synchronization as in databases or transactional memory.
 
2
This description omits many important issues, such as incentives, forking, and fork resolution.
 
4
For ease of exposition, abstract locks are mutually exclusive, although it is not hard to accommodate shared and exclusive modes.
 
5
The Push/Pull model is more general, allowing code outside of a transaction.
 
6
For brevity, we rely on the reader’s intuition of commutativity rather than reiterating the formalization here.
 
8
A transaction costs 21,000 gas plus the gas for the computation [24]. The gas limit on block 3,110,235 (latest as of writing) was 4,005,875, a maximum close to 200.
 
Literatur
1.
Zurück zum Zitat Androulaki, E., Barger, A., Bortnikov, V., Cachin, C., Christidis, K., De Caro, A., Enyeart, D., Ferris, C., Laventman, G., Manevich, Y., et al.: Hyperledger fabric: a distributed operating system for permissioned blockchains. In: Proceedings of the Thirteenth EuroSys Conference, ACM, p. 30 (2018) Androulaki, E., Barger, A., Bortnikov, V., Cachin, C., Christidis, K., De Caro, A., Enyeart, D., Ferris, C., Laventman, G., Manevich, Y., et al.: Hyperledger fabric: a distributed operating system for permissioned blockchains. In: Proceedings of the Thirteenth EuroSys Conference, ACM, p. 30 (2018)
2.
Zurück zum Zitat Blumofe, R.D., Joerg, C.F., Kuszmaul, B.C., Leiserson, C.E., Randall, K.H., Zhou, Y.: Cilk: an efficient multithreaded runtime system. In: Proceedings of the Fifth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPOPP ’95, ACM, New York, NY, USA, pp. 207–216 (1995). https://doi.org/10.1145/209936.209958 Blumofe, R.D., Joerg, C.F., Kuszmaul, B.C., Leiserson, C.E., Randall, K.H., Zhou, Y.: Cilk: an efficient multithreaded runtime system. In: Proceedings of the Fifth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPOPP ’95, ACM, New York, NY, USA, pp. 207–216 (1995). https://​doi.​org/​10.​1145/​209936.​209958
4.
Zurück zum Zitat Bronson, N.G., Casper, J., Chafi, H., Olukotun, K.: Transactional predication: high-performance concurrent sets and maps for stm. In: Proceedings of the 29th ACM SIGACT-SIGOPS Symposium on Principles of Distributed Computing, PODC ’10, ACM, New York, NY, USA, pp. 6–15 (2010). https://doi.org/10.1145/1835698.1835703 Bronson, N.G., Casper, J., Chafi, H., Olukotun, K.: Transactional predication: high-performance concurrent sets and maps for stm. In: Proceedings of the 29th ACM SIGACT-SIGOPS Symposium on Principles of Distributed Computing, PODC ’10, ACM, New York, NY, USA, pp. 6–15 (2010). https://​doi.​org/​10.​1145/​1835698.​1835703
7.
Zurück zum Zitat DAO: Thedao smart contract. Retrieved 8 February (2017) DAO: Thedao smart contract. Retrieved 8 February (2017)
11.
Zurück zum Zitat Herlihy, M., Koskinen, E.: Transactional boosting: a methodology for highly-concurrent transactional objects. In: Proceedings of the 13th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP ’08, ACM, New York, NY, USA, pp. 207–216 (2008). https://doi.org/10.1145/1345206.1345237 Herlihy, M., Koskinen, E.: Transactional boosting: a methodology for highly-concurrent transactional objects. In: Proceedings of the 13th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP ’08, ACM, New York, NY, USA, pp. 207–216 (2008). https://​doi.​org/​10.​1145/​1345206.​1345237
12.
Zurück zum Zitat Herlihy, M., Luchangco, V., Moir, M., Scherer III, W.N.: Software transactional memory for dynamic-sized data structures. In: Proceedings of the Twenty-second Annual Symposium on Principles of Distributed Computing, PODC ’03, ACM, New York, NY, USA, pp. 92–101 (2003). https://doi.org/10.1145/872035.872048 Herlihy, M., Luchangco, V., Moir, M., Scherer III, W.N.: Software transactional memory for dynamic-sized data structures. In: Proceedings of the Twenty-second Annual Symposium on Principles of Distributed Computing, PODC ’03, ACM, New York, NY, USA, pp. 92–101 (2003). https://​doi.​org/​10.​1145/​872035.​872048
13.
Zurück zum Zitat Herman, N., Inala, J.P., Huang, Y., Tsai, L., Kohler, E., Liskov, B., Shrira, L.: Type-aware transactions for faster concurrent code. In: Proceedings of the Eleventh European Conference on Computer Systems, EuroSys ’16, ACM, New York, NY, USA, pp. 31:1–31:16 (2016). https://doi.org/10.1145/2901318.2901348 Herman, N., Inala, J.P., Huang, Y., Tsai, L., Kohler, E., Liskov, B., Shrira, L.: Type-aware transactions for faster concurrent code. In: Proceedings of the Eleventh European Conference on Computer Systems, EuroSys ’16, ACM, New York, NY, USA, pp. 31:1–31:16 (2016). https://​doi.​org/​10.​1145/​2901318.​2901348
15.
Zurück zum Zitat Kosba, A.E., Miller, A., Shi, E., Wen, Z., Papamanthou, C.: Hawk: the blockchain model of cryptography and privacy-preserving smart contracts. In: IEEE Symposium on Security and Privacy (2015) Kosba, A.E., Miller, A., Shi, E., Wen, Z., Papamanthou, C.: Hawk: the blockchain model of cryptography and privacy-preserving smart contracts. In: IEEE Symposium on Security and Privacy (2015)
16.
Zurück zum Zitat Koskinen, E., Parkinson, M.J.: The push/pull model of transactions. In: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’15), Portland, OR, USA. ACM (2015) Koskinen, E., Parkinson, M.J.: The push/pull model of transactions. In: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’15), Portland, OR, USA. ACM (2015)
17.
Zurück zum Zitat Luu, L., Chu, D., Olickel, H., Saxena, P., Hobor, A.: Making smart contracts smarter. In: Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, Vienna, Austria, October 24–28, pp. 254–269 (2016) Luu, L., Chu, D., Olickel, H., Saxena, P., Hobor, A.: Making smart contracts smarter. In: Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, Vienna, Austria, October 24–28, pp. 254–269 (2016)
18.
Zurück zum Zitat Luu, L., Teutsch, J., Kulkarni, R., Saxena, P.: Demystifying incentives in the consensus computer. In: Proceedings of the 22Nd ACM SIGSAC Conference on Computer and Communications Security, CCS ’15, ACM, New York, NY, USA, pp. 706–719 (2015). https://doi.org/10.1145/2810103.2813659 Luu, L., Teutsch, J., Kulkarni, R., Saxena, P.: Demystifying incentives in the consensus computer. In: Proceedings of the 22Nd ACM SIGSAC Conference on Computer and Communications Security, CCS ’15, ACM, New York, NY, USA, pp. 706–719 (2015). https://​doi.​org/​10.​1145/​2810103.​2813659
Metadaten
Titel
Adding concurrency to smart contracts
verfasst von
Thomas Dickerson
Paul Gazzillo
Maurice Herlihy
Eric Koskinen
Publikationsdatum
06.07.2019
Verlag
Springer Berlin Heidelberg
Erschienen in
Distributed Computing / Ausgabe 3-4/2020
Print ISSN: 0178-2770
Elektronische ISSN: 1432-0452
DOI
https://doi.org/10.1007/s00446-019-00357-z

Weitere Artikel der Ausgabe 3-4/2020

Distributed Computing 3-4/2020 Zur Ausgabe

Premium Partner