Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 35 additions & 5 deletions configs/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ EIP7805_FORK_EPOCH: 18446744073709551615

# Time parameters
# ---------------------------------------------------------------
# 12 seconds
# 12 seconds (*deprecated*)
SECONDS_PER_SLOT: 12
# 12000 milliseconds, 12 seconds
SLOT_DURATION_MS: 12000
# 14 (estimate from Eth1 mainnet)
SECONDS_PER_ETH1_BLOCK: 14
# 2**8 (= 256) epochs, ~27 hours
Expand All @@ -77,6 +79,38 @@ MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256
SHARD_COMMITTEE_PERIOD: 256
# 2**11 (= 2,048) Eth1 blocks, ~8 hours
ETH1_FOLLOW_DISTANCE: 2048
# 1667 basis points, ~17% of SLOT_DURATION_MS
PROPOSER_REORG_CUTOFF_BPS: 1667
# 3333 basis points, ~33% of SLOT_DURATION_MS
ATTESTATION_DUE_BPS: 3333
# 6667 basis points, ~67% of SLOT_DURATION_MS
AGGREGRATE_DUE_BPS: 6667

# Altair
# 3333 basis points, ~33% of SLOT_DURATION_MS
SYNC_MESSAGE_DUE_BPS: 3333
# 6667 basis points, ~67% of SLOT_DURATION_MS
CONTRIBUTION_DUE_BPS: 6667

# EIP-7732
# 2500 basis points, 25% of SLOT_DURATION_MS
ATTESTATION_DUE_BPS_EIP7732: 2500
# 5000 basis points, 50% of SLOT_DURATION_MS
AGGREGRATE_DUE_BPS_EIP7732: 5000
# 2500 basis points, 25% of SLOT_DURATION_MS
SYNC_MESSAGE_DUE_BPS_EIP7732: 2500
# 5000 basis points, 50% of SLOT_DURATION_MS
CONTRIBUTION_DUE_BPS_EIP7732: 5000
# 7500 basis points, 75% of SLOT_DURATION_MS
PAYLOAD_ATTESTATION_DUE_BPS: 7500

# EIP-7805
# 7500 basis points, 75% of SLOT_DURATION_MS
VIEW_FREEZE_CUTOFF_BPS: 7500
# 6667 basis points, ~67% of SLOT_DURATION_MS
INCLUSION_LIST_SUBMISSION_DUE_BPS: 6667
# 9167 basis points, ~92% of SLOT_DURATION_MS
PROPOSER_INCLUSION_LIST_CUTOFF_BPS: 9167

# Validator cycle
# ---------------------------------------------------------------
Expand Down Expand Up @@ -182,10 +216,6 @@ MAX_REQUEST_PAYLOADS: 128
PROPOSER_SCORE_BOOST_EIP7732: 20

# EIP7805
ATTESTATION_DEADLINE: 4
INCLUSION_LIST_SUBMISSION_DEADLINE: 8
VIEW_FREEZE_DEADLINE: 9
PROPOSER_INCLUSION_LIST_CUTOFF: 11
# 2**4 (= 16)
MAX_REQUEST_INCLUSION_LIST: 16
# 2**13 (= 8192)
Expand Down
40 changes: 35 additions & 5 deletions configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ EIP7805_FORK_EPOCH: 18446744073709551615

# Time parameters
# ---------------------------------------------------------------
# [customized] 6 seconds
# [customized] 6 seconds (*deprecated*)
SECONDS_PER_SLOT: 6
# [customized] 6000 milliseconds, 6 seconds
SLOT_DURATION_MS: 6000
# 14 (estimate from Eth1 mainnet)
SECONDS_PER_ETH1_BLOCK: 14
# 2**8 (= 256) epochs, ~27 hours
Expand All @@ -73,6 +75,38 @@ MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256
SHARD_COMMITTEE_PERIOD: 64
# [customized] 2**4 (= 16) Eth1 blocks, ~4 minutes
ETH1_FOLLOW_DISTANCE: 16
# 1667 basis points, ~17% of SLOT_DURATION_MS
PROPOSER_REORG_CUTOFF_BPS: 1667
# 3333 basis points, ~33% of SLOT_DURATION_MS
ATTESTATION_DUE_BPS: 3333
# 6667 basis points, ~67% of SLOT_DURATION_MS
AGGREGRATE_DUE_BPS: 6667

# Altair
# 3333 basis points, ~33% of SLOT_DURATION_MS
SYNC_MESSAGE_DUE_BPS: 3333
# 6667 basis points, ~67% of SLOT_DURATION_MS
CONTRIBUTION_DUE_BPS: 6667

# EIP-7732
# 2500 basis points, 25% of SLOT_DURATION_MS
ATTESTATION_DUE_BPS_EIP7732: 2500
# 5000 basis points, 50% of SLOT_DURATION_MS
AGGREGRATE_DUE_BPS_EIP7732: 5000
# 2500 basis points, 25% of SLOT_DURATION_MS
SYNC_MESSAGE_DUE_BPS_EIP7732: 2500
# 5000 basis points, 50% of SLOT_DURATION_MS
CONTRIBUTION_DUE_BPS_EIP7732: 5000
# 7500 basis points, 75% of SLOT_DURATION_MS
PAYLOAD_ATTESTATION_DUE_BPS: 7500

# EIP-7805
# 7500 basis points, 75% of SLOT_DURATION_MS
VIEW_FREEZE_CUTOFF_BPS: 7500
# 6667 basis points, ~67% of SLOT_DURATION_MS
INCLUSION_LIST_SUBMISSION_DUE_BPS: 6667
# 9167 basis points, ~92% of SLOT_DURATION_MS
PROPOSER_INCLUSION_LIST_CUTOFF_BPS: 9167

# Validator cycle
# ---------------------------------------------------------------
Expand Down Expand Up @@ -179,10 +213,6 @@ MAX_REQUEST_PAYLOADS: 128
PROPOSER_SCORE_BOOST_EIP7732: 20

# EIP7805
ATTESTATION_DEADLINE: 2
INCLUSION_LIST_SUBMISSION_DEADLINE: 2
VIEW_FREEZE_DEADLINE: 3
PROPOSER_INCLUSION_LIST_CUTOFF: 5
# 2**4 (= 16)
MAX_REQUEST_INCLUSION_LIST: 16
# 2**13 (= 8192)
Expand Down
8 changes: 5 additions & 3 deletions specs/_features/eip7732/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ This is the modification of the fork-choice accompanying the EIP-7732 upgrade.
| Name | Value |
| -------------------------- | ----------------------- |
| `PAYLOAD_TIMELY_THRESHOLD` | `PTC_SIZE // 2` (= 256) |
| `INTERVALS_PER_SLOT` | `4` |
| `PAYLOAD_STATUS_PENDING` | `PayloadStatus(0)` |
| `PAYLOAD_STATUS_EMPTY` | `PayloadStatus(1)` |
| `PAYLOAD_STATUS_FULL` | `PayloadStatus(2)` |
Expand Down Expand Up @@ -485,8 +484,11 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
# Notify the store about the payload_attestations in the block
notify_ptc_messages(store, state, block.body.payload_attestations)
# 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
seconds_since_genesis = store.time - store.genesis_time
time_into_slot_ms = seconds_to_milliseconds(seconds_since_genesis) % SLOT_DURATION_MS
# [Modified in EIP7732]
attestation_threshold_ms = get_slot_component_duration_ms(ATTESTATION_DUE_BPS_EIP7732)
is_before_attesting_interval = time_into_slot_ms < attestation_threshold_ms
is_timely = get_current_slot(store) == block.slot and is_before_attesting_interval
store.block_timeliness[hash_tree_root(block)] = is_timely

Expand Down
36 changes: 26 additions & 10 deletions specs/_features/eip7732/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<!-- mdformat-toc start --slug=github --no-anchors --maxlevel=6 --minlevel=2 -->

- [Introduction](#introduction)
- [Configuration](#configuration)
- [Time parameters](#time-parameters)
- [Validator assignment](#validator-assignment)
- [Lookahead](#lookahead)
- [Beacon chain responsibilities](#beacon-chain-responsibilities)
Expand All @@ -26,6 +28,18 @@
This document represents the changes and additions to the Honest validator guide
included in the EIP-7732 fork.

## Configuration

### Time parameters

| Name | Value | Unit | Duration |
| ------------------------------ | -------------- | :----------: | :-----------------------: |
| `ATTESTATION_DUE_BPS_EIP7732` | `uint64(2500)` | basis points | 25% of `SLOT_DURATION_MS` |
| `AGGREGRATE_DUE_BPS_EIP7732` | `uint64(5000)` | basis points | 50% of `SLOT_DURATION_MS` |
| `SYNC_MESSAGE_DUE_BPS_EIP7732` | `uint64(2500)` | basis points | 25% of `SLOT_DURATION_MS` |
| `CONTRIBUTION_DUE_BPS_EIP7732` | `uint64(5000)` | basis points | 50% of `SLOT_DURATION_MS` |
| `PAYLOAD_ATTESTATION_DUE_BPS` | `uint64(7500)` | basis points | 75% of `SLOT_DURATION_MS` |

## Validator assignment

A validator may be a member of the new Payload Timeliness Committee (PTC) for a
Expand Down Expand Up @@ -69,16 +83,17 @@ All validator responsibilities remain unchanged other than the following:
becomes a builder's duty.
- Some validators are selected per slot to become PTC members, these validators
must broadcast `PayloadAttestationMessage` objects during the assigned slot
before the deadline of `3 * SECONDS_PER_SLOT // INTERVALS_PER_SLOT` seconds
before the deadline of
`get_slot_component_duration_ms(PAYLOAD_ATTESTATION_DUE_BPS)` milliseconds
into the slot.

### Attestation

The attestation deadline is implicitly changed by the change in
`INTERVALS_PER_SLOT`. Moreover, the `attestation.data.index` field is now used
to signal the payload status of the block being attested to
(`attestation.data.beacon_block_root`). With the alias
`data = attestation.data`, the validator should set this field as follows:
The attestation deadline is changed with `ATTESTATION_DUE_BPS_EIP7732`.
Moreover, the `attestation.data.index` field is now used to signal the payload
status of the block being attested to (`attestation.data.beacon_block_root`).
With the alias `data = attestation.data`, the validator should set this field as
follows:

- If `block.slot == current_slot` (i.e., `data.slot`), then always set
`data.index = 0`.
Expand All @@ -92,7 +107,7 @@ to signal the payload status of the block being attested to
### Sync Committee participations

Sync committee duties are not changed for validators, however the submission
deadline is implicitly changed by the change in `INTERVALS_PER_SLOT`.
deadline is changed with `SYNC_MESSAGE_DUE_BPS_EIP7732`.

### Block proposal

Expand Down Expand Up @@ -152,16 +167,17 @@ prepared to submit their PTC attestations during the next epoch.

A validator should create and broadcast the `payload_attestation_message` to the
global execution attestation subnet not after
`SECONDS_PER_SLOT * 3 / INTERVALS_PER_SLOT` seconds since the start of `slot`
`get_slot_component_duration_ms(PAYLOAD_ATTESTATION_DUE_BPS)` milliseconds since
the start of `slot`.

#### Constructing a payload attestation

If a validator is in the payload attestation committee for the current slot (as
obtained from `get_ptc_assignment` above) then the validator should prepare a
`PayloadAttestationMessage` for the current slot, according to the logic in
`get_payload_attestation_message` below and broadcast it not after
`SECONDS_PER_SLOT * 3 / INTERVALS_PER_SLOT` seconds since the start of the slot,
to the global `payload_attestation_message` pubsub topic.
`get_slot_component_duration_ms(PAYLOAD_ATTESTATION_DUE_BPS)` milliseconds since
the start of the slot, to the global `payload_attestation_message` pubsub topic.

The validator creates `payload_attestation_message` as follows:

Expand Down
22 changes: 12 additions & 10 deletions specs/_features/eip7805/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ This is the modification of the fork choice accompanying the EIP-7805 upgrade.

### Time parameters

| Name | Value | Unit | Duration |
| ---------------------- | ------------------------------- | :-----: | :-------: |
| `VIEW_FREEZE_DEADLINE` | `SECONDS_PER_SLOT * 2 // 3 + 1` | seconds | 9 seconds |
| Name | Value | Unit | Duration |
| ------------------------ | -------------- | :----------: | :-----------------------: |
| `VIEW_FREEZE_CUTOFF_BPS` | `uint64(7500)` | basis points | 75% of `SLOT_DURATION_MS` |

## Protocols

Expand Down Expand Up @@ -270,12 +270,12 @@ def on_inclusion_list(store: Store, signed_inclusion_list: SignedInclusionList)

inclusion_list_store = get_inclusion_list_store()

time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT
is_before_view_freeze_deadline = (
get_current_slot(store) == inclusion_list.slot and time_into_slot < VIEW_FREEZE_DEADLINE
)
seconds_since_genesis = store.time - store.genesis_time
time_into_slot_ms = seconds_to_milliseconds(seconds_since_genesis) % SLOT_DURATION_MS
view_freeze_cutoff_ms = get_slot_component_duration_ms(VIEW_FREEZE_CUTOFF_BPS)
is_before_view_freeze_cutoff = time_into_slot_ms < view_freeze_cutoff_ms

process_inclusion_list(inclusion_list_store, inclusion_list, is_before_view_freeze_deadline)
process_inclusion_list(inclusion_list_store, inclusion_list, is_before_view_freeze_cutoff)
```

### Modified `on_block`
Expand Down Expand Up @@ -324,8 +324,10 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
store.block_states[block_root] = state

# Add block timeliness to the store
time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT
is_before_attesting_interval = time_into_slot < SECONDS_PER_SLOT // INTERVALS_PER_SLOT
seconds_since_genesis = store.time - store.genesis_time
time_into_slot_ms = seconds_to_milliseconds(seconds_since_genesis) % SLOT_DURATION_MS
attestation_threshold_ms = get_slot_component_duration_ms(ATTESTATION_DUE_BPS)
is_before_attesting_interval = time_into_slot_ms < attestation_threshold_ms
is_timely = get_current_slot(store) == block.slot and is_before_attesting_interval
store.block_timeliness[hash_tree_root(block)] = is_timely

Expand Down
7 changes: 2 additions & 5 deletions specs/_features/eip7805/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ EIP-7805.

### Configuration

| Name | Value | Unit | Duration |
| ---------------------- | ----------------------- | :-----: | :-------: |
| `ATTESTATION_DEADLINE` | `SECONDS_PER_SLOT // 3` | seconds | 4 seconds |

| Name | Value | Description |
| ------------------------------ | ---------------- | ---------------------------------------------------------- |
| `MAX_REQUEST_INCLUSION_LIST` | `2**4` (= 16) | Maximum number of inclusion list in a single request |
Expand Down Expand Up @@ -56,7 +52,8 @@ the network, assuming the alias `message = signed_inclusion_list.message`:
- _[REJECT]_ The slot `message.slot` is equal to the previous or current slot.
- _[IGNORE]_ The slot `message.slot` is equal to the current slot, or it is
equal to the previous slot and the current time is less than
`ATTESTATION_DEADLINE` seconds into the slot.
`get_slot_component_duration_ms(ATTESTATION_DUE_BPS)` milliseconds into the
slot.
- _[IGNORE]_ The `inclusion_list_committee` for slot `message.slot` on the
current branch corresponds to `message.inclusion_list_committee_root`, as
determined by
Expand Down
25 changes: 14 additions & 11 deletions specs/_features/eip7805/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ continuing and use them as a reference throughout.

### Time parameters

| Name | Value | Unit | Duration |
| ------------------------------------ | --------------------------- | :-----: | :--------: |
| `INCLUSION_LIST_SUBMISSION_DEADLINE` | `SECONDS_PER_SLOT * 2 // 3` | seconds | 8 seconds |
| `PROPOSER_INCLUSION_LIST_CUTOFF` | `SECONDS_PER_SLOT - 1` | seconds | 11 seconds |
| Name | Value | Unit | Duration |
| ------------------------------------ | -------------- | :----------: | :------------------------: |
| `INCLUSION_LIST_SUBMISSION_DUE_BPS` | `uint64(6667)` | basis points | ~67% of `SLOT_DURATION_MS` |
| `PROPOSER_INCLUSION_LIST_CUTOFF_BPS` | `uint64(9167)` | basis points | ~92% of `SLOT_DURATION_MS` |

## Helpers

Expand Down Expand Up @@ -150,7 +150,8 @@ processed through any empty slots up to the assigned slot using

*Note*: A proposer should produce an execution payload that satisfies the
inclusion list constraints with respect to the inclusion lists gathered up to
`PROPOSER_INCLUSION_LIST_CUTOFF` into the slot.
`get_slot_component_duration_ms(PROPOSER_INCLUSION_LIST_CUTOFF_BPS)`
milliseconds into the slot.

```python
def prepare_execution_payload(
Expand Down Expand Up @@ -198,12 +199,14 @@ of any `slot` for which

If a validator is in the current inclusion list committee, the validator should
create and broadcast the `signed_inclusion_list` to the global `inclusion_list`
subnet by `INCLUSION_LIST_SUBMISSION_DEADLINE` seconds into the slot after
processing the block for the current slot and confirming it as the head. If no
block is received by `INCLUSION_LIST_SUBMISSION_DEADLINE - 1` seconds into the
slot, the validator should run `get_head` to determine the local head and
construct and broadcast the inclusion list based on this local head by
`INCLUSION_LIST_SUBMISSION_DEADLINE` seconds into the slot.
subnet by `get_slot_component_duration_ms(INCLUSION_LIST_SUBMISSION_DUE_BPS)`
milliseconds into the slot after processing the block for the current slot and
confirming it as the head. If no block is received by
`get_slot_component_duration_ms(INCLUSION_LIST_SUBMISSION_DUE_BPS) - 1000`
milliseconds into the slot, the validator should run `get_head` to determine the
local head and construct and broadcast the inclusion list based on this local
head by `get_slot_component_duration_ms(INCLUSION_LIST_SUBMISSION_DUE_BPS)`
milliseconds into the slot.

#### Constructing the `SignedInclusionList`

Expand Down
24 changes: 12 additions & 12 deletions specs/altair/light-client/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ the network.
`finality_update` for that slot did not indicate supermajority
- _[IGNORE]_ The `finality_update` is received after the block at
`signature_slot` was given enough time to propagate through the network --
i.e. validate that one-third of `finality_update.signature_slot` has
transpired (`SECONDS_PER_SLOT / INTERVALS_PER_SLOT` seconds after the start of
the slot, with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance)
i.e. validatate that `get_slot_component_duration_ms(SYNC_MESSAGE_DUE_BPS)`
milliseconds (with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance) has
transpired since the start of `signature_slot`.

For full nodes, the following validations MUST additionally pass before
forwarding the `finality_update` on the network.
Expand Down Expand Up @@ -111,9 +111,9 @@ the network.
previously forwarded `optimistic_update`s
- _[IGNORE]_ The `optimistic_update` is received after the block at
`signature_slot` was given enough time to propagate through the network --
i.e. validate that one-third of `optimistic_update.signature_slot` has
transpired (`SECONDS_PER_SLOT / INTERVALS_PER_SLOT` seconds after the start of
the slot, with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance)
i.e. validatate that `get_slot_component_duration_ms(SYNC_MESSAGE_DUE_BPS)`
milliseconds (with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance) has
transpired since the start of `optimistic_update.signature_slot`.

For full nodes, the following validations MUST additionally pass before
forwarding the `optimistic_update` on the network.
Expand Down Expand Up @@ -371,9 +371,9 @@ follows:
SHOULD be broadcasted to the pubsub topic `light_client_optimistic_update` if
no matching message has not yet been forwarded as part of gossip validation.

These messages SHOULD be broadcasted after one-third of `slot` has transpired
(`SECONDS_PER_SLOT / INTERVALS_PER_SLOT` seconds after the start of the slot).
To ensure that the corresponding block was given enough time to propagate
through the network, they SHOULD NOT be sent earlier. Note that this is
different from how other messages are handled, e.g., attestations, which may be
sent early.
These messages SHOULD be broadcasted
`get_slot_component_duration_ms(SYNC_MESSAGE_DUE_BPS)` milliseconds after the
start of the slot. To ensure that the corresponding block was given enough time
to propagate through the network, they SHOULD NOT be sent earlier. Note that
this is different from how other messages are handled, e.g., attestations, which
may be sent early.
Loading