Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ tests/core/pyspec/eth2spec/altair/
tests/core/pyspec/eth2spec/bellatrix/
tests/core/pyspec/eth2spec/capella/
tests/core/pyspec/eth2spec/eip4844/
tests/core/pyspec/eth2spec/whisk/

# coverage reports
.htmlcov
Expand Down
19 changes: 7 additions & 12 deletions configs/mainnet.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Mainnet config

# Extends the mainnet preset
PRESET_BASE: 'mainnet'
PRESET_BASE: "mainnet"

# Free-form short name of the network that this configuration applies to - known
# canonical network names include:
# * 'mainnet' - there can be only one
# * 'prater' - testnet
# Must match the regex: [a-z0-9\-]
CONFIG_NAME: 'mainnet'
CONFIG_NAME: "mainnet"

# Transition
# ---------------------------------------------------------------
Expand All @@ -18,8 +18,6 @@ TERMINAL_TOTAL_DIFFICULTY: 58750000000000000000000
TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615



# Genesis
# ---------------------------------------------------------------
# `2**14` (= 16,384)
Expand All @@ -31,7 +29,6 @@ GENESIS_FORK_VERSION: 0x00000000
# 604800 seconds (7 days)
GENESIS_DELAY: 604800


# Forking
# ---------------------------------------------------------------
# Some forks are disabled for now:
Expand All @@ -40,19 +37,19 @@ GENESIS_DELAY: 604800

# Altair
ALTAIR_FORK_VERSION: 0x01000000
ALTAIR_FORK_EPOCH: 74240 # Oct 27, 2021, 10:56:23am UTC
ALTAIR_FORK_EPOCH: 74240 # Oct 27, 2021, 10:56:23am UTC
# Bellatrix
BELLATRIX_FORK_VERSION: 0x02000000
BELLATRIX_FORK_EPOCH: 144896 # Sept 6, 2022, 11:34:47am UTC
BELLATRIX_FORK_EPOCH: 144896 # Sept 6, 2022, 11:34:47am UTC
# Capella
CAPELLA_FORK_VERSION: 0x03000000
CAPELLA_FORK_EPOCH: 18446744073709551615
# EIP4844
EIP4844_FORK_VERSION: 0x04000000
EIP4844_FORK_EPOCH: 18446744073709551615



# Whisk
WHISK_FORK_VERSION: 0x05000000
WHISK_FORK_EPOCH: 18446744073709551615

# Time parameters
# ---------------------------------------------------------------
Expand All @@ -67,7 +64,6 @@ SHARD_COMMITTEE_PERIOD: 256
# 2**11 (= 2,048) Eth1 blocks ~8 hours
ETH1_FOLLOW_DISTANCE: 2048


# Validator cycle
# ---------------------------------------------------------------
# 2**2 (= 4)
Expand All @@ -81,7 +77,6 @@ MIN_PER_EPOCH_CHURN_LIMIT: 4
# 2**16 (= 65,536)
CHURN_LIMIT_QUOTIENT: 65536


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary polluting diff styling configs/mainnet.yaml and configs/minimal.yaml, should be reverted for a cleaner PR.

# Fork choice
# ---------------------------------------------------------------
# 40%
Expand Down
14 changes: 5 additions & 9 deletions configs/minimal.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Minimal config

# Extends the minimal preset
PRESET_BASE: 'minimal'
PRESET_BASE: "minimal"

# Free-form short name of the network that this configuration applies to - known
# canonical network names include:
# * 'mainnet' - there can be only one
# * 'prater' - testnet
# Must match the regex: [a-z0-9\-]
CONFIG_NAME: 'minimal'
CONFIG_NAME: "minimal"

# Transition
# ---------------------------------------------------------------
Expand All @@ -18,8 +18,6 @@ TERMINAL_TOTAL_DIFFICULTY: 11579208923731619542357098500868790785326998466564056
TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615



# Genesis
# ---------------------------------------------------------------
# [customized]
Expand All @@ -31,7 +29,6 @@ GENESIS_FORK_VERSION: 0x00000001
# [customized] Faster to spin up testnets, but does not give validator reasonable warning time for genesis
GENESIS_DELAY: 300


# Forking
# ---------------------------------------------------------------
# Values provided for illustrative purposes.
Expand All @@ -49,7 +46,9 @@ CAPELLA_FORK_EPOCH: 18446744073709551615
# EIP4844
EIP4844_FORK_VERSION: 0x04000001
EIP4844_FORK_EPOCH: 18446744073709551615

# Whisk
WHISK_FORK_VERSION: 0x05000001
WHISK_FORK_EPOCH: 18446744073709551615

# Time parameters
# ---------------------------------------------------------------
Expand All @@ -64,7 +63,6 @@ SHARD_COMMITTEE_PERIOD: 64
# [customized] process deposits more quickly, but insecure
ETH1_FOLLOW_DISTANCE: 16


# Validator cycle
# ---------------------------------------------------------------
# 2**2 (= 4)
Expand All @@ -78,13 +76,11 @@ MIN_PER_EPOCH_CHURN_LIMIT: 4
# [customized] scale queue churn at much lower validator counts for testing
CHURN_LIMIT_QUOTIENT: 32


# Fork choice
# ---------------------------------------------------------------
# 40%
PROPOSER_SCORE_BOOST: 40


# Deposit contract
# ---------------------------------------------------------------
# Ethereum Goerli testnet
Expand Down
34 changes: 29 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def installPackage(package: str):
BELLATRIX = 'bellatrix'
CAPELLA = 'capella'
EIP4844 = 'eip4844'
WHISK = 'whisk'


# The helper functions that are used when defining constants
Expand Down Expand Up @@ -652,9 +653,26 @@ def hardcoded_custom_type_dep_constants(cls, spec_object) -> str:
return {**super().hardcoded_custom_type_dep_constants(spec_object), **constants}


#
# WhiskSpecBuilder
#
class WhiskSpecBuilder(BellatrixSpecBuilder):
fork: str = WHISK

@classmethod
def imports(cls, preset_name: str):
return super().imports(preset_name) + f'''
from curdleproofs import IsValidWhiskShuffleProof, IsValidWhiskOpeningProof
from eth2spec.bellatrix import {preset_name} as bellatrix
'''

@classmethod
def sundry_functions(cls) -> str:
return super().sundry_functions()

spec_builders = {
builder.fork: builder
for builder in (Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, EIP4844SpecBuilder)
for builder in (Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, EIP4844SpecBuilder, WhiskSpecBuilder)
}


Expand Down Expand Up @@ -785,7 +803,7 @@ def combine_dicts(old_dict: Dict[str, T], new_dict: Dict[str, T]) -> Dict[str, T
'uint8', 'uint16', 'uint32', 'uint64', 'uint128', 'uint256',
'bytes', 'byte', 'ByteList', 'ByteVector',
'Dict', 'dict', 'field', 'ceillog2', 'floorlog2', 'Set',
'Optional', 'Sequence',
'Optional', 'Sequence'
]


Expand Down Expand Up @@ -952,14 +970,14 @@ def finalize_options(self):
if len(self.md_doc_paths) == 0:
print("no paths were specified, using default markdown file paths for pyspec"
" build (spec fork: %s)" % self.spec_fork)
if self.spec_fork in (PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844):
if self.spec_fork in (PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844, WHISK):
self.md_doc_paths = """
specs/phase0/beacon-chain.md
specs/phase0/fork-choice.md
specs/phase0/validator.md
specs/phase0/weak-subjectivity.md
"""
if self.spec_fork in (ALTAIR, BELLATRIX, CAPELLA, EIP4844):
if self.spec_fork in (ALTAIR, BELLATRIX, CAPELLA, EIP4844, WHISK):
self.md_doc_paths += """
specs/altair/light-client/full-node.md
specs/altair/light-client/light-client.md
Expand All @@ -971,7 +989,7 @@ def finalize_options(self):
specs/altair/validator.md
specs/altair/p2p-interface.md
"""
if self.spec_fork in (BELLATRIX, CAPELLA, EIP4844):
if self.spec_fork in (BELLATRIX, CAPELLA, EIP4844, WHISK):
self.md_doc_paths += """
specs/bellatrix/beacon-chain.md
specs/bellatrix/fork.md
Expand All @@ -997,6 +1015,11 @@ def finalize_options(self):
specs/eip4844/p2p-interface.md
specs/eip4844/validator.md
"""
if self.spec_fork == WHISK:
self.md_doc_paths += """
specs/whisk/beacon-chain.md
specs/whisk/fork.md
"""
if len(self.md_doc_paths) == 0:
raise Exception('no markdown files specified, and spec fork "%s" is unknown', self.spec_fork)

Expand Down Expand Up @@ -1150,5 +1173,6 @@ def run(self):
RUAMEL_YAML_VERSION,
"lru-dict==1.1.8",
MARKO_VERSION,
"curdleproofs @ git+https://github.com/nalinbhardwaj/curdleproofs.pie@master#egg=curdleproofs&subdirectory=curdleproofs",
]
)
Loading