Skip to content

Commit 492572d

Browse files
authored
Add EIP-7805 (FOCIL) specs (ethereum#4003)
1 parent 2cc2cd9 commit 492572d

15 files changed

Lines changed: 784 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ tests/core/pyspec/eth2spec/fulu/
2727
tests/core/pyspec/eth2spec/eip6800/
2828
tests/core/pyspec/eth2spec/eip7441/
2929
tests/core/pyspec/eth2spec/eip7732/
30+
tests/core/pyspec/eth2spec/eip7805/
3031

3132
# coverage reports
3233
.htmlcov

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ ALL_EXECUTABLE_SPEC_NAMES = \
1212
fulu \
1313
eip6800 \
1414
eip7441 \
15-
eip7732
15+
eip7732 \
16+
eip7805
1617

1718
# A list of fake targets.
1819
.PHONY: \
@@ -265,4 +266,4 @@ kzg_setups: pyspec
265266

266267
# Delete all untracked files.
267268
clean:
268-
@git clean -fdx
269+
@git clean -fdx

configs/mainnet.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,8 @@ PROPOSER_SELECTION_GAP: 2
181181

182182
# EIP7732
183183
MAX_REQUEST_PAYLOADS: 128
184+
185+
# EIP7805
186+
ATTESTATION_DEADLINE: 4
187+
PROPOSER_INCLUSION_LIST_CUT_OFF: 11
188+
VIEW_FREEZE_DEADLINE: 9

configs/minimal.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,8 @@ PROPOSER_SELECTION_GAP: 1
182182

183183
# EIP7732
184184
MAX_REQUEST_PAYLOADS: 128
185+
186+
# EIP7805
187+
ATTESTATION_DEADLINE: 2
188+
PROPOSER_INCLUSION_LIST_CUT_OFF: 5
189+
VIEW_FREEZE_DEADLINE: 3

pysetup/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
EIP6800 = 'eip6800'
1010
EIP7441 = 'eip7441'
1111
EIP7732 = 'eip7732'
12+
EIP7805 = 'eip7805'
1213

1314

1415
# The helper functions that are used when defining constants

pysetup/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def combine_dicts(old_dict: Dict[str, T], new_dict: Dict[str, T]) -> Dict[str, T
198198
'uint8', 'uint16', 'uint32', 'uint64', 'uint128', 'uint256',
199199
'bytes', 'byte', 'ByteList', 'ByteVector',
200200
'Dict', 'dict', 'field', 'ceillog2', 'floorlog2', 'Set',
201-
'Optional', 'Sequence',
201+
'Optional', 'Sequence', 'Tuple',
202202
]
203203

204204

pysetup/md_doc_paths.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
EIP6800,
1212
EIP7441,
1313
EIP7732,
14+
EIP7805,
1415
)
1516

1617

@@ -25,6 +26,7 @@
2526
EIP6800: DENEB,
2627
EIP7441: CAPELLA,
2728
EIP7732: ELECTRA,
29+
EIP7805: ELECTRA,
2830
}
2931

3032
ALL_FORKS = list(PREVIOUS_FORK_OF.keys())

pysetup/spec_builders/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
from .eip6800 import EIP6800SpecBuilder
99
from .eip7441 import EIP7441SpecBuilder
1010
from .eip7732 import EIP7732SpecBuilder
11+
from .eip7805 import EIP7805SpecBuilder
1112

1213

1314
spec_builders = {
1415
builder.fork: builder
1516
for builder in (
1617
Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, DenebSpecBuilder,
1718
ElectraSpecBuilder, FuluSpecBuilder, EIP6800SpecBuilder, EIP7441SpecBuilder, EIP7732SpecBuilder,
19+
EIP7805SpecBuilder,
1820
)
1921
}

pysetup/spec_builders/eip7805.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
from .base import BaseSpecBuilder
2+
from ..constants import EIP7805
3+
4+
5+
class EIP7805SpecBuilder(BaseSpecBuilder):
6+
fork: str = EIP7805
7+
8+
9+
@classmethod
10+
def execution_engine_cls(cls) -> str:
11+
return """
12+
class NoopExecutionEngine(ExecutionEngine):
13+
14+
def notify_new_payload(self: ExecutionEngine,
15+
execution_payload: ExecutionPayload,
16+
parent_beacon_block_root: Root,
17+
execution_requests_list: Sequence[bytes],
18+
inclusion_list_transactions: Sequence[Transaction]) -> bool:
19+
return True
20+
21+
def notify_forkchoice_updated(self: ExecutionEngine,
22+
head_block_hash: Hash32,
23+
safe_block_hash: Hash32,
24+
finalized_block_hash: Hash32,
25+
payload_attributes: Optional[PayloadAttributes]) -> Optional[PayloadId]:
26+
pass
27+
28+
def get_payload(self: ExecutionEngine, payload_id: PayloadId) -> GetPayloadResponse:
29+
# pylint: disable=unused-argument
30+
raise NotImplementedError("no default block production")
31+
32+
def is_valid_block_hash(self: ExecutionEngine,
33+
execution_payload: ExecutionPayload,
34+
parent_beacon_block_root: Root,
35+
execution_requests_list: Sequence[bytes],
36+
inclusion_list_transactions: Sequence[Transaction]) -> bool:
37+
return True
38+
39+
def is_valid_versioned_hashes(self: ExecutionEngine, new_payload_request: NewPayloadRequest) -> bool:
40+
return True
41+
42+
def verify_and_notify_new_payload(self: ExecutionEngine,
43+
new_payload_request: NewPayloadRequest) -> bool:
44+
return True
45+
46+
47+
EXECUTION_ENGINE = NoopExecutionEngine()"""

0 commit comments

Comments
 (0)