EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.27k stars 3.6k forks source link

How to solve "Single-Machine apply Contracts" problem? #1507

Closed xtlx2000 closed 6 years ago

xtlx2000 commented 6 years ago

hello, I am a dapp developer, and I saw EOS use a single thread to apply all contracts right now, but this cannot afford a lot of dapp above even though multi-thread in single machine, so how eos to solve this problem? thanks.

wanderingbort commented 6 years ago

The problem of multiple distinct execution nodes is tricky for reasons of trust and data contention.

We have 2 planned solutions, one of which is very close to reality and we intend to prove that in the next testnet release.

The most naive solution is side chains which we have first class support for. DPoS sidesteps a lot of concerns about side chains and malicious miners from the PoW world, all we need is the ability to prove finality and retirement of actions for a remote blockchain to be able to accept our transactions as native message. This is done through inter-blockchain-communication described here: https://steemit.com/eos/@dan/inter-blockchain-communication-via-merkle-proofs-with-eos-io

A more efficient solution is achievable with some other source of trust. We call this regions and it's a feature we have left doors open for but, is not planned for the initial release. In this solution, you use the same producers and the same blockchain but you have completely isolated regions of data and contracts. Each of these regions can run on a new node giving you horizontal scaling with in a producers cluster. This only works if the producer can trust their whole cluster but is otherwise not much different than the single node producer. This is more efficient because instead of trustlessly proving communication between regions, an producer can implicitly trust their cluster of nodes (at least as much as they trust their main node)

There are more nuances of course but these are the high level views of the 2 solutions at hand.

On Mar 1, 2018 5:08 AM, "Pengcheng Lv" notifications@github.com wrote:

hello, I am a dapp developer, and I saw EOS use a single thread to apply all contracts right now, but this cannot afford a lot of dapp above even though multi-thread in single machine, so how eos to solve this problem? thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/EOSIO/eos/issues/1507, or mute the thread https://github.com/notifications/unsubscribe-auth/ACYR4o90SMmMcdLoygUbdOHxyev-9CvTks5tZ8i5gaJpZM4SYDcT .