Scalabilty of code execution

avsaavsa Posts: 68Member ✭✭
I'm sorry if this is the wrong forum to ask because I'm not versed well enough in the code to understand it, but how Ethereum manages scalability of the code?

Suppose Ethereum becomes as big as twitter, facebook, google (or even all of them), does it means that every computer connected to it has to run all the commands that are executed, and have to be as powerful as a google data center? Of course serving media and files wouldn't be in the Ethereum scope as those could be served by torrents, but code execution itself, passing data around, would. And since code is reexecute in all machines, it's not that the total network would have to be as powerful as twitter + google + facebook data centers, it's that every single node has to be as powerful as the total sum of them!

Of course this would be rather silly, so I'm missing something here: what is it?


  • chris613chris613 Posts: 93Member ✭✭
    I don't think you're missing anything, this is one of the big unknowns about the current design - how well will it scale? I think the short term answer is that given the volume of transactions (based on current bitcoin usage as a starting point), solving the nonce is orders more time consuming than executing the contracts. Long term - who knows.
  • JasperJasper Eindhoven, the NetherlandsPosts: 514Member ✭✭✭
    edited April 2014
    If you up the fees, presumably eventually you'll push people to write more efficient versions or use it less. That said, there may be stickness to it.. It is better if there is a more effective solution :)

    Lets say we're willing to put 1GHz at it, and it takes 50 instructions to do a single ethereum command, and a typical contract does 100 of them, each person using such contract once a day, then we can deal with 200k people.. A rough estimate, probably really at the low end..
    Post edited by Jasper on
  • simenrangersimenranger Posts: 24Member
    edited April 2014
    @Jasper, how do you get to that? If I conservely estimate a contract to be 1.000.000 instruction, you get a 1000 contracts per second with 1 GHz CPU. During 24h, that is around 80 million contract executions.
    Post edited by simenranger on
  • avsaavsa Posts: 68Member ✭✭
    I have no idea how many people use twitter or google everyday but I'm pretty sure I can't afford a computer that could execute all their instructions.. This means that either:

    1) ethereum will be too expensive to do anything more than a few very simple financial contracts as a decentralized twitter will spend millions reading tweets

    2) ethereum mining will be done only by very high end dedicated computers, having the same centralization issue as ASICs

    3) both of those.

  • JasperJasper Eindhoven, the NetherlandsPosts: 514Member ✭✭✭
    @simenranger: Messed up by not counting the seconds in a day. Think 1M instructions is a bit high estimate? Tbh i dont know :)

    @avsa: yes, but there is very little reason to actually put a twitter in ethereum.
  • avsaavsa Posts: 68Member ✭✭
    @Jasper? Why? I see ethereum as a platform for decentralized apps. The most mentioned app is Namecoin, but why not bit message? Twitter is used around the world to organize protests and governments everywhere have banned it, so are you telling me you can't see why a unblock able, uncensorable twitter can't be useful?
  • JasperJasper Eindhoven, the NetherlandsPosts: 514Member ✭✭✭
    @avsa because other technologies are better for sharing the data, and contracts probably cant make good enough use of the tweets, and/or can use shorter references to it. Seen gavins blog post? He mentions three sides: one is a consensus-ledger.(ethereum) The two others are distributed storage(like freenet and bittorrent, this would also deal with large files), and hard-to censor/deanonymize communication.(like TOR hidden services) (think maidsafe tries to cover both)

    I think quite a lot can be turned into distributed storage, it is a matter of putting the processing on the side of the user. And it doesnt take any setting up of servers, so it would probably be more convenient. But i dont know how a twitter would work. Actually i think it is better to try conceive how a forum would work, less bagage.
  • avsaavsa Posts: 68Member ✭✭
    @Jasper? forum or twitter all the same: even if we imagine that ethereum isn't keeping the database of messages and that's in some sort of peer db, ethereum would still be used for processing the messages and consolidating them, where the scalability problems becomes relevant again...
  • mimarobmimarob Posts: 33Member
    Hmm, I think ethereum would be used to pay the data keepers for the forum messages. At certain points a contract could be triggered to check if anyone has a certain message. The first client that comes up with the correct checksum would be rewarded but all the large data keeping will be kept off-ethereum. There is a thread here somewhere that discusses the possible usage of ethereum as an incentivising mechanism for file storage. The big data traffic does not need to pass through ethereum.
  • avsaavsa Posts: 68Member ✭✭
    Still, every computer has to process all nodes. Maybe I'm overestimating the task, but if there are a million messages sent in a day for a service like a forum/tiwtter/reddit, and my computer has to figure out who can see each one, what order they appear, which are moderated etc, for each different service, for all apps in ethereum, it sounds like a huge task.
  • StephanTualStephanTual London, EnglandPosts: 1,282Member, Moderator mod
    The current upper limit (hardcoded) is 1M gas/minute. As of POC4, since we are running unoptimized debug builds we are unlikely to hit that number.

    As per Gav Wood comments in a discussion we had with him on skype, we're just not going to know how much computation we can do without some decent modeling and/or empirical studies on a yet-to-be-implemented optimized VM.
  • cybertreibercybertreiber Vienna, AustriaPosts: 29Member ✭✭
    edited April 2014
    I think it's the intuition of many that scalability is the show stopper or show maker towards proliferation of crypto consensus sponsored solutions. In fact, @vitalik addressed the challenges thoroughly with his account on the 10 most important issues. Lubin reassured that a PoS hybrid solution for Ethereum 1.0 is pondered on and the whole sidechain thing gained so much traction partially because of that.

    Why not start a brainstorming session to see which ideas have merit for scalability and which don't? Here's what I garnered recently:

    -) Maidsafe, proof of resource (will it work?)
    -) Proof of Location and Connectivity ( , my immature brainchild)
    -) Sidechains and hence blockchain interoperability with difficulty arms races driving specialized ETH spin-offs, (merged mining requirements would need to lessen though)
    -) Proof of Transaction (
    -) SCIP Proof of Execution (far off from practicability afaik)

    The winner of crypto 2.0 will offer superb utility and one factor of that is scalability. If there ought to be something as 'winner' in a space of simultaneous cooperation and competition of course.
  • avsaavsa Posts: 68Member ✭✭
    Thanks all. I was precisely thinking about how side chains can help scalability. A very popular app (let's all it Ethbook) can have a sidechain that trades 1:1 with ethereum so instead of all miners having to run all apps, a small part of them is dedicated to mine exclusively Ethbook, that is resolving its internal aspect at all times, while all the other miners only have to deal with how muh eth goes in and out of Ethbook.

  • JasperJasper Eindhoven, the NetherlandsPosts: 514Member ✭✭✭
    Went a little nuts wrote 'merged-mining-voted-upon'. The idea is that people can mine on block.prevhash, where score = sha3(sha3([1] xor contract.address xor block.prevhash)). Dont know how to make the contract check if the block was actually submitted, and if it contains valid/useful transactions, so i just put in votes that can take away the block reward and stake the miner has.

    Lots of problems as is, including stupid mistakes. Staked mining would probably be better. Point is, maybe contracts can be made that do a little merged mining to a (possibly non-currency)blockchain,(like for creating an ordered tree of posts) pay out in ethers and have a method to stop useless blocks. Of course, for posts, for instance, how do miners know what to include..

    Maybe the top hash of a Merkele tree can provide a claim about what transactions are in there, that could be challenged. For instance if transactions cost ethers, but to keep the usefulness of the second chain, users are only periodically charged. The charges themselves are just claims, nothing stopping incorrect charging at that point. However users could challenge it, the 'casheer' then has to provide a (transaction, merkele path to top) each part of the costs. This would be expensive on the ethereum blockchain. Casheers would have to put a lot of stake at risk. Still, it is a matter of computation to charge the correct amounts, cant be much risk to do it wrong..
Sign In or Register to comment.