Scalability and Asynchronous Programming
Ethereum 2.0… now processing 100,000 towers of ugly javascript callback code per second!
Ethereum right now
A Vision for 2.0: Sharding
A Vision for 2.0: Sharding
The Bottom Level
The Bottom Level
The Top Level
The Top Level
Async Transactions
Solution: Merkle tree receipts
Step 1: The Call
def registerName(currencyShard, currencyAddress, name, fee):
self.next_cbid += 1
log(type=CallReceipt, {
shard: currencyShard, to: currencyAddress,
method: withdraw, args: {
from: msg.sender, to: self, value: fee,
}
cbid: self.next_cbid, callbackMethod: withdrawCallback
})
self.cbArgs[self.next_cbid] = {
name: name, owner: msg.sender,
shard: currencyShard, to: currencyAddress
}
Step 2: The Other Side
def submitLog(logProof):
if verify(logProof, block.prevStateRoot) and
not self.spent[logProof.log.cbid] and
log.shard == myShard and log.to == self:
self.spent[logProof.log.cbid] = true
o = self.call(method=log.method,
sender=log.sender,
senderShard=log.senderShard, **log.args)
log(type=CallReceipt, {
response: o, shard: log.senderShard, to: log.sender,
method: log.callbackMethod, args: { response: o },
cbid: logProof.log.cbid
})
Step 3: Callback
def submitCallback(logProof):
cbid = logProof.log.cbid
if log.sender == self.cbArgs[cbid].to and
log.senderShard == self.cbArgs[cbid].shard and
verify(logProof, block.prevStateRoot) and
not self.spent[cbid]:
self.spent[cbid] = true
self.call(method=log.method,
**self.cbArgs[cbid], **log.args)
def withdrawCallback(name, owner, response):
if response is true:
self.domains[name].owner = owner
Asynchrony in Practice
Problems and solutions
The economics
The economics
More generality