EOS whitepaper walk-through: Deterministic Parallel Execution of Applications, structure of EOS blocks.

in #eos6 years ago

                                                        

Read the Whitepaper here 

Last time we took a board overview of how EOS plans to allow deterministic applications to be evaluated in parallel.

In this article we'll take a look at how the data structure allows for this.

Minimizing Communication Latency

 Latency is the time it takes for one account to send an Action to another account and then receive a response. The goal is to enable two accounts to exchange Actions back and forth within a single block without having to wait 0.5 seconds between each Action. To enable this, the EOS.IO software divides each block into cycles. Each cycle is divided into shards and each shard contains a list of transactions. Each transaction contains a set of Actions to be delivered. This structure can be visualized as a tree where alternating layers are processed sequentially and in parallel.
 Block

   Region

     Cycles (sequential)

       Shards (parallel)

         Transactions (sequential)

           Actions (sequential)

             Receiver and Notified Accounts (parallel

Each EOS block is divided into cycles. Each cycle is divided into shards and each shard contains a list of transactions. Each transaction contains a set of Actions to be delivered. This structure can be visualized as a tree where alternating layers are processed sequentially and in parallel.

Above is a visualization of how a EOS block looks like. The Block contains two cycles, indicated by the black rectangular outline. These cycles are run sequentially, so the cycle on top will execute first before the cycle on the bottom. 

Each cycle will contain many threads, as represented by the long, red rectangular outlines within the two cycles. These thread run in parallel, during each cycle.

By doing this, EOS allows for accounts to communicate with one another within a block. Let's imagine account A's sending transaction to B and from B to C. The A to B transaction will happen in the first cycle, after which the B to C transaction will be applied in the cycle after. 

This allows both transactions to be applied within one block, at the speed of a single block confirmation.

An example operation like the one we mentioned would take 20 minutes in Bitcoin and at least 30 seconds in Ethereum. In EOS, this process will take just 0.5 seconds.

Read more about EOS block structure here.

Transactions generated in one cycle can be delivered in any subsequent cycle or block. Block producers will keep adding cycles to a block until the maximum wall clock time has passed or there are no new generated transactions to deliver.

There is no set number of cycles in block. But since each block time is defined as 0.5 seconds, it is up to the block-producer to see how cycles can fit into that 0.5 time-frame.

It is possible to use static analysis of a block to verify that within a given cycle no two shards contain transactions that modify the same account. So long as that invariant is maintained a block can be processed by running all shards in parallel. 

The threads within each cycle will need to make sure they are not writing to the same scope. EOS enforces this by only allowing one send and receive action per account per cycle. 

------------------------------------------------------------------------------------------------------------------

If you would like to know more about me and what I'm doing you can read my introduction post here.

Read my series on the Steem blockchain:

Steem: Welcome to the Matrix. Part One

Steem: Operating in the Matrix. Part Two

Steem: Construction of the Matrix. Part Three

Read my series on the EOS blockchain:

EOS whitepaper walk-through. Abstract

EOS whitepaper walk-through. Note and Disclaimer

EOS whitepaper walk-through. Overview

EOS whitepaper walk-through. Background

EOS whitepaper walk-through. Requirement.

EOS whitepaper walk-through. Consensus Algorithm. Part One, Part Two, Part Three.

EOS whitepaper walk-through. Account construct of EOS. Part One, Part Two, Part Three, Part Four.

And you can contact me in the following way:

Twitter

@bluabaleno on Steem.chat

bitadco@gmail.com  

Sort:  

Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://github.com/EOSIO/Documentation/blob/master/TechnicalWhitePaper.md

Coins mentioned in post:

CoinPrice (USD)📈 24h📈 7d
BTCBitcoin9219.790$0.46%4.12%
EOSEOS17.936$-4.89%21.66%
ETHEthereum719.995$5.44%14.26%
STEEMSteem3.915$-0.85%5.29%

Coin Marketplace

STEEM 0.20
TRX 0.12
JST 0.029
BTC 61215.97
ETH 3350.38
USDT 1.00
SBD 2.49