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

release v1.4.0-beta.2 #3504

Merged
merged 63 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
69d8c96
Apply proposer boost to first block in case of equivocation
michaelsproul May 11, 2023
2210cea
Add deneb fc tests and update test format
hwwhww Jun 1, 2023
d2d351f
Add `test_invalid_data_unavailable`
hwwhww Jul 25, 2023
e79caff
Clean up `is_data_available`. Remove the stub `retrieve_blobs_and_pro…
hwwhww Jul 25, 2023
85b0ae8
handle `len(blobs) == 0` case
hwwhww Jul 27, 2023
6e4d489
🐛 set chaos to `True` to enable uint variation for non random tests
wenceslas-sanchez Jul 27, 2023
32056b2
PR feedback from @djrtwo
hwwhww Jul 31, 2023
39134d5
Change it back to allow empty `blobs` list file
hwwhww Jul 31, 2023
b412bdb
✨ allow `container_case_fn` to change chaos mode
wenceslas-sanchez Aug 1, 2023
bd34c65
🐛 remove redundant modes for container without offsets
wenceslas-sanchez Aug 1, 2023
872e404
⏪️ reset ``chaos`` to False
wenceslas-sanchez Aug 1, 2023
01dfc77
🐛 remove non-random mode from variation
wenceslas-sanchez Aug 1, 2023
6231dc2
🐛 split variation with and without chaos
wenceslas-sanchez Aug 1, 2023
da21210
♻️ refactor + linter comments
wenceslas-sanchez Aug 1, 2023
7ba238a
fix test format descrition
potuz Aug 2, 2023
b309903
Danny's fix
potuz Aug 2, 2023
fb6297b
Merge pull request #3471 from potuz/fix_kzg_format_desc
hwwhww Aug 3, 2023
56d6d1a
Merge pull request #3463 from ethereum/deneb-fc-tests-take-2
hwwhww Aug 3, 2023
36d9ea6
Fix dimension of nodeId and remove outdated comment (#3445)
zilm13 Aug 3, 2023
5612e7a
♻️ refactor
wenceslas-sanchez Aug 3, 2023
522ab42
Update tests/generators/ssz_generic/ssz_container.py
wenceslas-sanchez Aug 3, 2023
8d6a405
Merge pull request #3468 from wenceslas-sanchez/dev
hwwhww Aug 4, 2023
63c39db
Merge branch 'dev' into pr3352
hwwhww Aug 4, 2023
1904b47
Add `test_proposer_boost_is_first_block` test case
hwwhww Aug 4, 2023
fa1015c
Update Capella FC too
hwwhww Aug 4, 2023
875fabc
🐛 remove lambda definition from `generate_from_tests`
wenceslas-sanchez Aug 6, 2023
6f57e2b
"can slashable" => "can be slashable"
zhiqiangxu Aug 9, 2023
8a64a90
Merge pull request #3476 from zhiqiangxu/fix_wording_about_slashing
hwwhww Aug 9, 2023
ef434e8
Merge pull request #3473 from wenceslas-sanchez/multiprocessing-side-…
hwwhww Aug 15, 2023
0b751fc
Whisk move non-preset values to config (#3482)
dapplion Aug 20, 2023
eef6144
Whisk: don't mutate candidates during cooldown (#3483)
dapplion Aug 20, 2023
fc03e8f
Rename BLS/KZG suite name
hwwhww Aug 20, 2023
6a944a6
Update preset and config files
dapplion Aug 21, 2023
e3a939e
Merge pull request #3485 from dapplion/whisk-config-move
hwwhww Aug 22, 2023
59680c0
remove: old warnings
terencechain Sep 5, 2023
3eaa184
Pin `curdleproofs==0.1.1`
hwwhww Sep 6, 2023
25c8aba
Merge pull request #3495 from ethereum/curdleproofs
hwwhww Sep 6, 2023
06851de
Merge branch 'dev' into pr3494
hwwhww Sep 6, 2023
7a53194
Merge pull request #3494 from terencechain/rm-old-warnings
hwwhww Sep 8, 2023
c5c7233
Merge pull request #3352 from michaelsproul/boost-first-block
hwwhww Sep 12, 2023
e6f7c99
Add limit inbound churn
dapplion Sep 12, 2023
fd37ffc
Add _features/eip7668 and make linter happy
hwwhww Sep 12, 2023
cc3ced5
Enable eip7668 pytest
hwwhww Sep 12, 2023
298a630
review PR
dapplion Sep 13, 2023
417b95c
Add basic activation churn limit tests
hwwhww Sep 13, 2023
8878a31
Fix test_process_voluntary_exit.py
hwwhww Sep 13, 2023
28286e7
Fix tests
hwwhww Sep 14, 2023
19bf51d
Rename eip7668 to eip7514
dapplion Sep 14, 2023
a56c4d0
add extension
dapplion Sep 14, 2023
f165d39
Update mainnet.yaml
dapplion Sep 14, 2023
0efd778
Update beacon_chain.md
dapplion Sep 14, 2023
909388b
fix(sepcs/p2p): link to libp2p Yamux specification
mxinden Sep 4, 2023
e5e50e3
Add EIP-7514 into Deneb
hwwhww Sep 15, 2023
468ae9a
Update the link of `EIP-7044`
hwwhww Sep 15, 2023
96d8c05
Merge pull request #3503 from ethereum/fix-link
hwwhww Sep 15, 2023
d26dac9
Merge pull request #3493 from mxinden/patch-1
hwwhww Sep 15, 2023
26d3fa3
Apply suggestions from code review
hwwhww Sep 15, 2023
e804174
Apply PR feedback. Rename `inbound_limit` to `activation_limit`
hwwhww Sep 15, 2023
a0a512d
Merge pull request #3484 from ethereum/rename-small-suite
hwwhww Sep 16, 2023
206c328
bump version.txt to 1.4.0-beta.2
hwwhww Sep 18, 2023
264dfad
Merge branch 'dev' into pr3499
hwwhww Sep 18, 2023
c88cf05
Merge pull request #3499 from dapplion/limit-churn-inbound
hwwhww Sep 18, 2023
ce240ca
Merge pull request #3505 from ethereum/bump-version
hwwhww Sep 18, 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
9 changes: 8 additions & 1 deletion configs/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ EJECTION_BALANCE: 16000000000
MIN_PER_EPOCH_CHURN_LIMIT: 4
# 2**16 (= 65,536)
CHURN_LIMIT_QUOTIENT: 65536

# [New in Deneb:EIP7514] 2**3 (= 8)
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8

# Fork choice
# ---------------------------------------------------------------
Expand Down Expand Up @@ -140,3 +141,9 @@ MAX_REQUEST_BLOB_SIDECARS: 768
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
# `6`
BLOB_SIDECAR_SUBNET_COUNT: 6

# Whisk
# `Epoch(2**8)`
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 256
# `Epoch(2)`
WHISK_PROPOSER_SELECTION_GAP: 2
10 changes: 8 additions & 2 deletions configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ INACTIVITY_SCORE_BIAS: 4
INACTIVITY_SCORE_RECOVERY_RATE: 16
# 2**4 * 10**9 (= 16,000,000,000) Gwei
EJECTION_BALANCE: 16000000000
# 2**2 (= 4)
MIN_PER_EPOCH_CHURN_LIMIT: 4
# [customized] more easily demonstrate the difference between this value and the activation churn limit
MIN_PER_EPOCH_CHURN_LIMIT: 2
# [customized] scale queue churn at much lower validator counts for testing
CHURN_LIMIT_QUOTIENT: 32
# [New in Deneb:EIP7514] [customized]
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 4


# Fork choice
Expand Down Expand Up @@ -141,3 +143,7 @@ MAX_REQUEST_BLOB_SIDECARS: 768
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
# `6`
BLOB_SIDECAR_SUBNET_COUNT: 6

# Whisk
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 4
WHISK_PROPOSER_SELECTION_GAP: 1
4 changes: 0 additions & 4 deletions presets/mainnet/whisk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ CURDLEPROOFS_N_BLINDERS: 4
WHISK_CANDIDATE_TRACKERS_COUNT: 16384
# `uint64(2**13)` must be < WHISK_CANDIDATE_TRACKERS_COUNT
WHISK_PROPOSER_TRACKERS_COUNT: 8192
# `Epoch(2**8)`
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 256
# `uint64(2**7 - CURDLEPROOFS_N_BLINDERS)`
WHISK_VALIDATORS_PER_SHUFFLE: 124
# `Epoch(2)`
WHISK_PROPOSER_SELECTION_GAP: 2
# `uint64(2**15)` TODO: will be replaced by a fix format once there's a serialized format
WHISK_MAX_SHUFFLE_PROOF_SIZE: 32768
# `uint64(2**10)` TODO: will be replaced by a fix format once there's a serialized format
Expand Down
4 changes: 0 additions & 4 deletions presets/minimal/whisk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ WHISK_CANDIDATE_TRACKERS_COUNT: 32
# [customized]
WHISK_PROPOSER_TRACKERS_COUNT: 16
# [customized]
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 4
# [customized]
WHISK_VALIDATORS_PER_SHUFFLE: 4
# [customized]
WHISK_PROPOSER_SELECTION_GAP: 1
# `uint64(2**15)` TODO: will be replaced by a fix format once there's a serialized format
WHISK_MAX_SHUFFLE_PROOF_SIZE: 32768
# `uint64(2**10)` TODO: will be replaced by a fix format once there's a serialized format
Expand Down
4 changes: 2 additions & 2 deletions pysetup/spec_builders/deneb.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ def preparations(cls):
@classmethod
def sundry_functions(cls) -> str:
return '''
def retrieve_blobs_and_proofs(beacon_block_root: Root) -> PyUnion[Tuple[Blob, KZGProof], Tuple[str, str]]:
def retrieve_blobs_and_proofs(beacon_block_root: Root) -> Tuple[Sequence[Blob], Sequence[KZGProof]]:
# pylint: disable=unused-argument
return ("TEST", "TEST")'''
return [], []'''

@classmethod
def execution_engine_cls(cls) -> str:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,6 @@ def run(self):
"lru-dict==1.2.0",
MARKO_VERSION,
"py_arkworks_bls12381==0.3.4",
"curdleproofs @ git+https://github.com/nalinbhardwaj/curdleproofs.pie@805d06785b6ff35fde7148762277dd1ae678beeb#egg=curdleproofs&subdirectory=curdleproofs",
"curdleproofs==0.1.1",
]
)
25 changes: 13 additions & 12 deletions specs/_features/whisk/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [Constants](#constants)
- [Domain types](#domain-types)
- [Preset](#preset)
- [Configuration](#configuration)
- [Cryptography](#cryptography)
- [BLS](#bls)
- [Curdleproofs and opening proofs](#curdleproofs-and-opening-proofs)
Expand Down Expand Up @@ -52,12 +53,17 @@ This document details the beacon chain additions and changes of to support the W
| `CURDLEPROOFS_N_BLINDERS` | `uint64(4)` | number of blinders for curdleproofs |
| `WHISK_CANDIDATE_TRACKERS_COUNT` | `uint64(2**14)` (= 16,384) | number of candidate trackers |
| `WHISK_PROPOSER_TRACKERS_COUNT` | `uint64(2**13)` (= 8,192) | number of proposer trackers |
| `WHISK_EPOCHS_PER_SHUFFLING_PHASE` | `Epoch(2**8)` (= 256) | epochs per shuffling phase |
| `WHISK_VALIDATORS_PER_SHUFFLE` | `uint64(2**7 - 4)` (= 124) | number of validators shuffled per shuffle step |
| `WHISK_PROPOSER_SELECTION_GAP` | `Epoch(2)` | gap between proposer selection and the block proposal phase |
| `WHISK_MAX_SHUFFLE_PROOF_SIZE` | `uint64(2**15)` | max size of a shuffle proof |
| `WHISK_MAX_OPENING_PROOF_SIZE` | `uint64(2**10)` | max size of a opening proof |

## Configuration

| Name | Value | Description |
| ---------------------------------- | -------------------------- | ----------------------------------------------------------- |
| `WHISK_EPOCHS_PER_SHUFFLING_PHASE` | `Epoch(2**8)` (= 256) | epochs per shuffling phase |
| `WHISK_PROPOSER_SELECTION_GAP` | `Epoch(2)` | gap between proposer selection and the block proposal phase |

## Cryptography

### BLS
Expand Down Expand Up @@ -318,30 +324,25 @@ def get_shuffle_indices(randao_reveal: BLSSignature) -> Sequence[uint64]:

```python
def process_shuffled_trackers(state: BeaconState, body: BeaconBlockBody) -> None:
# Check the shuffle proof
shuffle_indices = get_shuffle_indices(body.randao_reveal)
pre_shuffle_trackers = [state.whisk_candidate_trackers[i] for i in shuffle_indices]

shuffle_epoch = get_current_epoch(state) % WHISK_EPOCHS_PER_SHUFFLING_PHASE
if shuffle_epoch + WHISK_PROPOSER_SELECTION_GAP + 1 >= WHISK_EPOCHS_PER_SHUFFLING_PHASE:
# Require trackers set to zero during cooldown
assert body.whisk_post_shuffle_trackers == Vector[WhiskTracker, WHISK_VALIDATORS_PER_SHUFFLE]()
assert body.whisk_shuffle_proof_M_commitment == BLSG1Point()
assert body.whisk_shuffle_proof == WhiskShuffleProof()
post_shuffle_trackers = pre_shuffle_trackers
else:
# Require shuffled trackers during shuffle
shuffle_indices = get_shuffle_indices(body.randao_reveal)
pre_shuffle_trackers = [state.whisk_candidate_trackers[i] for i in shuffle_indices]
assert IsValidWhiskShuffleProof(
pre_shuffle_trackers,
body.whisk_post_shuffle_trackers,
body.whisk_shuffle_proof_M_commitment,
body.whisk_shuffle_proof,
)
post_shuffle_trackers = body.whisk_post_shuffle_trackers

# Shuffle candidate trackers
for i, shuffle_index in enumerate(shuffle_indices):
state.whisk_candidate_trackers[shuffle_index] = post_shuffle_trackers[i]
# Shuffle candidate trackers
for i, shuffle_index in enumerate(shuffle_indices):
state.whisk_candidate_trackers[shuffle_index] = body.whisk_post_shuffle_trackers[i]
```

```python
Expand Down
2 changes: 0 additions & 2 deletions specs/altair/fork.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ This document describes the process of the first upgrade of the beacon chain: th

## Configuration

Warning: this configuration is not definitive.

| Name | Value |
| - | - |
| `ALTAIR_FORK_VERSION` | `Version('0x01000000')` |
Expand Down
6 changes: 0 additions & 6 deletions specs/altair/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Altair adds new messages, topics and data to the Req-Resp, Gossip and Discovery
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Warning](#warning)
- [Modifications in Altair](#modifications-in-altair)
- [MetaData](#metadata)
- [The gossip domain: gossipsub](#the-gossip-domain-gossipsub)
Expand All @@ -38,11 +37,6 @@ Altair adds new messages, topics and data to the Req-Resp, Gossip and Discovery
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC -->

## Warning

This document is currently illustrative for early Altair testnets and some parts are subject to change.
Refer to the note in the [validator guide](./validator.md) for further details.

## Modifications in Altair

### MetaData
Expand Down
5 changes: 0 additions & 5 deletions specs/altair/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ This is an accompanying document to [Altair -- The Beacon Chain](./beacon-chain.

- [Introduction](#introduction)
- [Prerequisites](#prerequisites)
- [Warning](#warning)
- [Constants](#constants)
- [Misc](#misc)
- [Containers](#containers)
Expand Down Expand Up @@ -63,10 +62,6 @@ Block proposers incorporate the (aggregated) sync committee signatures into each
All terminology, constants, functions, and protocol mechanics defined in the [Altair -- The Beacon Chain](./beacon-chain.md) doc are requisite for this document and used throughout.
Please see this document before continuing and use as a reference throughout.

## Warning

This document is currently illustrative for early Altair testnets and some parts are subject to change, especially pending implementation and profiling of Altair testnets.

## Constants

### Misc
Expand Down
3 changes: 2 additions & 1 deletion specs/bellatrix/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
# Add proposer score boost if the block is timely
time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT
is_before_attesting_interval = time_into_slot < SECONDS_PER_SLOT // INTERVALS_PER_SLOT
if get_current_slot(store) == block.slot and is_before_attesting_interval:
is_first_block = store.proposer_boost_root == Root()
if get_current_slot(store) == block.slot and is_before_attesting_interval and is_first_block:
store.proposer_boost_root = hash_tree_root(block)

# Update checkpoints in store if necessary
Expand Down
2 changes: 0 additions & 2 deletions specs/bellatrix/fork.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ This document describes the process of Bellatrix upgrade.

## Configuration

Warning: this configuration is not definitive.

| Name | Value |
| - | - |
| `BELLATRIX_FORK_VERSION` | `Version('0x02000000')` |
Expand Down
6 changes: 0 additions & 6 deletions specs/bellatrix/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Readers should understand the Phase 0 and Altair documents and use them as a bas
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Warning](#warning)
- [Modifications in Bellatrix](#modifications-in-bellatrix)
- [The gossip domain: gossipsub](#the-gossip-domain-gossipsub)
- [Topics and messages](#topics-and-messages)
Expand All @@ -33,11 +32,6 @@ Readers should understand the Phase 0 and Altair documents and use them as a bas
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC -->

## Warning

This document is currently illustrative for early Bellatrix testnets and some parts are subject to change.
Refer to the note in the [validator guide](./validator.md) for further details.

## Modifications in Bellatrix

### The gossip domain: gossipsub
Expand Down
3 changes: 2 additions & 1 deletion specs/capella/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
# Add proposer score boost if the block is timely
time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT
is_before_attesting_interval = time_into_slot < SECONDS_PER_SLOT // INTERVALS_PER_SLOT
if get_current_slot(store) == block.slot and is_before_attesting_interval:
is_first_block = store.proposer_boost_root == Root()
if get_current_slot(store) == block.slot and is_before_attesting_interval and is_first_block:
store.proposer_boost_root = hash_tree_root(block)

# Update checkpoints in store if necessary
Expand Down
2 changes: 0 additions & 2 deletions specs/capella/fork.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ This document describes the process of the Capella upgrade.

## Configuration

Warning: this configuration is not definitive.

| Name | Value |
| - | - |
| `CAPELLA_FORK_VERSION` | `Version('0x03000000')` |
Expand Down
55 changes: 54 additions & 1 deletion specs/deneb/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [Preset](#preset)
- [Execution](#execution)
- [Configuration](#configuration)
- [Validator cycle](#validator-cycle)
- [Containers](#containers)
- [Extended containers](#extended-containers)
- [`BeaconBlockBody`](#beaconblockbody)
Expand All @@ -26,6 +27,7 @@
- [`kzg_commitment_to_versioned_hash`](#kzg_commitment_to_versioned_hash)
- [Beacon state accessors](#beacon-state-accessors)
- [Modified `get_attestation_participation_flag_indices`](#modified-get_attestation_participation_flag_indices)
- [New `get_validator_activation_churn_limit`](#new-get_validator_activation_churn_limit)
- [Beacon chain state transition function](#beacon-chain-state-transition-function)
- [Execution engine](#execution-engine)
- [Request data](#request-data)
Expand All @@ -40,6 +42,8 @@
- [Execution payload](#execution-payload)
- [Modified `process_execution_payload`](#modified-process_execution_payload)
- [Modified `process_voluntary_exit`](#modified-process_voluntary_exit)
- [Epoch processing](#epoch-processing)
- [Registry updates](#registry-updates)
- [Testing](#testing)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Expand All @@ -50,8 +54,9 @@
Deneb is a consensus-layer upgrade containing a number of features. Including:
* [EIP-4788](https://eips.ethereum.org/EIPS/eip-4788): Beacon block root in the EVM
* [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844): Shard Blob Transactions scale data-availability of Ethereum in a simple, forwards-compatible manner
* [EIP-7044](https://github.com/ethereum/EIPs/pull/7044): Perpetually Valid Signed Voluntary Exits
* [EIP-7044](https://eips.ethereum.org/EIPS/eip-7044): Perpetually Valid Signed Voluntary Exits
* [EIP-7045](https://eips.ethereum.org/EIPS/eip-7045): Increase Max Attestation Inclusion Slot
* [EIP-7514](https://eips.ethereum.org/EIPS/eip-7514): Add Max Epoch Churn Limit

## Custom types

Expand Down Expand Up @@ -89,6 +94,12 @@ and are limited by `MAX_BLOB_GAS_PER_BLOCK // GAS_PER_BLOB`. However the CL limi

## Configuration

### Validator cycle

| Name | Value |
| - | - |
| `MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT` | `uint64(2**3)` (= 8) |

## Containers

### Extended containers
Expand Down Expand Up @@ -211,6 +222,16 @@ def get_attestation_participation_flag_indices(state: BeaconState,
return participation_flag_indices
```

#### New `get_validator_activation_churn_limit`

```python
def get_validator_activation_churn_limit(state: BeaconState) -> uint64:
"""
Return the validator activation churn limit for the current epoch.
"""
return min(MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT, get_validator_churn_limit(state))
```

## Beacon chain state transition function

### Execution engine
Expand Down Expand Up @@ -415,6 +436,38 @@ def process_voluntary_exit(state: BeaconState, signed_voluntary_exit: SignedVolu
initiate_validator_exit(state, voluntary_exit.validator_index)
```

### Epoch processing

#### Registry updates

*Note*: The function `process_registry_updates` is modified to utilize `get_validator_activation_churn_limit()` to rate limit the activation queue for EIP-7514.

```python
def process_registry_updates(state: BeaconState) -> None:
# Process activation eligibility and ejections
for index, validator in enumerate(state.validators):
if is_eligible_for_activation_queue(validator):
validator.activation_eligibility_epoch = get_current_epoch(state) + 1

if (
is_active_validator(validator, get_current_epoch(state))
and validator.effective_balance <= EJECTION_BALANCE
):
initiate_validator_exit(state, ValidatorIndex(index))

# Queue validators eligible for activation and not yet dequeued for activation
activation_queue = sorted([
index for index, validator in enumerate(state.validators)
if is_eligible_for_activation(state, validator)
# Order by the sequence of activation_eligibility_epoch setting and then index
], key=lambda index: (state.validators[index].activation_eligibility_epoch, index))
# Dequeued validators for activation up to activation churn limit
# [Modified in Deneb:EIP7514]
for index in activation_queue[:get_validator_activation_churn_limit(state)]:
validator = state.validators[index]
validator.activation_epoch = compute_activation_exit_epoch(get_current_epoch(state))
```

## Testing

*Note*: The function `initialize_beacon_state_from_eth1` is modified for pure Deneb testing only.
Expand Down
8 changes: 2 additions & 6 deletions specs/deneb/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ def is_data_available(beacon_block_root: Root, blob_kzg_commitments: Sequence[KZ
# `MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS`
blobs, proofs = retrieve_blobs_and_proofs(beacon_block_root)

# For testing, `retrieve_blobs_and_proofs` returns ("TEST", "TEST").
# TODO: Remove it once we have a way to inject `BlobSidecar` into tests.
if isinstance(blobs, str) or isinstance(proofs, str):
return True

return verify_blob_kzg_proof_batch(blobs, blob_kzg_commitments, proofs)
```

Expand Down Expand Up @@ -111,7 +106,8 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
# Add proposer score boost if the block is timely
time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT
is_before_attesting_interval = time_into_slot < SECONDS_PER_SLOT // INTERVALS_PER_SLOT
if get_current_slot(store) == block.slot and is_before_attesting_interval:
is_first_block = store.proposer_boost_root == Root()
if get_current_slot(store) == block.slot and is_before_attesting_interval and is_first_block:
store.proposer_boost_root = hash_tree_root(block)

# Update checkpoints in store if necessary
Expand Down
3 changes: 2 additions & 1 deletion specs/phase0/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,8 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
# Add proposer score boost if the block is timely
time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT
is_before_attesting_interval = time_into_slot < SECONDS_PER_SLOT // INTERVALS_PER_SLOT
if get_current_slot(store) == block.slot and is_before_attesting_interval:
is_first_block = store.proposer_boost_root == Root()
if get_current_slot(store) == block.slot and is_before_attesting_interval and is_first_block:
store.proposer_boost_root = hash_tree_root(block)

# Update checkpoints in store if necessary
Expand Down
Loading