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

Add EIP-7251 spec: Increase MAX_EFFECTIVE_BALANCE #3618

Merged
merged 32 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
668e447
Add EIP-7251 spec
dapplion Mar 8, 2024
c5af391
Add validator doc
dapplion Mar 8, 2024
fc65a6f
Fix CI
dapplion Mar 12, 2024
cf70df2
Address Comments and Cleanup Spec
ethDreamer Mar 19, 2024
f6359f9
Fix Bug in process_pending_balance_deposits
ethDreamer Mar 19, 2024
7c9fc19
Merge pull request #4 from ethDreamer/eip-7251
dapplion Mar 20, 2024
fe35d66
Remove built spec
mkalinin Mar 20, 2024
98f38c7
Introduce MAX_PARTIAL_WITHDRAWALS_PER_PAYLOAD
mkalinin Mar 20, 2024
cdbc2b7
Fix linter
mkalinin Mar 20, 2024
6d140cd
Fix MAX_PARTIAL_WITHDRAWALS_PER_PAYLOAD in mainnet.yaml
mkalinin Mar 20, 2024
b02c3e5
Check MAX_PARTIAL_WITHDRAWALS_PER_PAYLOAD < MAX_WITHDRAWALS_PER_PAYLOAD
mkalinin Mar 20, 2024
be79aab
Fix toc
mkalinin Mar 20, 2024
a127bbf
Merge branch 'dev' into eip-7251
mkalinin Mar 20, 2024
17d65ca
Create eip7251 config invariants test
mkalinin Mar 20, 2024
d48b5e0
Update whistleblower reward for eip7251
mkalinin Mar 20, 2024
8873d02
Fix linter
mkalinin Mar 20, 2024
45f98d6
Set MIN_SLASHING_PENALTY_QUOTIENT_EIP7251=4096
mkalinin Mar 21, 2024
ebdb513
queue_excess_active_balance
dapplion Mar 22, 2024
6d9ebe1
set_compounding_withdrawal_credentials
dapplion Mar 22, 2024
84a5ae9
rename to partial_withdrawals_count
dapplion Mar 22, 2024
72c4f04
@ensi321 review
dapplion Mar 22, 2024
08732e6
fix typo
dapplion Mar 22, 2024
4e7c82c
Remove is_aggregator changes
dapplion Mar 22, 2024
8d7d7a8
add tests
fradamt Mar 25, 2024
97966d8
small fixes
fradamt Mar 25, 2024
4775641
fix broken pending deposits tests and typo
fradamt Mar 25, 2024
83e617a
Merge pull request #5 from fradamt/eip-7251
dapplion Mar 26, 2024
23ad85e
Allow to switch to compounding validator on deposit
dapplion Mar 26, 2024
e6aaa9d
Fix lint
dapplion Mar 26, 2024
06104f2
Fix is_partially_withdrawable_validator
mkalinin Mar 26, 2024
5e32d44
Fix the sweep by enabling 0x02 creds
mkalinin Mar 27, 2024
73ede3a
Fix pending_balance_to_withdraw == 0 check when full exit
mkalinin Mar 27, 2024
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 @@ -25,6 +25,7 @@ tests/core/pyspec/eth2spec/eip6110/
tests/core/pyspec/eth2spec/eip7002/
tests/core/pyspec/eth2spec/eip7549/
tests/core/pyspec/eth2spec/whisk/
tests/core/pyspec/eth2spec/eip7251/
tests/core/pyspec/eth2spec/eip7594/

# coverage reports
Expand Down
8 changes: 8 additions & 0 deletions configs/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ EIP6110_FORK_EPOCH: 18446744073709551615
# EIP7002
EIP7002_FORK_VERSION: 0x05000000 # temporary stub
EIP7002_FORK_EPOCH: 18446744073709551615
# EIP7251
EIP7251_FORK_VERSION: 0x06000000 # temporary stub
EIP7251_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x06000000 # temporary stub
WHISK_FORK_EPOCH: 18446744073709551615
Expand Down Expand Up @@ -158,3 +161,8 @@ WHISK_PROPOSER_SELECTION_GAP: 2
# EIP7594
EIP7594_FORK_VERSION: 0x06000001
EIP7594_FORK_EPOCH: 18446744073709551615

# [New in EIP7251]
MIN_PER_EPOCH_CHURN_LIMIT_EIP7251: 128000000000 # 2**7 * 10**9 (= 128,000,000,000)
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000 # 2**8 * 10**9 (= 256,000,000,000)

7 changes: 7 additions & 0 deletions configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ EIP6110_FORK_EPOCH: 18446744073709551615
# EIP7002
EIP7002_FORK_VERSION: 0x05000001
EIP7002_FORK_EPOCH: 18446744073709551615
# EIP7251
EIP7251_FORK_VERSION: 0x06000000 # temporary stub
EIP7251_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x06000001
WHISK_FORK_EPOCH: 18446744073709551615
Expand Down Expand Up @@ -157,3 +160,7 @@ WHISK_PROPOSER_SELECTION_GAP: 1
# EIP7594
EIP7594_FORK_VERSION: 0x06000001
EIP7594_FORK_EPOCH: 18446744073709551615

# [New in EIP7251]
MIN_PER_EPOCH_CHURN_LIMIT_EIP7251: 64000000000 # 2**6 * 10**9 (= 64,000,000,000)
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 128000000000 # 2**7 * 10**9 (= 128,000,000,000)
28 changes: 28 additions & 0 deletions presets/mainnet/eip7251.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Mainnet preset - EIP7251

# Gwei values
# ---------------------------------------------------------------
# 2**5 * 10**9 (= 32,000,000,000) Gwei
MIN_ACTIVATION_BALANCE: 32000000000
# 2**11 * 10**9 (= 2,048,000,000,000) Gwei
MAX_EFFECTIVE_BALANCE_EIP7251: 2048000000000

# State list lengths
# ---------------------------------------------------------------
PENDING_BALANCE_DEPOSITS_LIMIT: 134217728
PENDING_PARTIAL_WITHDRAWALS_LIMIT: 134217728
PENDING_CONSOLIDATIONS_LIMIT: 262144

# Reward and penalty quotients
# ---------------------------------------------------------------
MIN_SLASHING_PENALTY_QUOTIENT_EIP7251: 4096
WHISTLEBLOWER_REWARD_QUOTIENT_EIP7251: 4096

# Max operations per block
# ---------------------------------------------------------------
MAX_CONSOLIDATIONS: 1

# Execution
# ---------------------------------------------------------------
# 2**3 (= 8) partial withdrawals
MAX_PARTIAL_WITHDRAWALS_PER_PAYLOAD: 8
30 changes: 30 additions & 0 deletions presets/minimal/eip7251.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Minimal preset - EIP7251

# Gwei values
# ---------------------------------------------------------------
# 2**5 * 10**9 (= 32,000,000,000) Gwei
MIN_ACTIVATION_BALANCE: 32000000000
# 2**11 * 10**9 (= 2,048,000,000,000) Gwei
MAX_EFFECTIVE_BALANCE_EIP7251: 2048000000000

# State list lengths
# ---------------------------------------------------------------
PENDING_BALANCE_DEPOSITS_LIMIT: 134217728
# [customized] smaller queue
PENDING_PARTIAL_WITHDRAWALS_LIMIT: 64
# [customized] smaller queue
PENDING_CONSOLIDATIONS_LIMIT: 64

# Reward and penalty quotients
# ---------------------------------------------------------------
MIN_SLASHING_PENALTY_QUOTIENT_EIP7251: 4096
WHISTLEBLOWER_REWARD_QUOTIENT_EIP7251: 4096

# Max operations per block
# ---------------------------------------------------------------
MAX_CONSOLIDATIONS: 1

# Execution
# ---------------------------------------------------------------
# [customized] 2**1 (= 2)
MAX_PARTIAL_WITHDRAWALS_PER_PAYLOAD: 2
1 change: 1 addition & 0 deletions pysetup/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
DENEB = 'deneb'
EIP6110 = 'eip6110'
EIP7002 = 'eip7002'
EIP7251 = 'eip7251'
EIP7549 = 'eip7549'
WHISK = 'whisk'
EIP7594 = 'eip7594'
Expand Down
2 changes: 2 additions & 0 deletions pysetup/md_doc_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
DENEB,
EIP6110,
EIP7002,
EIP7251,
EIP7549,
WHISK,
EIP7594,
Expand All @@ -24,6 +25,7 @@
EIP7549: DENEB,
WHISK: CAPELLA,
EIP7002: CAPELLA,
EIP7251: DENEB,
EIP7594: DENEB,
}

Expand Down
4 changes: 3 additions & 1 deletion pysetup/spec_builders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
from .eip7002 import EIP7002SpecBuilder
from .eip7549 import EIP7549SpecBuilder
from .whisk import WhiskSpecBuilder
from .eip7251 import EIP7251SpecBuilder
from .eip7594 import EIP7594SpecBuilder


spec_builders = {
builder.fork: builder
for builder in (
Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, DenebSpecBuilder,
EIP6110SpecBuilder, EIP7002SpecBuilder, EIP7549SpecBuilder, WhiskSpecBuilder, EIP7594SpecBuilder,
EIP6110SpecBuilder, EIP7002SpecBuilder, EIP7549SpecBuilder, WhiskSpecBuilder, EIP7251SpecBuilder,
EIP7594SpecBuilder,
)
}
24 changes: 24 additions & 0 deletions pysetup/spec_builders/eip7251.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from typing import Dict

from .base import BaseSpecBuilder
from ..constants import EIP7251


class EIP7251SpecBuilder(BaseSpecBuilder):
fork: str = EIP7251

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

## TODO: deal with changed gindices

@classmethod
def hardcoded_ssz_dep_constants(cls) -> Dict[str, str]:
return {
'FINALIZED_ROOT_GINDEX': 'GeneralizedIndex(169)',
'CURRENT_SYNC_COMMITTEE_GINDEX': 'GeneralizedIndex(86)',
'NEXT_SYNC_COMMITTEE_GINDEX': 'GeneralizedIndex(87)',
}
Loading
Loading