Distributed Systems ETH 2020
Distributed Systems Lecture ETH 2020
Distributed Systems Lecture ETH 2020
Créer ou copier des fichiers d'apprentissage
Avec un upgrade tu peux créer ou copier des fichiers d'apprentissage sans limite et utiliser de nombreuses fonctions supplémentaires.
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.
What does the PBFT Prepare Phase look like?
What is the PBFT faulty timer?
When backup b accepts request r it starts a local faulty-timer that will only stop once b executes r. If it expires the backup considers the primary faulty and triggers a view change.
What is the goal of mechanism design?
Design a game in which nodes have an incentive to behave nicely.
What is a ticket and what properties does it have?
A ticket is a weaker form of a lock with the following properties:
- reissuable: server can issue more tickets even if previous ones not yet returned
- expiration: server only accepts most recently issued ticket
Define consensus and name its properties.
There are n nodes of which at most f might crash (n-f correct). Node i starts with an input value v_i. The nodes must decide for one of those values satisfying the following properties:
- agreement: all correct nodes decide for the same value
- termination: all correct nodes terminate in finite time
- validity: the decision must be an input value of a node
Define configuration and critical configuration.
- We say that a system is fully defined (at any point during the execution) by its configuration C. The configuration includes the state of every node, and all messages that are in transit (sent but not yet received).
- C is critical if C is bivalent but all configurations that are direct children of C are univalent
Define univalent and bivalent.
- A configuration C is univalent if the decision value is determined independently of what happens afterwards (only one decision is possible). (univalent for value v -> v-valent)
Nodes need not be aware of this! - C is bivalent if the nodes might decide for 0 or 1
Define configuration tree.
The configuration tree is a directed tree of configurations. Its root is C0 (fully characterised by the input values), The edges are transitions (characterised by event (u,m), node u receiving message m), every configuration has all applicable transitions as outgoing edges.
Is there a deterministic algorithm which always achieves consensus in the asynchronous model with f>0?
No.
If a system is in a bivalent configuration it must reach a critical configuration within finite time or it does not always solve consensus.
If a config tree contains a critical configuration crashing a single node can create a bivalent leaf
--> NO
Define byzantine.
A node which can have arbitrary behaviour (also malicious) is called byzantine.
Define 4 different kinds of validity.
- any-input validity: decision value must be the input of any node
- correct-input validity: decision value must the the input of a correct node
- all-same validity: if all correct nodes start with the same input v, the decision value must be v
- median validity: if the input values are orderable byzantine outliers can be prevented by agreeing on a value close to the median of the correct input values
What is the max. number of byzantine nodes such that byzantine agreement can be reached?
f < n/3
How many rounds does a synchronous algorithm solving consensus in the presenece of f crashing nodes need if nodes decide for the minimum seen value?
f+1
Define the blackboard model for shared coins.
The blackboard is a trusted authority which supports two operations: write message, read all written values.
Define best-effort and reliable broadcast.
- best effort broadcast: ensures that a message that is sent from a correct node to another will eventually be received and accepted
- reliable broadcast: ensures that the nodes eventually agree on all accepted messages
Define threshold secret sharing.
Let t,n ∈ N with 1 ≤ t ≤ n. An algorithm that distributes a secret among n participants such that t participants need to collaborate to recover the secret is called a (t, n)-threshold secret sharing scheme.
-
- 1 / 129
-
Cartes-fiches
What is the goal of mechanism design?
Design a game in which nodes have an incentive to behave nicely.