forked from ethereum/consensus-specs
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix epbs consensus spec to be executable
- Loading branch information
1 parent
652060b
commit e0a555e
Showing
9 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Mainnet preset - epbs | ||
|
||
# Execution | ||
# --------------------------------------------------------------- | ||
# 2**9 (= 512) | ||
PTC_SIZE: 512 | ||
# 2**2 (= 4) | ||
MAX_PAYLOAD_ATTESTATIONS: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Minimal preset - epbs | ||
|
||
# Execution | ||
# --------------------------------------------------------------- | ||
# 2**1(= 2) | ||
PTC_SIZE: 2 | ||
# 2**2 (= 4) | ||
MAX_PAYLOAD_ATTESTATIONS: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 EPBS | ||
|
||
|
||
class EPBSSpecBuilder(BaseSpecBuilder): | ||
fork: str = EPBS | ||
|
||
@classmethod | ||
def imports(cls, preset_name: str): | ||
return f''' | ||
from eth2spec.epbs import {preset_name} as epbs | ||
''' | ||
|
||
@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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import mainnet as spec # noqa:F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters