Skip to content

Whisk (SSLE) with Curdleproofs - rebased #3342

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

Merged
merged 34 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
cc4a19c
Introduce consensus code for Whisk
asn-d6 Jan 12, 2022
a5de25d
polish, simplify, clean up (~100 fewer lines)
JustinDrake Jan 14, 2022
4ef8b62
minor cleanups and fixes
JustinDrake Jan 18, 2022
4d43ea1
simplify is_k_commitment_unique
JustinDrake Jan 18, 2022
b45ea2f
Update beacon-chain.md
JustinDrake Jan 18, 2022
99f8fbd
Update beacon-chain.md
JustinDrake Jan 18, 2022
478a092
Initialize `k` in `get_validator_from_deposit()`
asn-d6 Jan 23, 2022
365d1f2
minor cleanups
JustinDrake Jan 31, 2022
c7666dc
Update beacon-chain.md
JustinDrake Feb 2, 2022
e537141
Create beacon-chain.md
JustinDrake Feb 26, 2022
683686c
A couple of fixes to the no-registration simplification
JustinDrake Mar 1, 2022
271ee32
remove unused helpers
JustinDrake Mar 2, 2022
ab53b9b
use Mary's suggested tracker
JustinDrake Mar 2, 2022
ff37625
Update beacon-chain.md
JustinDrake Mar 4, 2022
3bc83a0
Revert G_t element optimization
asn-d6 Aug 27, 2022
75d5372
Implement new shuffling strategy
asn-d6 Aug 27, 2022
7cbe2b8
Curdleproofs edits
nalinbhardwaj Oct 7, 2022
1a603b1
working whisk eth2spec
nalinbhardwaj Oct 19, 2022
e163e6a
working whisk dummy test
nalinbhardwaj Oct 22, 2022
6a134b9
add more boilerplate set up code
nalinbhardwaj Oct 31, 2022
8ce736c
rebase constants
nalinbhardwaj Jan 12, 2023
34b4ecd
Implement even newer and simplified shuffling strategy
asn-d6 Jan 17, 2023
c304d64
Move to _features
dapplion Apr 29, 2023
e2f6f09
remove dummy test
dapplion Apr 29, 2023
5a3e046
Run doctoc
dapplion Apr 30, 2023
670845b
Change Whisk's previous fork to Capella instead of Bellatrix. Make li…
hwwhww May 1, 2023
d721e3a
Fix lint
dapplion May 5, 2023
7d509c1
Fix pylint
dapplion May 5, 2023
f11e9df
Fix mypy issues
dapplion May 5, 2023
8789a67
Clean-up get_beacon_proposer_index
dapplion May 9, 2023
e9445bb
Fix doc headers
dapplion May 9, 2023
9a412d9
Fix capella link
dapplion May 17, 2023
45fce04
Update apply_deposit
dapplion May 18, 2023
35fe953
Rename process_shuffled_trackers
dapplion May 23, 2023
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 @@ -21,6 +21,7 @@ tests/core/pyspec/eth2spec/bellatrix/
tests/core/pyspec/eth2spec/capella/
tests/core/pyspec/eth2spec/deneb/
tests/core/pyspec/eth2spec/eip6110/
tests/core/pyspec/eth2spec/whisk/

# coverage reports
.htmlcov
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/*/*.md) \
$(wildcard $(SPEC_DIR)/_features/*/*/*.md) \
$(wildcard $(SSZ_DIR)/*.md)

ALL_EXECUTABLE_SPECS = phase0 altair bellatrix capella deneb eip6110
ALL_EXECUTABLE_SPECS = phase0 altair bellatrix capella deneb eip6110 whisk
# The parameters for commands. Use `foreach` to avoid listing specs again.
COVERAGE_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPECS), --cov=eth2spec.$S.$(TEST_PRESET_TYPE))
PYLINT_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPECS), ./eth2spec/$S)
Expand Down
39 changes: 34 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def installPackage(package: str):
CAPELLA = 'capella'
DENEB = 'deneb'
EIP6110 = 'eip6110'
WHISK = 'whisk'


# The helper functions that are used when defining constants
Expand Down Expand Up @@ -681,9 +682,31 @@ def imports(cls, preset_name: str):
'''


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

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

@classmethod
def hardcoded_custom_type_dep_constants(cls, spec_object) -> str:
# Necessary for custom types `WhiskShuffleProof` and `WhiskTrackerProof`
constants = {
'WHISK_MAX_SHUFFLE_PROOF_SIZE': spec_object.constant_vars['WHISK_MAX_SHUFFLE_PROOF_SIZE'].value,
'WHISK_MAX_OPENING_PROOF_SIZE': spec_object.constant_vars['WHISK_MAX_OPENING_PROOF_SIZE'].value,
}
return {**super().hardcoded_custom_type_dep_constants(spec_object), **constants}


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


Expand Down Expand Up @@ -982,14 +1005,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, DENEB, EIP6110):
if self.spec_fork in (PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110, 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, DENEB, EIP6110):
if self.spec_fork in (ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110, WHISK):
self.md_doc_paths += """
specs/altair/light-client/full-node.md
specs/altair/light-client/light-client.md
Expand All @@ -1001,7 +1024,7 @@ def finalize_options(self):
specs/altair/validator.md
specs/altair/p2p-interface.md
"""
if self.spec_fork in (BELLATRIX, CAPELLA, DENEB, EIP6110):
if self.spec_fork in (BELLATRIX, CAPELLA, DENEB, EIP6110, WHISK):
self.md_doc_paths += """
specs/bellatrix/beacon-chain.md
specs/bellatrix/fork.md
Expand All @@ -1010,7 +1033,7 @@ def finalize_options(self):
specs/bellatrix/p2p-interface.md
sync/optimistic.md
"""
if self.spec_fork in (CAPELLA, DENEB, EIP6110):
if self.spec_fork in (CAPELLA, DENEB, EIP6110, WHISK):
self.md_doc_paths += """
specs/capella/light-client/fork.md
specs/capella/light-client/full-node.md
Expand Down Expand Up @@ -1044,6 +1067,11 @@ def finalize_options(self):
specs/_features/eip6110/beacon-chain.md
specs/_features/eip6110/fork.md
"""
if self.spec_fork == WHISK:
self.md_doc_paths += """
specs/_features/whisk/beacon-chain.md
specs/_features/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 @@ -1199,5 +1227,6 @@ def run(self):
"lru-dict==1.1.8",
MARKO_VERSION,
"py_arkworks_bls12381==0.3.4",
"curdleproofs @ git+https://github.com/nalinbhardwaj/curdleproofs.pie@master#egg=curdleproofs&subdirectory=curdleproofs",
]
)
Loading