Skip to content

Commit

Permalink
@jtraglia's suggestions
Browse files Browse the repository at this point in the history
Co-authored-by: Justin Traglia <[email protected]>
  • Loading branch information
terencechain and jtraglia committed Nov 8, 2024
1 parent e678deb commit e9fdfc6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
8 changes: 4 additions & 4 deletions specs/_features/eip7805/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This is the beacon chain specification to add EIP-7805 / fork-choice enforced, c

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

### Inclusion List Committee

Expand All @@ -55,7 +55,7 @@ This is the beacon chain specification to add EIP-7805 / fork-choice enforced, c

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

## Containers

Expand Down Expand Up @@ -88,14 +88,14 @@ def is_valid_inclusion_list_signature(
state: BeaconState,
signed_inclusion_list: SignedInclusionList) -> bool:
"""
Check if ``signed_inclusion_list`` has a valid signature
Check if ``signed_inclusion_list`` has a valid signature.
"""
message = signed_inclusion_list.message
index = message.validator_index
pubkey = state.validators[index].pubkey
domain = get_domain(state, DOMAIN_IL_COMMITTEE, compute_epoch_at_slot(message.slot))
signing_root = compute_signing_root(message, domain)
return bls.FastAggregateVerify(pubkey, signing_root, signed_inclusion_list.signature)
return bls.Verify(pubkey, signing_root, signed_inclusion_list.signature)
```

### Beacon State accessors
Expand Down
14 changes: 9 additions & 5 deletions specs/_features/eip7805/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This is the modification of the fork choice accompanying the EIP-7805 upgrade.

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

## Helpers

Expand All @@ -30,13 +30,16 @@ This is the modification of the fork choice accompanying the EIP-7805 upgrade.
```python
def validate_inclusion_lists(store: Store, inclusion_list_transactions: List[Transaction, MAX_TRANSACTIONS_PER_INCLUSION_LIST * IL_COMMITTEE_SIZE], execution_payload: ExecutionPayload) -> bool:
"""
Return ``True`` if and only if the input ``inclusion_list_transactions`` satifies validation, that to verify if the `execution_payload` satisfies `inclusion_list_transactions` validity conditions either when all transactions are present in payload or when any missing transactions are found to be invalid when appended to the end of the payload unless the block is full.
Return ``True`` if and only if the input ``inclusion_list_transactions`` satifies validation,
that to verify if the ``execution_payload`` satisfies ``inclusion_list_transactions`` validity conditions either when all transactions are present in payload or
when any missing transactions are found to be invalid when appended to the end of the payload unless the block is full.
"""
...
```

### Modified `Store`
**Note:** `Store` is modified to track the seen inclusion lists.

**Note:** `Store` is modified to track the seen inclusion lists and inclusion list equivocators.

```python
@dataclass
Expand All @@ -62,13 +65,14 @@ class Store(object):
### New `on_inclusion_list`

`on_inclusion_list` is called to import `signed_inclusion_list` to the fork choice store.

```python
def on_inclusion_list(
store: Store,
signed_inclusion_list: SignedInclusionList,
inclusion_list_committee: Vector[ValidatorIndex, IL_COMMITTEE_SIZE]]) -> None:
"""
``on_inclusion_list`` verify the inclusion list before importing it to fork choice store.
Verify the inclusion list and import it into the fork choice store.
If there exists more than 1 inclusion list in store with the same slot and validator index, remove the original one.
"""
message = signed_inclusion_list.message
Expand Down Expand Up @@ -98,7 +102,7 @@ def on_inclusion_list(
if validator_index not in inclusion_list_equivocators[(message.slot, root)]:
if validator_index in [il.validator_index for il in inclusion_lists[(message.slot, root)]]:
il = [il for il in inclusion_lists[(message.slot, root)] if il.validator_index == validator_index][0]
if not il == message:
if validator_il != message:
# We have equivocation evidence for `validator_index`, record it as equivocator
inclusion_list_equivocators[(message.slot, root)].add(validator_index)
# This inclusion list is not an equivocation. Store it if prior to the view freeze deadline
Expand Down
1 change: 0 additions & 1 deletion specs/_features/eip7805/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ The following validations MUST pass before forwarding the `inclusion_list` on th
- _[IGNORE]_ The `message` is either the first or second valid message received from the validator with index `message.validator_index`.
- _[REJECT]_ The signature of `inclusion_list.signature` is valid with respect to the validator index.


### The Req/Resp domain

#### Messages
Expand Down
10 changes: 5 additions & 5 deletions specs/_features/eip7805/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The body of these function is implementation dependent. The Engine API may be us

## New inclusion list committee assignment

A validator may be a member of the new Inclusion List Committee (ILC) for a given slot. To check for ILC assignments the validator uses the helper `get_ilc_assignment(state, epoch, validator_index)` where `epoch <= next_epoch`.
A validator may be a member of the new Inclusion List Committee (ILC) for a given slot. To check for ILC assignments the validator uses the helper `get_ilc_assignment(state, epoch, validator_index)` where `epoch <= next_epoch`.

ILC selection is only stable within the context of the current and next epoch.

Expand All @@ -61,7 +61,7 @@ def get_ilc_assignment(
epoch: Epoch,
validator_index: ValidatorIndex) -> Optional[Slot]:
"""
Returns the slot during the requested epoch in which the validator with index `validator_index`
Returns the slot during the requested epoch in which the validator with index ``validator_index``
is a member of the ILC. Returns None if no assignment is found.
"""
next_epoch = Epoch(get_current_epoch(state) + 1)
Expand All @@ -82,18 +82,18 @@ def get_ilc_assignment(

### Block proposal

Proposers are still expected to propose `SignedBeaconBlock` at the beginning of any slot during which `is_proposer(state, validator_index)` returns `true`. The mechanism to prepare this beacon block and related sidecars differs from previous forks as follows:
Proposers are still expected to propose `SignedBeaconBlock` at the beginning of any slot during which `is_proposer(state, validator_index)` returns true. The mechanism to prepare this beacon block and related sidecars differs from previous forks as follows:

#### Update execution client with inclusion lists

The proposer should call `engine_updateInclusionListV1` at `PROPOSER_INCLUSION_LIST_CUT_OFF` into the slot with the list of the inclusion lists that gathered since `inclusion_list_CUT_OFF`
The proposer should call `engine_updateInclusionListV1` at `PROPOSER_INCLUSION_LIST_CUT_OFF` into the slot with the list of the inclusion lists that gathered since `inclusion_list_CUT_OFF`.


## New inclusion list committee duty

Some validators are selected to submit signed inclusion list. Validators should call `get_ilc_assignment` at the beginning of an epoch to be prepared to submit their inclusion list during the next epoch.

A validator should create and broadcast the `signed_inclusion_list` to the global `inclusion_list` subnet by the `inclusion_list_CUT_OFF` in the slot, unless a block for the current slot has been processed and is the head of the chain and broadcast to the network.
A validator should create and broadcast the `signed_inclusion_list` to the global `inclusion_list` subnet by `PROPOSER_INCLUSION_LIST_CUT_OFF` seconds into the slot, unless a block for the current slot has been processed and is the head of the chain and broadcast to the network.

#### Constructing a signed inclusion list

Expand Down

0 comments on commit e9fdfc6

Please sign in to comment.