Skip to content

Commit c72f7f1

Browse files
committed
fix markdownlint
1 parent bb83a85 commit c72f7f1

File tree

7 files changed

+88
-105
lines changed

7 files changed

+88
-105
lines changed

CONTRIBUTING.md

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ In particular, we appreciate support in the following areas:
1313
1414
For details about EELS usage and building, please refer the [README](https://github.com/ethereum/execution-specs/blob/master/README.md#usage)
1515

16-
1716
## Contribution Guidelines
1817

1918
This specification aims to be:
@@ -26,7 +25,7 @@ This specification aims to be:
2625

2726
- Attempt to use descriptive English words (or _very common_ abbreviations) in documentation and identifiers.
2827
- Avoid using EIP numbers in identifiers.
29-
- If necessary, there is a custom dictionary `whitelist.txt`.
28+
- If necessary, there is a custom dictionary `whitelist.txt`.
3029

3130
### Changes across various Forks
3231

@@ -43,39 +42,39 @@ This saves you having to apply code review feedback repeatedly for each fork.
4342

4443
Running the tests necessary to merge into the repository requires:
4544

46-
* Python 3.11.x, and
47-
* [PyPy](https://www.pypy.org/) [7.3.19](https://downloads.python.org/pypy/) or later.
48-
* `geth` installed and present in `$PATH`
49-
45+
- Python 3.11.x, and
46+
- [PyPy](https://www.pypy.org/) [7.3.19](https://downloads.python.org/pypy/) or later.
47+
- `geth` installed and present in `$PATH`
5048

5149
`execution-specs` depends on a submodule that contains common tests that are run across all clients, so we need to clone the repo with the --recursive flag. Example:
50+
5251
```bash
53-
$ git clone --recursive https://github.com/ethereum/execution-specs.git
52+
git clone --recursive https://github.com/ethereum/execution-specs.git
5453
```
5554

5655
Or, if you've already cloned the repository, you can fetch the submodules with:
5756

5857
```bash
59-
$ git submodule update --init --recursive
58+
git submodule update --init --recursive
6059
```
6160

6261
The tests can be run with:
62+
6363
```bash
64-
$ tox
64+
tox
6565
```
6666

6767
The development tools can also be run outside of `tox`, and can automatically reformat the code:
6868

6969
```bash
70-
$ uv run --extra lint ruff check # Detects code issues and produces a report to STDOUT
71-
$ uv run --extra lint ruff check --fix # Fixes minor code issues (like unsorted imports).
72-
$ uv run --extra lint ruff format # Formats code.
73-
$ uv run --extra lint mypy src packages tests # Verifies type annotations.
70+
uv run --extra lint ruff check # Detects code issues and produces a report to STDOUT
71+
uv run --extra lint ruff check --fix # Fixes minor code issues (like unsorted imports).
72+
uv run --extra lint ruff format # Formats code.
73+
uv run --extra lint mypy src packages tests # Verifies type annotations.
7474
```
7575

7676
It is recommended to use a [virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment) to keep your system Python installation clean.
7777

78-
7978
A trace of the EVM execution for any test case can be obtained by providing the `--evm-trace` argument to pytest.
8079
Note: Make sure to run the EVM trace on a small number of tests at a time. The log might otherwise get very big.
8180
Below is an example.
@@ -86,20 +85,20 @@ uv run --extra test \
8685
--evm_trace
8786
```
8887

89-
9088
## CLI Utilities `ethereum_spec_tools`
9189

9290
The EELS repository has various CLI utilities that can help in the development process.
9391

9492
### New Fork Tool
95-
-----------------
93+
9694
This tool can be used to create the base code for a new fork by using the existing code from a given fork.
9795

9896
The command takes 4 arguments, 2 of which are optional
99-
* from_fork: The fork name from which the code is to be duplicated. Eg. - "Tangerine Whistle"
100-
* to_fork: The fork name of the new fork Eg - "Spurious Dragon"
101-
* from_test (Optional): Name of the from fork within the test fixtures in case it is different from fork name. Eg. - "EIP150"
102-
* to_test (Optional): Name of the to fork within the test fixtures in case it is different from fork name Eg - "EIP158"
97+
98+
- from_fork: The fork name from which the code is to be duplicated. Eg. - "Tangerine Whistle"
99+
- to_fork: The fork name of the new fork Eg - "Spurious Dragon"
100+
- from_test (Optional): Name of the from fork within the test fixtures in case it is different from fork name. Eg. - "EIP150"
101+
- to_test (Optional): Name of the to fork within the test fixtures in case it is different from fork name Eg - "EIP158"
103102

104103
As an example, if one wants to create baseline code for the `Spurious Dragon` fork from the `Tangerine Whistle` one
105104

@@ -108,46 +107,45 @@ ethereum-spec-new-fork --from_fork="Tangerine Whistle" --to_fork="Spurious Drago
108107
```
109108

110109
The following will have to however, be updated manually
111-
1. The fork number and `MAINNET_FORK_BLOCK` in `__init__.py`. If you are proposing a new EIP, please set `MAINNET_FORK_BLOCK` to `None`.
112-
2. Any absolute package imports from other forks eg. in `trie.py`
113-
3. Package names under `setup.cfg`
114-
4. Add the new fork to the `monkey_patch()` function in `src/ethereum_optimized/__init__.py`
115-
5. Adjust the underline in `fork/__init__.py`
116110

111+
1. The fork number and `MAINNET_FORK_BLOCK` in `__init__.py`. If you are proposing a new EIP, please set `MAINNET_FORK_BLOCK` to `None`.
112+
2. Any absolute package imports from other forks eg. in `trie.py`
113+
3. Package names under `setup.cfg`
114+
4. Add the new fork to the `monkey_patch()` function in `src/ethereum_optimized/__init__.py`
115+
5. Adjust the underline in `fork/__init__.py`
117116

118117
### Sync Tool
119-
-------------
118+
120119
The sync tool allows one to use an RPC provider to fetch and validate blocks against EELS.
121120
The state can also be stored in a local DB after validation. Since syncing directly with the specs can be
122121
very slow, one can also leverage the optimized module. This contains alternative implementations of routines
123122
in EELS that have been optimized for speed rather than clarity/readability.
124123

125-
126124
The tool can be called using the `ethereum-spec-sync` command which takes the following arguments
127-
* rpc-url: Endpoint providing the Ethereum RPC API. Defaults to `http://localhost:8545/`
128-
* unoptimized: Don't use the optimized state/ethash (this can be extremely slow)
129-
* persist: Store the state in a db in this file
130-
* geth: Use geth specific RPC endpoints while fetching blocks
131-
* reset: Delete the db and start from scratch
132-
* gas-per-commit: Commit to db each time this much gas is consumed. Defaults to 1_000_000_000
133-
* initial-state: Start from the state in this db, rather than genesis
134-
* stop-at: After syncing this block, exit successfully
125+
126+
- rpc-url: Endpoint providing the Ethereum RPC API. Defaults to `http://localhost:8545/`
127+
- unoptimized: Don't use the optimized state/ethash (this can be extremely slow)
128+
- persist: Store the state in a db in this file
129+
- geth: Use geth specific RPC endpoints while fetching blocks
130+
- reset: Delete the db and start from scratch
131+
- gas-per-commit: Commit to db each time this much gas is consumed. Defaults to 1_000_000_000
132+
- initial-state: Start from the state in this db, rather than genesis
133+
- stop-at: After syncing this block, exit successfully
135134

136135
- The following options are not supported WITH `--unoptimized` -> `--persist`, `--initial-state`, `--reset`
137136
- The following options are not supported WITHOUT `--persist` -> `--initial_state`, `--reset`
138137

139-
140138
### Patch Tool
141-
--------------
139+
142140
This tool can be used to apply the unstaged changes in `SOURCE_FORK` to each of the `TARGET_FORKS`. If some
143141
of the change didn't apply, '.rej' files listing the unapplied changes will be left in the `TARGET_FORK`.
144142

145-
146143
The tool takes the following command line arguments
147-
* The fork name where the changes have been made. Eg:- `frontier` (only a single fork name)
148-
* The fork names where the changes have to be applied. Eg:- `homestead` (multiple values can be provided separated by space)
149-
* optimized: Patch the optimized code instead
150-
* tests: Patch the tests instead
144+
145+
- The fork name where the changes have been made. Eg:- `frontier` (only a single fork name)
146+
- The fork names where the changes have to be applied. Eg:- `homestead` (multiple values can be provided separated by space)
147+
- optimized: Patch the optimized code instead
148+
- tests: Patch the tests instead
151149

152150
As an example, if one wants to apply changes made in `Frontier` fork to `Homestead` and `Tangerine Whistle`
153151

@@ -156,11 +154,12 @@ python src/ethereum_spec_tools/patch_tool.py frontier homestead tangerine_whistl
156154
```
157155

158156
### Lint Tool
159-
-------------
157+
160158
This tool checks for style and formatting issues specific to EELS and emits diagnostics
161159
when issues are found
162160

163161
The tool currently performs the following checks
162+
164163
- The order of the identifiers between each hardfork is consistent.
165164
- Import statements follow the relevant import rules in modules.
166165

EIP_AUTHORS_MANUAL.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
# Introduction
1+
# EIP AUTHOR MANUAL
2+
3+
## Introduction
24

35
This document outlines the process of specifying and testing EIPs for the Ethereum execution layer. It is intended for EIP authors, researchers and implementers. An EIP will typically go through the following stages:
46

57
| Stage | Activities | Outputs |
68
| ------------------ | ----------- | ------- |
79
| _Pre‑Draft_ | Prospective EIP author conceives of an idea for an improvement to Ethereum, and discusses with the community. | <ul><li>Vague Consensus on [Ethereum Magicians][0]</li></ul> |
810
| **Draft** | <p>EIP author writes a technical human-language document describing the improvement, initially in broad strokes and becoming more specific over time.</p><p>Concurrently, they develop a Python reference implementation to make the EIP executable and identify any immediate/obvious implementation issues. For example, the EIP may not be compatible with some detail of the current Ethereum Virtual Machine.</p><p>Finally for this stage, the author begins to write test schemes for the EIP. Having the reference implementation should help identify the various logical flows to test and thus feed into more robust testing. Once the test schemes are written, the reference implementation can then be used to fill the tests and generate the test vectors.</p> | <ul><li>Complete (but not final) document in [EIPs Repository][1]</li><li>Reference Implementation in [EELS][2]</li><li>Initial Tests in [EEST][3]</li></ul> |
9-
| **Review** | <p>The broader Ethereum community discusses and provides input on the proposal.</p><p>Although the feedback from the community can be sought at all lifecycle stages, having a reference implementation and tests act as a good bridge between research and client implementation. It also helps core developers (who have limited time and resources) to understand the EIP better and provide more informed feedback.</p> | <ul><li>Complete &amp; final document in the [EIPs Repository][1]</li><li>Comprehensive tests in [EEST][3]</li></ul>
11+
| **Review** | <p>The broader Ethereum community discusses and provides input on the proposal.</p><p>Although the feedback from the community can be sought at all lifecycle stages, having a reference implementation and tests act as a good bridge between research and client implementation. It also helps core developers (who have limited time and resources) to understand the EIP better and provide more informed feedback.</p> | <ul><li>Complete &amp; final document in the [EIPs Repository][1]</li><li>Comprehensive tests in [EEST][3]</li></ul> |
1012
| **Last&nbsp;Call** | Usually after being nominated for inclusion in a fork, the EIP author signals that the proposal is effectively done and begins the last period for comments/discussion. | <ul><li>Complete reference implementation in [EELS][2]</li><li>Complete tests in [EEST][3]</li><li>Immutable proposal in [EIPs Repository][1]</li></ul> |
1113
| **Final** | The proposal is now immutable (cannot be changed) and exists for reference. | <ul><li>Mainnet client implementations</li></ul> |
1214

@@ -17,37 +19,36 @@ This document outlines the process of specifying and testing EIPs for the Ethere
1719

1820
This document will focus on stages 3 and 4 of the above lifecycle.
1921

20-
21-
# Executable Specifications
22+
## Executable Specifications
2223

2324
This repository contains the executable specifications for the Ethereum execution layer.
2425

25-
## Folder Structure
26+
### Folder Structure
2627

27-
### Forks live on mainnet
28+
#### Forks live on mainnet
2829

2930
The folder `src/ethereum` contains the specifications for the different execution layer forks. Each fork has its own folder. For example, the folder `src/ethereum/frontier` contains the specifications for the Frontier hardfork. The `state_transition` function which is available in the `src/ethereum/<FORK NAME>/fork.py` is the transition function for each fork.
3031

31-
### Fork under development
32+
#### Fork under development
3233

33-
At any given time, there is a single fork under development. Any new EIP has to be implemented in the folder that is meant for that fork (`src/ethereum/<FORK_NAME>` folder).
34+
At any given time, there is a single fork under development. Any new EIP has to be implemented in the folder that is meant for that fork (`src/ethereum/<FORK_NAME>` folder).
3435

3536
For example, at the time of writing, the Prague Fork is still under development and the previous fork is Cancun, which is live on Mainnet. So the prague folder under `src/ethereum` is essentially just the Cancun fork with the values of variables updated to reflect Prague and its under-development status. This folder (`src/ethereum/prague`) serves as the baseline for further development and all new EIPs are to be implemented in this folder.
3637

37-
## Branch Structure
38+
### Branch Structure
3839

39-
### Forks live on mainnet
40+
#### Forks live on mainnet
4041

4142
The final stable specification for all forks that are currently live on mainnet are in the `master` branch.
4243

43-
### Fork under development
44+
#### Fork under development
4445

4546
At any given time, there can only be one fork under active development. The branch structure for the fork under development is as follows:
4647

47-
- `forks/<FORK_NAME>`: The main branch for the fork under development. For example, `forks/prague` is the branch for the Prague fork. This branch will be merged into `master` after the fork has gone live on mainnet.
48+
- `forks/<FORK_NAME>`: The main branch for the fork under development. For example, `forks/prague` is the branch for the Prague fork. This branch will be merged into `master` after the fork has gone live on mainnet.
4849
- `eips/<FORK_NAME>/<EIP_NUMBER>`: Branches for each EIP within the fork under development. For example, `eips/prague/eip-7702` is the branch for EIP-7702 for the Prague fork. This branch will be merged into `forks/prague` after the EIP has been confirmed for release in the fork.
4950

50-
# Writing New EIPS
51+
## Writing New EIPS
5152

5253
Implementing a new EIP in the `execution-specs` repository involves the following steps:
5354

@@ -61,7 +62,7 @@ An EIP can only be CFI'd (Considered For Inclusion) if it has a reference `execu
6162
Please refer the following tutorial for writing new EIP. It takes you through a sample EIP for adding a new opcode to the specs.
6263
[Tutorial](https://www.youtube.com/watch?v=QIcw_DGSy3s&t)
6364

64-
# Writing Tests with `execution-spec-tests`
65+
## Writing Tests with `execution-spec-tests`
6566

6667
In addition to having a reference implementation, it is also very useful for the community and core development if the EIP author concieves and writes test vectors for the EIP. There is a very user friendly framework for writing ethereum tests in the `execution-spec-tests` repository. Please refer to the following guide for writing tests to your EIP.
6768

LICENSE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ For these and/or other purposes and motivations, and without any expectation of
3232
2. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
3333
3. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
3434
4. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
35-

0 commit comments

Comments
 (0)