Skip to content

Commit 50972f9

Browse files
authored
Merge pull request #3230 from gballet/gballet/add-proof-verge
TheVerge: spec draft
2 parents 071f0a3 + 8737e69 commit 50972f9

File tree

13 files changed

+427
-5
lines changed

13 files changed

+427
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ tests/core/pyspec/eth2spec/deneb/
2424
tests/core/pyspec/eth2spec/electra/
2525
tests/core/pyspec/eth2spec/whisk/
2626
tests/core/pyspec/eth2spec/eip7594/
27+
tests/core/pyspec/eth2spec/eip6800/
2728

2829
# coverage reports
2930
.htmlcov

Makefile

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

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

presets/mainnet/eip6800.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Mainnet preset - EIP6800
2+
3+
# Misc
4+
# ---------------------------------------------------------------
5+
# `uint64(2**16)` (= 65,536)
6+
MAX_STEMS: 65536
7+
# `uint64(33)`
8+
MAX_COMMITMENTS_PER_STEM: 33
9+
# `uint64(2**8)` (= 256)
10+
VERKLE_WIDTH: 256
11+
# `uint64(2**3)` (= 8)
12+
IPA_PROOF_DEPTH: 8

presets/minimal/eip6800.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Minimal preset - EIP6800
2+
3+
# Execution
4+
# ---------------------------------------------------------------
5+
# `uint64(2**16)` (= 65,536)
6+
MAX_STEMS: 65536
7+
# `uint64(33)`
8+
MAX_COMMITMENTS_PER_STEM: 33
9+
# `uint64(2**8)` (= 256)
10+
VERKLE_WIDTH: 256
11+
# `uint64(2**3)` (= 8)
12+
IPA_PROOF_DEPTH: 8

pysetup/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
DENEB = 'deneb'
77
ELECTRA = 'electra'
88
EIP7594 = 'eip7594'
9+
EIP6800 = 'eip6800'
910
WHISK = 'whisk'
1011

1112

12-
1313
# The helper functions that are used when defining constants
1414
CONSTANT_DEP_SUNDRY_CONSTANTS_FUNCTIONS = '''
1515
def ceillog2(x: int) -> uint64:

pysetup/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def combine_dicts(old_dict: Dict[str, T], new_dict: Dict[str, T]) -> Dict[str, T
178178

179179
ignored_dependencies = [
180180
'bit', 'boolean', 'Vector', 'List', 'Container', 'BLSPubkey', 'BLSSignature',
181-
'Bytes1', 'Bytes4', 'Bytes8', 'Bytes20', 'Bytes32', 'Bytes48', 'Bytes96', 'Bitlist', 'Bitvector',
181+
'Bytes1', 'Bytes4', 'Bytes8', 'Bytes20', 'Bytes31', 'Bytes32', 'Bytes48', 'Bytes96', 'Bitlist', 'Bitvector',
182182
'uint8', 'uint16', 'uint32', 'uint64', 'uint128', 'uint256',
183183
'bytes', 'byte', 'ByteList', 'ByteVector',
184184
'Dict', 'dict', 'field', 'ceillog2', 'floorlog2', 'Set',

pysetup/md_doc_paths.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
ELECTRA,
1010
WHISK,
1111
EIP7594,
12+
EIP6800,
1213
)
1314

1415

@@ -21,6 +22,7 @@
2122
ELECTRA: DENEB,
2223
WHISK: CAPELLA,
2324
EIP7594: DENEB,
25+
EIP6800: DENEB,
2426
}
2527

2628
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
@@ -6,12 +6,13 @@
66
from .electra import ElectraSpecBuilder
77
from .whisk import WhiskSpecBuilder
88
from .eip7594 import EIP7594SpecBuilder
9+
from .eip6800 import EIP6800SpecBuilder
910

1011

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

pysetup/spec_builders/eip6800.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from typing import Dict
2+
3+
from .base import BaseSpecBuilder
4+
from ..constants import EIP6800
5+
6+
7+
class EIP6800SpecBuilder(BaseSpecBuilder):
8+
fork: str = EIP6800
9+
10+
@classmethod
11+
def imports(cls, preset_name: str):
12+
return f'''
13+
from eth2spec.deneb import {preset_name} as deneb
14+
from eth2spec.utils.ssz.ssz_typing import Bytes31
15+
'''
16+
17+
@classmethod
18+
def hardcoded_custom_type_dep_constants(cls, spec_object) -> str:
19+
return {
20+
'MAX_STEMS': spec_object.preset_vars['MAX_STEMS'].value,
21+
}

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,13 @@ def get_spec(file_name: Path, preset: Dict[str, str], config: Dict[str, str], pr
219219
elif source.startswith("class"):
220220
class_name, parent_class = _get_class_info_from_source(source)
221221
# check consistency with spec
222-
assert class_name == current_name
222+
try:
223+
assert class_name == current_name
224+
except Exception:
225+
print('class_name', class_name)
226+
print('current_name', current_name)
227+
raise
228+
223229
if parent_class:
224230
assert parent_class == "Container"
225231
# NOTE: trim whitespace from spec

0 commit comments

Comments
 (0)