Skip to content

Commit

Permalink
Merge assumption updates
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSchZA committed Aug 5, 2021
2 parents 7836811 + 31eafdb commit 75e955e
Show file tree
Hide file tree
Showing 34 changed files with 9,366 additions and 347 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.ipynb diff=nodiff
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ dmypy.json

# Assorted
.vscode/
scratchpad.*
scratchpad*
scratchpad/
.DS_Store
.idea/
Expand Down
159 changes: 144 additions & 15 deletions ASSUMPTIONS.md

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,25 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2021-07-28
### Changed
- Default assumption for `base_fee_process` System Parameter
- Default assumption for `priority_fee_process` System Parameter
- Experiment notebook 2, "Validator Revenue and Profit Yields": updated time-domain simulations to run over all stages

### Added
- `mev_per_block` System Parameter
- Maximum Extractable Value (MEV) Policy Function
- "Ethereum Network Assumptions" and "Ethereum Transaction & EIP-1559 Assumptions" added to [ASSUMPTIONS.md](ASSUMPTIONS.md) doc
- Additional datasets in [data/](data/): Historical Ethereum Average Gas Price, Historical Ethereum Block Rewards, Daily Extracted MEV, Historical Ethereum Gas Used

## [1.0.0] - 2021-07-15
### Changed
- The model is public!

## [0.1.2] - 2021-04-29
### Changed
- Refactor of EIP1559 mechanism
- Refactor of EIP-1559 mechanism
- Various refactors post-review

## [0.1.1] - 2021-04-05
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

A modular dynamical-systems model of Ethereum's validator economics, based on the open-source Python library [radCAD](https://github.com/CADLabs/radCAD), an extension to [cadCAD](https://cadcad.org).

* Current model version: `v1.0.0`
* Current model version: `v1.1.0`
* Implements the official Ethereum [Altair](https://github.com/ethereum/eth2.0-specs#altair) spec updates in the [Blue Loop / v1.1.0-alpha.7](https://github.com/ethereum/eth2.0-specs/releases/tag/v1.1.0-alpha.7) release

## Table of Contents
Expand Down Expand Up @@ -34,12 +34,12 @@ This open-source model was developed in collaboration with the Ethereum Robust I
### Model Features

* Configurable to reflect protocol behaviour at different points in time of the development roadmap (referred to as "upgrade stages"):
* Post Beacon Chain launch, pre EIP1559, pre PoS (validators receive PoS incentives, EIP1559 disabled, and PoW still in operation)
* Post Beacon Chain launch, post EIP1559, pre PoS (validators receive PoS incentives, EIP1559 enabled with miners receiving priority fees, and PoW still in operation)
* Post Beacon Chain launch, post EIP1559, post PoS (validators receive PoS incentives, EIP1559 enabled with validators receiving priority fees, and PoW deprecated)
* Post Beacon Chain launch, pre EIP-1559, pre PoS (validators receive PoS incentives, EIP-1559 disabled, and PoW still in operation)
* Post Beacon Chain launch, post EIP-1559, pre PoS (validators receive PoS incentives, EIP-1559 enabled with miners receiving priority fees, and PoW still in operation)
* Post Beacon Chain launch, post EIP-1559, post PoS (validators receive PoS incentives, EIP-1559 enabled with validators receiving priority fees, and PoW deprecated)
* Flexible calculation granularity: By default, State Variables, System Metrics, and System Parameters are calculated at epoch level and aggregated daily (~= 225 epochs). Users can easily change epoch aggregation using the delta-time (`dt`) parameter. The model can be extended for slot-level granularity and analysis if that is desired (see [Model Extension Roadmap](#Model-Extension-Roadmap)).
* Supports [state-space analysis](https://en.wikipedia.org/wiki/State-space_representation) (i.e. simulation of system state over time) and [phase-space analysis](https://en.wikipedia.org/wiki/Phase_space) (i.e. generation of all unique system states in a given experimental setup).
* Customizable processes to set important variables such as ETH price, ETH staked, and EIP1559 transaction pricing.
* Customizable processes to set important variables such as ETH price, ETH staked, and EIP-1559 transaction pricing.
* Modular model structure for convenient extension and modification. This allows different user groups to refactor the model for different purposes, rapidly test new incentive mechanisms, or update the model as Ethereum implements new protocol improvements.
* References to official [Eth2 specs](https://github.com/ethereum/eth2.0-specs) in Policy and State Update Function logic. This enables seamless onboarding of protocol developers and allows the more advanced cadCAD user to dig into the underlying protocol design that inspired the logic.

Expand All @@ -62,7 +62,7 @@ The model is composed of several structural modules in the [model/parts/](model/

| Module | Description |
| --- | --- |
| [ethereum_system.py](model/parts/ethereum_system.py) | General Ethereum mechanisms, such as managing the system upgrade process, the EIP1559 transaction pricing mechanism, and updating the ETH price and ETH supply |
| [ethereum_system.py](model/parts/ethereum_system.py) | General Ethereum mechanisms, such as managing the system upgrade process, the EIP-1559 transaction pricing mechanism, and updating the ETH price and ETH supply |
| [pos_incentives.py](model/parts/pos_incentives.py) | Calculation of PoS incentives such as attestation and block proposal rewards and penalties |
| [system_metrics.py](model/parts/system_metrics.py) | Calculation of metrics such as validator operational costs and yields |
| [validators.py](model/parts/validators.py) | Validator processes such as validator activation, staking, and uptime |
Expand All @@ -85,7 +85,7 @@ The model is configured using several configuration modules in the [model/](mode

### Model Assumptions

The model implements the official Ethereum Specification wherever possible, but rests on a few default validator-level assumptions detailed in the [ASSUMPTIONS.md](ASSUMPTIONS.md) document.
The model implements the official Ethereum Specification wherever possible, but rests on a few default network-level and validator-level assumptions detailed in the [ASSUMPTIONS.md](ASSUMPTIONS.md) document.

### Mathematical Model Specification

Expand All @@ -98,7 +98,7 @@ The [Differential Model Specification](https://hackmd.io/@CADLabs/HyENPQ36u) dep
## Environment Setup

1. Clone or download the Git repository: `git clone https://github.com/CADLabs/ethereum-model` or using GitHub Desktop
2. If completing the cadCAD Edu Masterclass MOOC, check out the version `v1.0.0` tag: `git checkout tags/v1.0.0`
2. If completing the cadCAD Edu Masterclass MOOC, check out the version `v1.1.0` tag: `git checkout tags/v1.1.0`
3. Set up your development environment using of the following two options:

### Option 1: Local Development Environment
Expand Down Expand Up @@ -284,6 +284,6 @@ If you'd like to cite this code and/or research, we suggest the following format
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/CADLabs/ethereum-economic-model}},
version = {v1.0.0}
version = {v1.1.0}
}
```
16 changes: 16 additions & 0 deletions data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,19 @@ Thanks to Etherscan. See https://etherscan.io/chart/ethersupplygrowth
## Historical Ethereum Price

Thanks to Etherscan. See https://etherscan.io/chart/etherprice

## Historical Ethereum Average Gas Price

Thanks to Etherscan. See https://etherscan.io/chart/gasprice

## Historical Ethereum Block Rewards

Thanks to Etherscan. See https://etherscan.io/chart/blockreward

## Daily Extracted MEV

Thanks to https://explore.flashbots.net/

## Historical Ethereum Gas Used

Thanks to Etherscan. See https://etherscan.io/chart/gasused
Loading

0 comments on commit 75e955e

Please sign in to comment.