Distributed Systems ETH 2020
Distributed Systems Lecture ETH 2020
Distributed Systems Lecture ETH 2020
Kartei Details
Karten | 129 |
---|---|
Sprache | English |
Kategorie | Elektrotechnik |
Stufe | Universität |
Erstellt / Aktualisiert | 15.01.2021 / 20.01.2024 |
Weblink |
https://card2brain.ch/box/20210115_distributed_systems_eth_2020
|
Einbinden |
<iframe src="https://card2brain.ch/box/20210115_distributed_systems_eth_2020/embed" width="780" height="150" scrolling="no" frameborder="0"></iframe>
|
Define monotonic read consistency.
If a node u has seen a particular value of an object any subsequent accesses of u will ever return any older values.
Define monotonic write consistency.
A write operation by a node on a data item is completed before any successive write operation by the same node. (serialized writes by the same node)
Define read-your-write consistency.
After a node u has updated a data item, any later reads fromnode u will never see an older value.
What pairs of operations are said to be causally related?
- two writes by the same node to different variables
- a read followed by a write of the same node
- a read that returns the value of a write from any node
- two operations that are transitively related according to above conditions
Define causal consistency.
A system provides causal consistency if operations that potentially are causally related are seen by every node of the system in the same order. Concurrent writes are not causally related and may be seen in different orders by different nodes.
Define game.
A game requires at least two rational players and each player can chose from at least two options (strategies). In every possible outcome (strategy profile) each player get a certain payoff or cost. The payoff depends on the strategies of other players.
Define social optimum.
A strategy profile is called social optimum (SO) iff it minimizes the sum of all costs.
Define dominant strategy.
A strategy is dominant if a player is never worse off by playing this strategy. A dominant strategy profile is a strategy profile in which each player plays a dominant strategy.
Define Nash equilibrium.
A Nash Equilibrium (NE) is a strategy profile in which no player can improve by unilaterally changing its strategy.
e.g. all players play dominant strategy
Find NE: write down every best response, find all NE
Define price of anarchy (PoA).
Let NE_ be the NE with the highest cost. The PoA is defined as
\(PoA = {cost(NE_-) \over cost(SO)}\)
Define optimistic price of anarchy (OPoA).
Let NE+ be the NE with the smallest cost. The OPoA is
\(OPoA = {cost(NE_+) \over cost(SO)}\)
What is Braess' Paradox?
Adding a super fast road between u and v can increase the travel time.
What is a mixed NE?
Every game has a mixed NE, this means strategies are chosen non-deterministically.
Define auction.
One good is sold to a group of bidders, Each bidder has a secret value z_i for the good and tells his bid b_i to the auctioneer. The auctioneer sells the good to one bidder for a price p.
Define truthful auction.
An auction is truthful if no player v_i can gain anything by not stating the truth, i.e. b_i = z_i
Truthful bidding is a dominant strategy in a second price auction.
How does storage using consistent hashing work?
Hash unique filename of movie and unique parameters of each node h(u) -> [0,1) and store the movie on the node if the hashes are minimal.
Define churn.
Nodes exhibit a high churn if they constantly join and leave the distributed system.
What properties should our virtual network have?
homogeneous: no node should play a dominant role, no node should be a single point of failure.
The nodes should have IDs, in the universe [0, 1)
Every node should have a small degree
small diameter, routing should be easy. If a node does not have the information about a data item, then it should know which neighbor to ask. Within a few (polylogarithmic in n) hops, one should find the node that has the correct information.
What does a (m,d) mesh M(m,d) look like?
What does T(m,d) torus look like?
What does the d-dimensional butterfly BF(d) look like?
Let d ∈ N. The d-dimensional butterfly BF(d) is a graph with node set V =[d+1]×[2]^d and an edge set E = E1 ∪ E2 with
\(E_1= \{\{ (i, \alpha),(i+1, \alpha) \} | i \in [d], \alpha \in [2]^d\}\)
and
\(E_2 = \{\{ (i, \alpha),(i+1, \beta) \} | i \in [d], \alpha, \beta \in [2]^d, \alpha \oplus \beta = 2^i \}\)
it has (d+1)2^d nodes, 2d*2^d edges and degree 4
Define Skip List.
The skip list is an ordinary ordered linked list of objects, augmented with additional forward links. The ordinary linked list is the level 0 of the skip list. In addition, every object is promoted to level 1 with probability 1/2. As for level 0, all level 1 objects are connected by a linked list. In general, every object on level i is promoted to the next level with probability 1/2. A special start-object points to the smallest/first object on each level.
Search, insert, delete in O(log n)
Define distributed hash table.
What is DHT with Churn?
We have a fully scalable, efficient distributed storage system which tolerates O(log n) worst-case joins and/or crashes per constant time interval. As in other storage systems, nodes have O(log n) overlay neighbors, and the usual operations (e.g., search, insert) take time O(log n).
Define DAG-blockchain and DAG weight.
In a DAG-blockchain the genesis block does not reference other blocks. Every other block has at least one (and possibly multiple references) to previous blocks. All references should be relevant in the sense that a reference does not already include another reference recursively.
The weight of a dag-ancestor block a with respect to a block b is defined as the number of tree-descendants of a in the set of dag-ancestors of b. If two blocks a and a′ have the same weight, we use the hashes of a and a′ to break ties.
Define (DAG) parent order.
Let x and y be any pair of dag-parents of b, and z be the lowest common tree-ancestor of x and y. x′ and y′ are the tree- children of z that are tree-ancestors of x and y respectively. If x′ has a higher weight than y′, then block b orders dag-parent x before y.
How To Order: "one part of sub-DAG is heavier => earlier in ordering"
What is Ethereum?
Ethereum is a distributed state machine. It promises to run arbitrary computer programs in a blockchain.
Smart contracts are programs deployed on the ETH blockchain that have associated storage and can execute arbitrary complex logic.
In ETH up to two "uncles" are allowed additionally to the parent.
What are the two ETH accounts?
There are externally owned accounts (EOAs) that are controlled by individuals with a secret key and contract accounts (CAs) that are for smart contracts.
What things does an ETH transaction contain?
- Nonce: counts how many transactions the account of the sender of the transaction has already sent.
- address of the recipient.
- signature by the user controlling the EOA.
- Value: The amount of Wei to transfer
- Data: Optional, can be accessed by smart contracts.
- StartGas: maximum amount of computation this transaction is allowed to use.
- GasPrice: How many Wei per unit of Gas the sender is paying. a high GasPrice will make sure that the transaction is executed more quickly.
What types of transactions are there in ETH?
- simple transaction: transfers some native currency from one EOA to another
- smart contract creation transaction: recipient address field set to 0, data field set to compiled EVM code, used to deploy code as a smart contract, it is deployed after it has been mined "sufficiently deep"
- smart contract execution transaction: smart contract address as recipient and code to execute a specific function of that contract in its data field
What does an ETH block look like?
In Ethereum, like in Bitcoin, a block is a collection of transactions that is considered a part of the canonical history of transactions. Among other things, a block contains: pointers to parent and up to two uncles, the hash of the root node of a trie structure populated with each transaction of the block, the hash of the root node of the state trie (after transactions have been executed).
What is chain-based and BFT-based proof-of-stake?
- Chain: Accounts hold lottery tickets according to their stake. The lottery is pseudo-random, in the sense that hash functions computed on the state of the blockchain will select which account is winning. The winning account can extend the longest chain by a block, and earn the block reward.
- BFT: The lottery winner only gets to propose a block to be added to the blockchain. A committee then votes (yes, byzantine fault tolerance) whether to accept that block into the blockchain. If no agreement is reached, this process is repeated.
Fork problem, nothing at stake attack: just extend all forks
What is the system model for the Practical Byzantine Fault Tolerance (PBFT) protocol?
We consider a system with n = 3f +1 nodes, and additionally an unbounded number of clients. There are at most f byzantine nodes, and clients can be byzantine as well. The network is asynchronous, and messages have variable delay and can get lost. Clients send requests that correct nodes have to order to achieve state replication.
Each node will consider one node to be primary and the rest backups.
What is a view in PBFT context?
A view v is a non-negative integer representing the node’s local perception of the system. We say that node u is in view v as long as node u considers node p = v mod n to be the primary.
Give a high level overview of the PBFT agreement protocol.
1. The nodes receive a request and relay it to the primary.
2. The primary sends a pre-prepare-message to all backups, informing them that it wants to execute that request with the sequence number specified in the message.
3. Backups send prepare-messages to all nodes, informing them that they agree with that suggestion. (Needs 2f including its own)
4. All nodes send commit-messages to all nodes, informing everyone that they have committed to execute the request with that sequence number. (needs 2f+1 including its own)
5. They execute the request and inform the client.