Skip to content

Commit 3e72922

Browse files
authored
Merge pull request #4399 from ethereum/dev
Release v1.6.0-alpha.3
2 parents 5ab504f + 87a224e commit 3e72922

143 files changed

Lines changed: 19578 additions & 1582 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/release-drafter.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
categories:
2+
# Forks
3+
- title: Phase0
4+
label: phase0
5+
- title: Altair
6+
label: altair
7+
- title: Bellatrix
8+
label: bellatrix
9+
- title: Capella
10+
label: capella
11+
- title: Deneb
12+
label: deneb
13+
- title: Electra
14+
label: electra
15+
- title: Fulu
16+
label: fulu
17+
18+
# Features
19+
- title: EIP-6110
20+
label: eip6110
21+
- title: EIP-7441
22+
label: eip7441
23+
- title: EIP-7594
24+
label: eip7594
25+
- title: EIP-7732
26+
label: eip7732
27+
- title: EIP-7805
28+
label: eip7805
29+
30+
# Testing
31+
- title: Testing
32+
label: testing
33+
34+
# Fallback
35+
- title: Other
36+
37+
sort-by: number
38+
sort-direction: ascending
39+
change-title-escapes: '\<*_&'
40+
change-template: '- $TITLE (#$NUMBER)'
41+
template: |
42+
$CHANGES

.github/workflows/release.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
timeout-minutes: 720 # 12 hours
11+
runs-on: [self-hosted-ghr-custom, size-xl-x64, profile-consensusSpecs]
12+
permissions:
13+
contents: write
14+
packages: write
15+
pull-requests: read
16+
17+
steps:
18+
# Clone specs
19+
- name: Checkout repository
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
with:
22+
path: 'consensus-specs'
23+
24+
# Setup python
25+
- name: Setup Python
26+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
27+
with:
28+
python-version: '3.13'
29+
30+
# As a sanity check, ensure tests pass
31+
- name: Run tests for minimal
32+
run: make test preset=minimal
33+
- name: Run tests for mainnet
34+
run: make test preset=mainnet
35+
36+
# Add support for large files
37+
- name: Install Git LFS
38+
run: |
39+
sudo apt-get update
40+
sudo apt-get install -y git-lfs
41+
git lfs install
42+
43+
# Clone the repo with our PAT and delete old files
44+
- name: Clone spec tests repo
45+
run: |
46+
git clone https://x-access-token:${{ secrets.CONSENSUS_SPEC_TESTS_PAT }}@github.com/ethereum/consensus-spec-tests.git --depth=1
47+
cd consensus-spec-tests
48+
rm -rf configs presets tests
49+
50+
# Write presets/configs to the spec tests repo
51+
- name: Copy presets/configs
52+
run: |
53+
cd consensus-specs
54+
cp -r presets/ ../consensus-spec-tests/presets
55+
cp -r configs/ ../consensus-spec-tests/configs
56+
57+
# Write reference tests to the spec tests repo
58+
- name: Generate reference tests
59+
run: |
60+
cd consensus-specs
61+
make reftests verbose=true
62+
63+
# Make tarballs
64+
- name: Archive configurations
65+
run: |
66+
cd consensus-spec-tests
67+
tar -czvf general.tar.gz tests/general
68+
tar -czvf minimal.tar.gz tests/minimal
69+
tar -czvf mainnet.tar.gz tests/mainnet
70+
71+
# Commit the tests to the spec tests repo
72+
# Cloned with PAT, so don't need to specify it here
73+
- name: Push spec tests
74+
run: |
75+
cd consensus-spec-tests
76+
git config user.name "github-actions"
77+
git config user.email "[email protected]"
78+
git add .
79+
if ! git diff --cached --quiet; then
80+
git commit -m "release ${{ github.ref_name }} tests"
81+
git push
82+
else
83+
echo "No changes to commit"
84+
fi
85+
86+
# Publish the specs release. We use release-drafter to
87+
# organize PRs into the appropriate section based on PR labels
88+
- name: Publish specs release
89+
uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
90+
with:
91+
name: ${{ github.ref_name }}
92+
tag: ${{ github.ref_name }}
93+
prerelease: ${{ contains(github.ref_name, '-') }}
94+
publish: true
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
98+
# Finally, publish the spec tests release
99+
# Requires a personal access token (PAT) with contents:read-write
100+
- name: Publish spec tests release
101+
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
102+
with:
103+
tag_name: ${{ github.ref_name }}
104+
name: "Spec tests for ${{ github.ref_name }}"
105+
body: |
106+
Spec tests for `${{ github.ref_name }}`.
107+
108+
Detailed changelog can be found in [`${{ github.ref_name }}` specs release](https://github.com/ethereum/consensus-specs/releases/tag/${{ github.ref_name }}).
109+
prerelease: ${{ contains(github.ref_name, '-') }}
110+
draft: false
111+
repository: ethereum/consensus-spec-tests
112+
files: |
113+
consensus-spec-tests/general.tar.gz
114+
consensus-spec-tests/minimal.tar.gz
115+
consensus-spec-tests/mainnet.tar.gz
116+
env:
117+
GITHUB_TOKEN: ${{ secrets.CONSENSUS_SPEC_TESTS_PAT }}

.github/workflows/stale.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Close stale issues and PRs
2+
3+
on:
4+
schedule:
5+
# Every day at 00:00 UTC
6+
- cron: '0 0 * * *'
7+
8+
jobs:
9+
stale:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
actions: write
13+
issues: write
14+
pull-requests: write
15+
steps:
16+
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
17+
with:
18+
days-before-stale: 365
19+
days-before-close: 30
20+
stale-issue-label: stale
21+
stale-pr-label: stale
22+
stale-issue-message: |
23+
This issue has been inactive for one year.
24+
Marking as stale.
25+
It will be closed after another 30 days of inactivity.
26+
stale-pr-message: |
27+
This PR has been inactive for one year.
28+
Marking as stale.
29+
It will be closed after another 30 days of inactivity.

Makefile

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ NORM = $(shell tput sgr0)
3737
# Print target descriptions.
3838
help:
3939
@echo "make $(BOLD)clean$(NORM) -- delete all untracked files"
40+
@echo "make $(BOLD)comptests$(NORM) -- generate compliance tests"
4041
@echo "make $(BOLD)coverage$(NORM) -- run pyspec tests with coverage"
4142
@echo "make $(BOLD)kzg_setups$(NORM) -- generate trusted setups"
4243
@echo "make $(BOLD)lint$(NORM) -- run the linters"
@@ -176,12 +177,7 @@ PYLINT_CONFIG = $(CURDIR)/pylint.ini
176177

177178
PYLINT_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), $(PYSPEC_DIR)/eth2spec/$S)
178179
MYPY_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), -p eth2spec.$S)
179-
MARKDOWN_FILES = $(CURDIR)/README.md \
180-
$(wildcard $(SPEC_DIR)/*/*.md) \
181-
$(wildcard $(SPEC_DIR)/*/*/*.md) \
182-
$(wildcard $(SPEC_DIR)/_features/*/*.md) \
183-
$(wildcard $(SPEC_DIR)/_features/*/*/*.md) \
184-
$(wildcard $(SSZ_DIR)/*.md)
180+
MARKDOWN_FILES := $(shell find $(CURDIR) -name '*.md')
185181

186182
# Check for mistakes.
187183
lint: pyspec
@@ -242,6 +238,27 @@ kzg_setups: pyspec
242238
--output-dir $(CURDIR)/presets/$$preset/trusted_setups; \
243239
done
244240

241+
COMP_TEST_VECTOR_DIR = $(CURDIR)/../compliance-spec-tests/tests
242+
243+
# Generate compliance tests (fork choice).
244+
# This will forcibly rebuild pyspec just in case.
245+
# To generate compliance tests with a particular configuration, append fc_gen_config=<config>,
246+
# where <config> can be either tiny, small or standard, eg:
247+
# make comptests fc_gen_config=standard
248+
# One can specify threads=N, fork=<fork> or preset=<preset> as with reftests, eg:
249+
# make comptests fc_gen_config=standard fork=deneb preset=mainnet threads=8
250+
comptests: FC_GEN_CONFIG := $(if $(fc_gen_config),$(fc_gen_config),tiny)
251+
comptests: MAYBE_THREADS := $(if $(threads),--threads=$(threads),--fc-gen-multi-processing)
252+
comptests: MAYBE_FORKS := $(if $(fork),--forks $(subst ${COMMA}, ,$(fork)))
253+
comptests: MAYBE_PRESETS := $(if $(preset),--presets $(subst ${COMMA}, ,$(preset)))
254+
comptests: pyspec
255+
@$(PYTHON_VENV) -m tests.generators.compliance_runners.fork_choice.test_gen \
256+
--output $(COMP_TEST_VECTOR_DIR) \
257+
--fc-gen-config $(FC_GEN_CONFIG) \
258+
$(MAYBE_THREADS) \
259+
$(MAYBE_FORKS) \
260+
$(MAYBE_PRESETS)
261+
245262
###############################################################################
246263
# Cleaning
247264
###############################################################################

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ consensus specifications:
9999
- [Design Rationale](https://notes.ethereum.org/s/rkhCgQteN#)
100100
- [Phase0 Onboarding Document](https://notes.ethereum.org/s/Bkn3zpwxB)
101101
- [Combining GHOST and Casper paper](https://arxiv.org/abs/2003.03052)
102-
- [Online specifications viewer](https://ethereum.github.io/consensus-specs/)
102+
- [Specifications viewer (mkdocs)](https://ethereum.github.io/consensus-specs/)
103+
- [Specifications viewer (jtraglia)](https://jtraglia.github.io/eth-spec-viewer/)
103104
- [The Eth2 Book](https://eth2book.info)
104105
- [PySpec Tests](tests/core/pyspec/README.md)
105106
- [Reference Tests Generators](tests/generators/README.md)

SECURITY.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22

33
## Supported Versions
44

5-
Please see [Releases](https://github.com/ethereum/consensus-specs/releases/). We recommend using the [most recently released version](https://github.com/ethereum/consensus-specs/releases/latest).
5+
Please see [Releases](https://github.com/ethereum/consensus-specs/releases/). We
6+
recommend using the
7+
[most recently released version](https://github.com/ethereum/consensus-specs/releases/latest).
68

79
## Reporting a Vulnerability
810

911
**Please do not file a public ticket** mentioning the vulnerability.
1012

11-
To find out how to disclose a vulnerability in the Ethereum Consensus Layer visit [https://bounty.ethereum.org](https://bounty.ethereum.org) or email [email protected]. Please read the [disclosure page](https://bounty.ethereum.org) for more information about publicly disclosed security vulnerabilities.
13+
To find out how to disclose a vulnerability in the Ethereum Consensus Layer
14+
visit [https://bounty.ethereum.org](https://bounty.ethereum.org) or email
15+
[email protected]. Please read the
16+
[disclosure page](https://bounty.ethereum.org) for more information about
17+
publicly disclosed security vulnerabilities.

configs/README.md

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,51 @@
11
# Configurations
22

3-
This directory contains a set of configurations used for testing, testnets, and mainnet.
4-
A client binary may be compiled for a specific `PRESET_BASE`,
5-
and then load different configurations around that preset to participate in different networks or tests.
3+
This directory contains a set of configurations used for testing, testnets, and
4+
mainnet. A client binary may be compiled for a specific `PRESET_BASE`, and then
5+
load different configurations around that preset to participate in different
6+
networks or tests.
67

78
Standard configs:
9+
810
- [`mainnet.yaml`](./mainnet.yaml): Mainnet configuration
9-
- [`minimal.yaml`](./minimal.yaml): Minimal configuration, used in spec-testing along with the [`minimal`](../presets/minimal) preset.
11+
- [`minimal.yaml`](./minimal.yaml): Minimal configuration, used in spec-testing
12+
along with the [`minimal`](../presets/minimal) preset.
1013

11-
Not all network configurations are in scope for the specification,
12-
see [`github.com/eth-clients/eth2-networks`](https://github.com/eth-clients/eth2-networks) for common networks,
13-
and additional testnet assets.
14+
Not all network configurations are in scope for the specification, see
15+
[`github.com/eth-clients/eth2-networks`](https://github.com/eth-clients/eth2-networks)
16+
for common networks, and additional testnet assets.
1417

1518
## Forking
1619

17-
Variables are not replaced but extended with forks. This is to support syncing from one state to another over a fork boundary, without hot-swapping a config.
18-
Instead, for forks that introduce changes in a variable, the variable name is suffixed with the fork name, e.g. `INACTIVITY_PENALTY_QUOTIENT_ALTAIR`.
20+
Variables are not replaced but extended with forks. This is to support syncing
21+
from one state to another over a fork boundary, without hot-swapping a config.
22+
Instead, for forks that introduce changes in a variable, the variable name is
23+
suffixed with the fork name, e.g. `INACTIVITY_PENALTY_QUOTIENT_ALTAIR`.
1924

20-
Future-fork variables can be ignored, e.g. ignore Sharding variables as a client that only supports Phase 0 currently.
25+
Future-fork variables can be ignored, e.g. ignore Sharding variables as a client
26+
that only supports Phase 0 currently.
2127

22-
Over time, the need to sync an older state may be deprecated.
23-
In this case, the suffix on the new variable may be removed, and the old variable will keep a special name before completely being removed.
28+
Over time, the need to sync an older state may be deprecated. In this case, the
29+
suffix on the new variable may be removed, and the old variable will keep a
30+
special name before completely being removed.
2431

25-
A previous iteration of forking made use of "timelines", but this collides with the definitions used in the spec (variables for special forking slots, etc.), and was not integrated sufficiently in any of the spec tools or implementations.
26-
Instead, the config essentially doubles as fork definition now, e.g. changing the value for `ALTAIR_FORK_EPOCH` changes the fork.
32+
A previous iteration of forking made use of "timelines", but this collides with
33+
the definitions used in the spec (variables for special forking slots, etc.),
34+
and was not integrated sufficiently in any of the spec tools or implementations.
35+
Instead, the config essentially doubles as fork definition now, e.g. changing
36+
the value for `ALTAIR_FORK_EPOCH` changes the fork.
2737

2838
## Format
2939

3040
Each preset and configuration is a key-value mapping.
3141

32-
**Key**: an `UPPER_SNAKE_CASE` (a.k.a. "macro case") formatted string, name of the variable.
42+
**Key**: an `UPPER_SNAKE_CASE` (a.k.a. "macro case") formatted string, name of
43+
the variable.
3344

3445
**Value** can be either:
35-
- an unsigned integer number, can be up to 64 bits (incl.)
36-
- a hexadecimal string, prefixed with `0x`
3746

38-
This format is fully YAML compatible.
39-
The presets and configurations may contain comments to describe the values.
47+
- an unsigned integer number, can be up to 64 bits (incl.)
48+
- a hexadecimal string, prefixed with `0x`
49+
50+
This format is fully YAML compatible. The presets and configurations may contain
51+
comments to describe the values.

0 commit comments

Comments
 (0)