Skip to content

Commit

Permalink
Use eip7805
Browse files Browse the repository at this point in the history
  • Loading branch information
terencechain committed Nov 4, 2024
1 parent 2861684 commit e678deb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 129 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FOCIL -- The Beacon Chain
# EIP-7805 -- The Beacon Chain

## Table of contents

Expand Down Expand Up @@ -32,7 +32,7 @@

## Introduction

This is the beacon chain specification to add a fork-choice enforced, committee-based inclusion list (FOCIL) mechanism to allow forced transaction inclusion. Refers to the following posts:
This is the beacon chain specification to add EIP-7805 / fork-choice enforced, committee-based inclusion list (FOCIL) mechanism to allow forced transaction inclusion. Refers to the following posts:
- [Fork-Choice enforced Inclusion Lists (FOCIL): A simple committee-based inclusion list proposal](https://ethresear.ch/t/fork-choice-enforced-inclusion-lists-focil-a-simple-committee-based-inclusion-list-proposal/19870/1)
- [FOCIL CL & EL workflow](https://ethresear.ch/t/focil-cl-el-workflow/20526)
*Note:* This specification is built upon [Electra](../../electra/beacon_chain.md) and is under active development.
Expand All @@ -43,19 +43,19 @@ This is the beacon chain specification to add a fork-choice enforced, committee-

| Name | Value |
| - | - |
| `DOMAIN_IL_COMMITTEE` | `DomainType('0x0C000000')` # (New in FOCIL)|
| `DOMAIN_IL_COMMITTEE` | `DomainType('0x0C000000')` # (New in EIP-7805)|

### Inclusion List Committee

| Name | Value |
| - | - |
| `IL_COMMITTEE_SIZE` | `uint64(2**4)` (=16) # (New in FOCIL) |
| `IL_COMMITTEE_SIZE` | `uint64(2**4)` (=16) # (New in EIP-7805) |

### Execution

| Name | Value |
| - | - |
| `MAX_TRANSACTIONS_PER_INCLUSION_LIST` | `uint64(1)` # (New in FOCIL) TODO: Placeholder |
| `MAX_TRANSACTIONS_PER_INCLUSION_LIST` | `uint64(1)` # (New in EIP-7805) TODO: Placeholder |

## Containers

Expand Down Expand Up @@ -127,14 +127,14 @@ class NewPayloadRequest(object):
versioned_hashes: Sequence[VersionedHash]
parent_beacon_block_root: Root
execution_requests: ExecutionRequests
il_transactions: List[Transaction, MAX_TRANSACTIONS_PER_INCLUSION_LIST] # [New in FOCIL]
il_transactions: List[Transaction, MAX_TRANSACTIONS_PER_INCLUSION_LIST] # [New in EIP-7805]
```

#### Engine APIs

##### Modified `notify_new_payload`

*Note*: The function `notify_new_payload` is modified to include the additional `il_transactions` parameter in FOCIL.
*Note*: The function `notify_new_payload` is modified to include the additional `il_transactions` parameter in EIP-7805.

```python
def notify_new_payload(self: ExecutionEngine,
Expand All @@ -152,7 +152,7 @@ def notify_new_payload(self: ExecutionEngine,
##### Modified `verify_and_notify_new_payload`

*Note*: The function `verify_and_notify_new_payload` is modified to pass the additional parameter `il_transactions`
when calling `notify_new_payload` in FOCIL.
when calling `notify_new_payload` in EIP-7805.

```python
def verify_and_notify_new_payload(self: ExecutionEngine,
Expand All @@ -163,15 +163,15 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
execution_payload = new_payload_request.execution_payload
execution_requests = new_payload_request.execution_requests
parent_beacon_block_root = new_payload_request.parent_beacon_block_root
il_transactions = new_payload_request.il_transactions # [New in FOCIL]
il_transactions = new_payload_request.il_transactions # [New in EIP-7805]

if not self.is_valid_block_hash(execution_payload, parent_beacon_block_root):
return False

if not self.is_valid_versioned_hashes(new_payload_request):
return False

# [Modified in FOCIL]
# [Modified in EIP-7805]
if not self.notify_new_payload(
execution_payload,
execution_requests,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FOCIL -- Fork Choice
# EIP-7805 -- Fork Choice

## Table of contents
<!-- TOC -->
Expand All @@ -15,13 +15,13 @@

## Introduction

This is the modification of the fork choice accompanying the FOCIL upgrade.
This is the modification of the fork choice accompanying the EIP-7805 upgrade.

## Configuration

| Name | Value | Unit | Duration |
| - | - | :-: | :-: |
| `VIEW_FREEZE_DEADLINE` | `uint64(9)` | seconds | 9 seconds | # [New in FOCIL]
| `VIEW_FREEZE_DEADLINE` | `uint64(9)` | seconds | 9 seconds | # [New in EIP-7805]

## Helpers

Expand Down Expand Up @@ -55,9 +55,9 @@ class Store(object):
checkpoint_states: Dict[Checkpoint, BeaconState] = field(default_factory=dict)
latest_messages: Dict[ValidatorIndex, LatestMessage] = field(default_factory=dict)
unrealized_justifications: Dict[Root, Checkpoint] = field(default_factory=dict)
inclusion_lists: Dict[Tuple[Slot, Root], List[InclusionList]] = field(default_factory=dict) # [New in FOCIL]
inclusion_list_equivocators: Dict[Tuple[Slot, Root], Set[ValidatorIndex]] = field(default_factory=dict) # [New in FOCIL]

inclusion_lists: Dict[Tuple[Slot, Root], List[InclusionList]] = field(default_factory=dict) # [New in EIP-7805]
inclusion_list_equivocators: Dict[Tuple[Slot, Root], Set[ValidatorIndex]] = field(default_factory=dict) # [New in EIP-7805]
```

### New `on_inclusion_list`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FOCIL -- Networking
# EIP-7805 -- Networking

This document contains the consensus-layer networking specification for FOCIL.
This document contains the consensus-layer networking specification for EIP-7805.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Expand Down Expand Up @@ -35,11 +35,11 @@ The new topics along with the type of the `data` field of a gossipsub message ar

| Name | Message Type |
|-------------------------------|------------------------------------------------------|
| `inclusion_list` | `SignedInclusionList` [New in FOCIL] |
| `inclusion_list` | `SignedInclusionList` [New in EIP-7805] |

##### Global topics

FOCIL introduces a new global topic for inclusion lists.
EIP-7805 introduces a new global topic for inclusion lists.

###### `inclusion_list`

Expand Down Expand Up @@ -69,7 +69,7 @@ The `<context-bytes>` field is calculated as `context = compute_fork_digest(fork

| `fork_version` | Chunk SSZ type |
|------------------------|------------------------------------------|
| `FOCIL_FORK_VERSION` | `focil.SignedInclusionList` |
| `EIP-7805_FORK_VERSION` | `EIP-7805.SignedInclusionList` |

Request Content:
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FOCIL -- Honest Validator
# EIP-7805 -- Honest Validator

## Table of contents

Expand All @@ -25,14 +25,14 @@

## Introduction

This document represents the changes to be made in the code of an "honest validator" to implement FOCIL.
This document represents the changes to be made in the code of an "honest validator" to implement EIP-7805.

## Prerequisites

This document is an extension of the [Electra -- Honest Validator](../../electra/validator.md) guide.
All behaviors and definitions defined in this document, and documents it extends, carry over unless explicitly noted or overridden.

All terminology, constants, functions, and protocol mechanics defined in the updated Beacon Chain doc of [FOCIL](./beacon-chain.md) are requisite for this document and used throughout.
All terminology, constants, functions, and protocol mechanics defined in the updated Beacon Chain doc of [EIP-7805](./beacon-chain.md) are requisite for this document and used throughout.
Please see related Beacon Chain doc before continuing and use them as a reference throughout.

### Time parameters
Expand Down
105 changes: 0 additions & 105 deletions specs/_features/focil/engine-api.md

This file was deleted.

0 comments on commit e678deb

Please sign in to comment.