Skip to content
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

In-protocol deposits flow (no queue approach) #3177

Merged
merged 26 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c53ab45
Add in-protocol deposit processing
mkalinin Nov 24, 2022
b3c771c
Preserve deposits per epoch boundary
mkalinin Dec 7, 2022
5ea983a
Fix toc, add more comments
mkalinin Dec 7, 2022
8cc293c
Fix wording
mkalinin Dec 7, 2022
9d2a8f7
Give deposits EIP a name
mkalinin Dec 19, 2022
48f120c
Set a higher limit to deposit receipts list
mkalinin Dec 21, 2022
6eb118d
Fix finality check in deposit processing
mkalinin Dec 22, 2022
e64607f
Merge branch 'dev' into deposits
mkalinin Feb 21, 2023
d5c7474
Move EIP6110 to features
mkalinin Feb 21, 2023
08c7287
Get rid of pending_deposits queue
mkalinin Feb 22, 2023
23c10cf
Remove state.deposit_receipt_next_index variable
mkalinin Feb 23, 2023
b22c892
Cosmetic renaming
mkalinin Feb 23, 2023
a1daac0
Make EIP-6110 executable and fix linter errors
hwwhww Feb 23, 2023
7d6831e
Fix initialize_beacon_state_from_eth1 definition
mkalinin Feb 23, 2023
703fdfc
Fix linter
mkalinin Feb 23, 2023
fda0eae
Add EIP6110 to pylint and mypy scope
hwwhww Feb 23, 2023
9d690a4
Fix typo
hwwhww Feb 24, 2023
de5be63
Apply suggestions from code review
mkalinin Feb 28, 2023
fae77eb
Apply @hwwhww suggestions
mkalinin Feb 28, 2023
7bb65f8
Cosmetic fix
mkalinin Feb 28, 2023
4a59bcf
Merge branch 'dev' into deposits
hwwhww Feb 28, 2023
c445fa9
Apply suggestions from code review
mkalinin Mar 2, 2023
13f3654
Apply suggestions from @djrtwo
mkalinin Mar 2, 2023
00557c5
Remove unnecessary eth1_deposit_index bump
mkalinin Mar 2, 2023
0da79bd
Provide validator guide for EIP6110
mkalinin Mar 9, 2023
0ae18d8
Update specs/_features/eip6110/validator.md
djrtwo Mar 14, 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 @@ -20,6 +20,7 @@ tests/core/pyspec/eth2spec/altair/
tests/core/pyspec/eth2spec/bellatrix/
tests/core/pyspec/eth2spec/capella/
tests/core/pyspec/eth2spec/deneb/
tests/core/pyspec/eth2spec/eip6110/

# coverage reports
.htmlcov
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ codespell:
lint: pyspec
. venv/bin/activate; cd $(PY_SPEC_DIR); \
flake8 --config $(LINTER_CONFIG_FILE) ./eth2spec \
&& pylint --rcfile $(LINTER_CONFIG_FILE) ./eth2spec/phase0 ./eth2spec/altair ./eth2spec/bellatrix ./eth2spec/capella ./eth2spec/deneb \
&& mypy --config-file $(LINTER_CONFIG_FILE) -p eth2spec.phase0 -p eth2spec.altair -p eth2spec.bellatrix -p eth2spec.capella -p eth2spec.deneb
&& pylint --rcfile $(LINTER_CONFIG_FILE) ./eth2spec/phase0 ./eth2spec/altair ./eth2spec/bellatrix ./eth2spec/capella ./eth2spec/deneb ./eth2spec/eip6110 \
&& mypy --config-file $(LINTER_CONFIG_FILE) -p eth2spec.phase0 -p eth2spec.altair -p eth2spec.bellatrix -p eth2spec.capella -p eth2spec.deneb -p eth2spec.eip6110

lint_generators: pyspec
. venv/bin/activate; cd $(TEST_GENERATORS_DIR); \
Expand Down
29 changes: 24 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'
DENEB = 'deneb'
EIP6110 = 'eip6110'


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


#
# EIP6110SpecBuilder
#
class EIP6110SpecBuilder(CapellaSpecBuilder):
fork: str = EIP6110

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


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


Expand Down Expand Up @@ -968,14 +982,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):
if self.spec_fork in (PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110):
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):
if self.spec_fork in (ALTAIR, BELLATRIX, CAPELLA, DENEB, EIP6110):
self.md_doc_paths += """
specs/altair/light-client/full-node.md
specs/altair/light-client/light-client.md
Expand All @@ -987,7 +1001,7 @@ def finalize_options(self):
specs/altair/validator.md
specs/altair/p2p-interface.md
"""
if self.spec_fork in (BELLATRIX, CAPELLA, DENEB):
if self.spec_fork in (BELLATRIX, CAPELLA, DENEB, EIP6110):
self.md_doc_paths += """
specs/bellatrix/beacon-chain.md
specs/bellatrix/fork.md
Expand All @@ -996,7 +1010,7 @@ def finalize_options(self):
specs/bellatrix/p2p-interface.md
sync/optimistic.md
"""
if self.spec_fork in (CAPELLA, DENEB):
if self.spec_fork in (CAPELLA, DENEB, EIP6110):
self.md_doc_paths += """
specs/capella/light-client/fork.md
specs/capella/light-client/full-node.md
Expand All @@ -1021,6 +1035,11 @@ def finalize_options(self):
specs/deneb/p2p-interface.md
specs/deneb/validator.md
"""
if self.spec_fork == EIP6110:
self.md_doc_paths += """
specs/_features/eip6110/beacon-chain.md
specs/_features/eip6110/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
Loading