2024-03-06 06:00:55 +00:00
# Electra -- Honest Validator
2023-03-09 15:05:07 +00:00
## Table of contents
<!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE - RUN doctoc TO UPDATE -->
- [Introduction ](#introduction )
- [Prerequisites ](#prerequisites )
- [Block proposal ](#block-proposal )
- [Deposits ](#deposits )
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC -->
## Introduction
2024-03-06 06:00:55 +00:00
This document represents the changes to be made in the code of an "honest validator" to implement Electra.
2023-03-09 15:05:07 +00:00
## Prerequisites
2023-04-06 10:53:31 +00:00
This document is an extension of the [Deneb -- Honest Validator ](../../deneb/validator.md ) guide.
2023-03-09 15:05:07 +00:00
All behaviors and definitions defined in this document, and documents it extends, carry over unless explicitly noted or overridden.
2024-03-06 06:00:55 +00:00
All terminology, constants, functions, and protocol mechanics defined in the updated Beacon Chain doc of [Electra ](./beacon-chain.md ) are requisite for this document and used throughout.
2023-03-09 15:05:07 +00:00
Please see related Beacon Chain doc before continuing and use them as a reference throughout.
## Block proposal
### Deposits
2024-03-06 06:00:55 +00:00
*[New in Electra:EIP6110* The expected number of deposits MUST be changed from `min(MAX_DEPOSITS, eth1_data.deposit_count - state.eth1_deposit_index)` to the result of the following function:
2023-03-09 15:05:07 +00:00
```python
2024-03-21 13:13:30 +00:00
def get_eth1_pending_deposit_count(state: BeaconState) -> uint64:
2023-03-09 15:05:07 +00:00
eth1_deposit_index_limit = min(state.eth1_data.deposit_count, state.deposit_receipts_start_index)
if state.eth1_deposit_index < eth1_deposit_index_limit:
return min(MAX_DEPOSITS, eth1_deposit_index_limit - state.eth1_deposit_index)
else:
2023-03-14 17:22:12 +00:00
return uint64(0)
2023-03-09 15:05:07 +00:00
```