Skip to content

Commit 8f8ab03

Browse files
authored
Merge pull request #3828 from potuz/epbs_cl_repo
EIP-7732: Enshrined Proposer-Builder Separation
2 parents 572ca9e + 74124f5 commit 8f8ab03

File tree

24 files changed

+2111
-13
lines changed

24 files changed

+2111
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ tests/core/pyspec/eth2spec/electra/
2525
tests/core/pyspec/eth2spec/whisk/
2626
tests/core/pyspec/eth2spec/eip7594/
2727
tests/core/pyspec/eth2spec/eip6800/
28+
tests/core/pyspec/eth2spec/eip7732/
2829

2930
# coverage reports
3031
.htmlcov

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/*/*.md) \
3434
$(wildcard $(SPEC_DIR)/_features/*/*/*.md) \
3535
$(wildcard $(SSZ_DIR)/*.md)
3636

37-
ALL_EXECUTABLE_SPEC_NAMES = phase0 altair bellatrix capella deneb electra whisk eip6800
37+
ALL_EXECUTABLE_SPEC_NAMES = phase0 altair bellatrix capella deneb electra whisk eip6800 eip7732
3838
# The parameters for commands. Use `foreach` to avoid listing specs again.
3939
COVERAGE_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), --cov=eth2spec.$S.$(TEST_PRESET_TYPE))
4040
PYLINT_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), ./eth2spec/$S)

configs/mainnet.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ EIP7594_FORK_EPOCH: 18446744073709551615
5959
# WHISK
6060
WHISK_FORK_VERSION: 0x08000000 # temporary stub
6161
WHISK_FORK_EPOCH: 18446744073709551615
62+
# EIP7732
63+
EIP7732_FORK_VERSION: 0x09000000 # temporary stub
64+
EIP7732_FORK_EPOCH: 18446744073709551615
6265

6366
# Time parameters
6467
# ---------------------------------------------------------------

configs/minimal.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ EIP7594_FORK_EPOCH: 18446744073709551615
5858
# WHISK
5959
WHISK_FORK_VERSION: 0x08000001
6060
WHISK_FORK_EPOCH: 18446744073709551615
61+
# EIP7732
62+
EIP7732_FORK_VERSION: 0x09000001
63+
EIP7732_FORK_EPOCH: 18446744073709551615
6164

6265
# Time parameters
6366
# ---------------------------------------------------------------

presets/mainnet/eip-7732.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Mainnet preset - EIP7732
2+
3+
# Execution
4+
# ---------------------------------------------------------------
5+
# 2**9 (= 512)
6+
PTC_SIZE: 512
7+
# 2**2 (= 4)
8+
MAX_PAYLOAD_ATTESTATIONS: 4
9+
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH_EIP7732: 13

presets/minimal/eip-7732.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Minimal preset - EIP7732
2+
3+
# Execution
4+
# ---------------------------------------------------------------
5+
# 2**1(= 2)
6+
PTC_SIZE: 2
7+
# 2**2 (= 4)
8+
MAX_PAYLOAD_ATTESTATIONS: 4
9+
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH_EIP7732: 13

pysetup/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
EIP7594 = 'eip7594'
99
EIP6800 = 'eip6800'
1010
WHISK = 'whisk'
11+
EIP7732 = 'eip7732'
1112

1213

1314
# The helper functions that are used when defining constants

pysetup/helpers.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,22 @@ def format_constant(name: str, vardef: VariableDefinition) -> str:
124124
# Keep engine from the most recent fork
125125
execution_engine_cls = reduce(lambda txt, builder: builder.execution_engine_cls() or txt, builders, "")
126126

127+
# Remove deprecated constants
128+
deprecate_constants = reduce(lambda obj, builder: obj.union(builder.deprecate_constants()), builders, set())
129+
# constant_vars = {k: v for k, v in spec_object.constant_vars.items() if k not in deprecate_constants}
130+
filtered_ssz_dep_constants = {k: v for k, v in hardcoded_ssz_dep_constants.items() if k not in deprecate_constants}
131+
# Remove deprecated presets
132+
deprecate_presets = reduce(lambda obj, builder: obj.union(builder.deprecate_presets()), builders, set())
133+
# preset_vars = {k: v for k, v in spec_object.constant_vars.items() if k not in deprecate_constants}
134+
filtered_hardcoded_func_dep_presets = {k: v for k, v in hardcoded_func_dep_presets.items() if k not in deprecate_presets}
135+
127136
constant_vars_spec = '# Constant vars\n' + '\n'.join(format_constant(k, v) for k, v in spec_object.constant_vars.items())
128137
preset_vars_spec = '# Preset vars\n' + '\n'.join(format_constant(k, v) for k, v in spec_object.preset_vars.items())
129138
ordered_class_objects_spec = '\n\n\n'.join(ordered_class_objects.values())
130139
ssz_dep_constants = '\n'.join(map(lambda x: '%s = %s' % (x, hardcoded_ssz_dep_constants[x]), hardcoded_ssz_dep_constants))
131-
ssz_dep_constants_verification = '\n'.join(map(lambda x: 'assert %s == %s' % (x, spec_object.ssz_dep_constants[x]), hardcoded_ssz_dep_constants))
140+
ssz_dep_constants_verification = '\n'.join(map(lambda x: 'assert %s == %s' % (x, spec_object.ssz_dep_constants[x]), filtered_ssz_dep_constants))
132141
custom_type_dep_constants = '\n'.join(map(lambda x: '%s = %s' % (x, hardcoded_custom_type_dep_constants[x]), hardcoded_custom_type_dep_constants))
133-
func_dep_presets_verification = '\n'.join(map(lambda x: 'assert %s == %s # noqa: E501' % (x, spec_object.func_dep_presets[x]), hardcoded_func_dep_presets))
142+
func_dep_presets_verification = '\n'.join(map(lambda x: 'assert %s == %s # noqa: E501' % (x, spec_object.func_dep_presets[x]), filtered_hardcoded_func_dep_presets))
134143
spec_strs = [
135144
imports,
136145
preparations,

pysetup/md_doc_paths.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
WHISK,
1111
EIP7594,
1212
EIP6800,
13+
EIP7732,
1314
)
1415

1516

@@ -23,6 +24,7 @@
2324
WHISK: CAPELLA,
2425
EIP7594: DENEB,
2526
EIP6800: DENEB,
27+
EIP7732: ELECTRA,
2628
}
2729

2830
ALL_FORKS = list(PREVIOUS_FORK_OF.keys())

pysetup/spec_builders/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
from .whisk import WhiskSpecBuilder
88
from .eip7594 import EIP7594SpecBuilder
99
from .eip6800 import EIP6800SpecBuilder
10+
from .eip7732 import EIP7732SpecBuilder
1011

1112

1213
spec_builders = {
1314
builder.fork: builder
1415
for builder in (
1516
Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, DenebSpecBuilder,
16-
ElectraSpecBuilder, WhiskSpecBuilder, EIP7594SpecBuilder, EIP6800SpecBuilder,
17+
ElectraSpecBuilder, WhiskSpecBuilder, EIP7594SpecBuilder, EIP6800SpecBuilder, EIP7732SpecBuilder,
1718
)
1819
}

0 commit comments

Comments
 (0)