Skip to content

Commit b81a658

Browse files
committed
address *_by_fork testing infra comment
1 parent d51e841 commit b81a658

3 files changed

Lines changed: 60 additions & 52 deletions

File tree

packages/testing/src/execution_testing/ssz/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@
1515
MAX_WITHDRAWALS_PER_PAYLOAD,
1616
)
1717
from .containers import (
18-
BUILT_PAYLOAD_BY_FORK,
19-
EXECUTION_PAYLOAD_BODY_BY_FORK,
2018
EXECUTION_PAYLOAD_BY_FORK,
2119
EXECUTION_PAYLOAD_ENVELOPE_BY_FORK,
22-
FORKCHOICE_UPDATE_BY_FORK,
23-
PAYLOAD_ATTRIBUTES_BY_FORK,
2420
BlobAndProofV1,
2521
BlobAndProofV2,
2622
BlobCellsAndProofs,
@@ -208,12 +204,8 @@ def _opt_bytes(value: bytes | None) -> bytes | None:
208204

209205

210206
__all__ = (
211-
"BUILT_PAYLOAD_BY_FORK",
212-
"EXECUTION_PAYLOAD_BODY_BY_FORK",
213207
"EXECUTION_PAYLOAD_BY_FORK",
214208
"EXECUTION_PAYLOAD_ENVELOPE_BY_FORK",
215-
"FORKCHOICE_UPDATE_BY_FORK",
216-
"PAYLOAD_ATTRIBUTES_BY_FORK",
217209
"Address",
218210
"BlobAndProofV1",
219211
"BlobAndProofV2",

packages/testing/src/execution_testing/ssz/containers.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -313,16 +313,6 @@ class PayloadAttributesAmsterdam(Container):
313313
target_gas_limit: uint64
314314

315315

316-
PAYLOAD_ATTRIBUTES_BY_FORK: Dict[str, Type[Container]] = {
317-
"Paris": PayloadAttributesParis,
318-
"Shanghai": PayloadAttributesShanghai,
319-
"Cancun": PayloadAttributesCancun,
320-
"Prague": PayloadAttributesPrague,
321-
"Osaka": PayloadAttributesOsaka,
322-
"Amsterdam": PayloadAttributesAmsterdam,
323-
}
324-
325-
326316
class ForkchoiceState(Container):
327317
"""The forkchoice head/safe/finalized triple."""
328318

@@ -382,16 +372,6 @@ class ForkchoiceUpdateAmsterdam(Container):
382372
custody_columns: List[Bitvector[CELLS_PER_EXT_BLOB], 1]
383373

384374

385-
FORKCHOICE_UPDATE_BY_FORK: Dict[str, Type[Container]] = {
386-
"Paris": ForkchoiceUpdateParis,
387-
"Shanghai": ForkchoiceUpdateShanghai,
388-
"Cancun": ForkchoiceUpdateCancun,
389-
"Prague": ForkchoiceUpdatePrague,
390-
"Osaka": ForkchoiceUpdateOsaka,
391-
"Amsterdam": ForkchoiceUpdateAmsterdam,
392-
}
393-
394-
395375
class ForkchoiceUpdateResponse(Container):
396376
"""The forkchoice response: a status and an optional payload id."""
397377

@@ -441,16 +421,6 @@ class ExecutionPayloadBodyAmsterdam(Container):
441421
block_access_list: ByteList[MAX_BAL_BYTES]
442422

443423

444-
EXECUTION_PAYLOAD_BODY_BY_FORK: Dict[str, Type[Container]] = {
445-
"Paris": ExecutionPayloadBodyParis,
446-
"Shanghai": ExecutionPayloadBodyShanghai,
447-
"Cancun": ExecutionPayloadBodyCancun,
448-
"Prague": ExecutionPayloadBodyPrague,
449-
"Osaka": ExecutionPayloadBodyOsaka,
450-
"Amsterdam": ExecutionPayloadBodyAmsterdam,
451-
}
452-
453-
454424
class BlobsBundleV1(Container):
455425
"""The Cancun blobs bundle."""
456426

@@ -530,16 +500,6 @@ class BuiltPayloadAmsterdam(Container):
530500
should_override_builder: boolean
531501

532502

533-
BUILT_PAYLOAD_BY_FORK: Dict[str, Type[Container]] = {
534-
"Paris": BuiltPayloadParis,
535-
"Shanghai": BuiltPayloadShanghai,
536-
"Cancun": BuiltPayloadCancun,
537-
"Prague": BuiltPayloadPrague,
538-
"Osaka": BuiltPayloadOsaka,
539-
"Amsterdam": BuiltPayloadAmsterdam,
540-
}
541-
542-
543503
class BlobAndProofV1(Container):
544504
"""A whole blob with a single proof."""
545505

packages/testing/src/execution_testing/ssz/tests/test_engine_containers.py

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,73 @@
66

77
from .. import decode_bytes, encode_bytes, envelope_bytes
88
from ..containers import (
9-
BUILT_PAYLOAD_BY_FORK,
10-
EXECUTION_PAYLOAD_BODY_BY_FORK,
11-
FORKCHOICE_UPDATE_BY_FORK,
12-
PAYLOAD_ATTRIBUTES_BY_FORK,
9+
BuiltPayloadAmsterdam,
10+
BuiltPayloadCancun,
11+
BuiltPayloadOsaka,
12+
BuiltPayloadParis,
13+
BuiltPayloadPrague,
14+
BuiltPayloadShanghai,
15+
ExecutionPayloadBodyAmsterdam,
16+
ExecutionPayloadBodyCancun,
17+
ExecutionPayloadBodyOsaka,
18+
ExecutionPayloadBodyParis,
19+
ExecutionPayloadBodyPrague,
20+
ExecutionPayloadBodyShanghai,
1321
ExecutionPayloadEnvelopeAmsterdam,
1422
ExecutionPayloadEnvelopeParis,
23+
ForkchoiceUpdateAmsterdam,
24+
ForkchoiceUpdateCancun,
25+
ForkchoiceUpdateOsaka,
26+
ForkchoiceUpdateParis,
27+
ForkchoiceUpdatePrague,
28+
ForkchoiceUpdateShanghai,
29+
PayloadAttributesAmsterdam,
30+
PayloadAttributesCancun,
31+
PayloadAttributesOsaka,
32+
PayloadAttributesParis,
33+
PayloadAttributesPrague,
34+
PayloadAttributesShanghai,
1535
PayloadStatus,
1636
)
1737

1838
_FORKS = ["Paris", "Shanghai", "Cancun", "Prague", "Osaka", "Amsterdam"]
1939

40+
PAYLOAD_ATTRIBUTES_BY_FORK = {
41+
"Paris": PayloadAttributesParis,
42+
"Shanghai": PayloadAttributesShanghai,
43+
"Cancun": PayloadAttributesCancun,
44+
"Prague": PayloadAttributesPrague,
45+
"Osaka": PayloadAttributesOsaka,
46+
"Amsterdam": PayloadAttributesAmsterdam,
47+
}
48+
49+
FORKCHOICE_UPDATE_BY_FORK = {
50+
"Paris": ForkchoiceUpdateParis,
51+
"Shanghai": ForkchoiceUpdateShanghai,
52+
"Cancun": ForkchoiceUpdateCancun,
53+
"Prague": ForkchoiceUpdatePrague,
54+
"Osaka": ForkchoiceUpdateOsaka,
55+
"Amsterdam": ForkchoiceUpdateAmsterdam,
56+
}
57+
58+
EXECUTION_PAYLOAD_BODY_BY_FORK = {
59+
"Paris": ExecutionPayloadBodyParis,
60+
"Shanghai": ExecutionPayloadBodyShanghai,
61+
"Cancun": ExecutionPayloadBodyCancun,
62+
"Prague": ExecutionPayloadBodyPrague,
63+
"Osaka": ExecutionPayloadBodyOsaka,
64+
"Amsterdam": ExecutionPayloadBodyAmsterdam,
65+
}
66+
67+
BUILT_PAYLOAD_BY_FORK = {
68+
"Paris": BuiltPayloadParis,
69+
"Shanghai": BuiltPayloadShanghai,
70+
"Cancun": BuiltPayloadCancun,
71+
"Prague": BuiltPayloadPrague,
72+
"Osaka": BuiltPayloadOsaka,
73+
"Amsterdam": BuiltPayloadAmsterdam,
74+
}
75+
2076

2177
def test_new_registries_cover_forks_in_order() -> None:
2278
"""Every new per-fork registry spans Paris..Amsterdam."""

0 commit comments

Comments
 (0)