Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ePBS #9

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from
8 changes: 8 additions & 0 deletions presets/mainnet/eip-xxxx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Mainnet preset - EIPXXXX

# Execution
# ---------------------------------------------------------------
# 2**9 (= 512)
PTC_SIZE: 512
# 2**2 (= 4)
MAX_PAYLOAD_ATTESTATIONS: 4
8 changes: 8 additions & 0 deletions presets/minimal/eip-xxxx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Minimal preset - EIPXXXX

# Execution
# ---------------------------------------------------------------
# 2**1(= 2)
PTC_SIZE: 2
# 2**2 (= 4)
MAX_PAYLOAD_ATTESTATIONS: 4
1 change: 1 addition & 0 deletions pysetup/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
EIP7594 = 'eip7594'
EIP6800 = 'eip6800'
WHISK = 'whisk'
EIPXXXX = 'eipxxxx'


# The helper functions that are used when defining constants
Expand Down
2 changes: 2 additions & 0 deletions pysetup/md_doc_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
WHISK,
EIP7594,
EIP6800,
EIPXXXX,
)


Expand All @@ -23,6 +24,7 @@
WHISK: CAPELLA,
EIP7594: DENEB,
EIP6800: DENEB,
EIPXXXX: ELECTRA,
}

ALL_FORKS = list(PREVIOUS_FORK_OF.keys())
Expand Down
3 changes: 2 additions & 1 deletion pysetup/spec_builders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
from .whisk import WhiskSpecBuilder
from .eip7594 import EIP7594SpecBuilder
from .eip6800 import EIP6800SpecBuilder
from .eipxxxx import EIPXXXXSpecBuilder


spec_builders = {
builder.fork: builder
for builder in (
Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, DenebSpecBuilder,
ElectraSpecBuilder, WhiskSpecBuilder, EIP7594SpecBuilder, EIP6800SpecBuilder,
ElectraSpecBuilder, WhiskSpecBuilder, EIP7594SpecBuilder, EIP6800SpecBuilder, EIPXXXXSpecBuilder,
)
}
21 changes: 21 additions & 0 deletions pysetup/spec_builders/eipxxxx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from typing import Dict

from .base import BaseSpecBuilder
from ..constants import EIPXXXX


class EIPXXXXSpecBuilder(BaseSpecBuilder):
fork: str = EIPXXXX

@classmethod
def imports(cls, preset_name: str):
return f'''
from eth2spec.eipxxxx import {preset_name} as eipxxxx
'''

@classmethod
def hardcoded_custom_type_dep_constants(cls, spec_object) -> Dict[str, str]:
return {
'PTC_SIZE': spec_object.preset_vars['PTC_SIZE'].value,
'MAX_PAYLOAD_ATTESTATIONS': spec_object.preset_vars['MAX_PAYLOAD_ATTESTATIONS'].value,
}
Loading
Loading