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

EIP-7547: Inclusion Lists #3617

Open
wants to merge 38 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7d7398d
add full capella pyspec
michaelneuder May 21, 2023
07e713c
dev push for ils changes
michaelneuder Jan 22, 2024
eebbd6e
deneb update
michaelneuder Jan 22, 2024
fb3d2a3
Merge branch 'dev' of https://github.com/ethereum/consensus-specs int…
michaelneuder Mar 7, 2024
ffc3c76
remove old stuff
michaelneuder Mar 7, 2024
01b2f64
init commit
michaelneuder Mar 7, 2024
6984a1a
beacon chain
michaelneuder Mar 7, 2024
6c0c56a
fixes
michaelneuder Mar 7, 2024
42c122d
simplify
michaelneuder Mar 8, 2024
c7b1fd1
doctoc .
michaelneuder Mar 8, 2024
2e1b630
simplify
michaelneuder Mar 8, 2024
8114991
naming issue
michaelneuder Mar 8, 2024
d04d802
Update specs/_features/eip7547/p2p-networking.md
michaelneuder Mar 12, 2024
6599c32
Update specs/_features/eip7547/p2p-networking.md
michaelneuder Mar 12, 2024
2efaf1a
Update specs/_features/eip7547/p2p-networking.md
michaelneuder Mar 12, 2024
a11886c
Update specs/_features/eip7547/p2p-networking.md
michaelneuder Mar 12, 2024
d8d45bb
Update specs/_features/eip7547/p2p-networking.md
michaelneuder Mar 12, 2024
8970f6b
validator tweaks
michaelneuder Mar 12, 2024
d25b5d6
validate the inclusion list on_block
michaelneuder Mar 12, 2024
38f74d3
fix newline
michaelneuder Mar 12, 2024
90cf263
fix newline
michaelneuder Mar 12, 2024
7cb01ab
s/143/256
michaelneuder Mar 12, 2024
6dc2894
Make linter happy
hwwhww Mar 13, 2024
dcb206f
fix typo
hwwhww Mar 13, 2024
335b6b5
beacon-chain.md updates
michaelneuder Mar 18, 2024
995c049
beacon-chain.md updates
michaelneuder Mar 18, 2024
75aa52c
fork-choice.md
michaelneuder Mar 18, 2024
97cc84c
fork-choice.md
michaelneuder Mar 18, 2024
f46dd05
p2p-networking.md
michaelneuder Mar 18, 2024
0059893
validator.md
michaelneuder Mar 18, 2024
f0a13ab
small fixes
michaelneuder Mar 18, 2024
7545154
terence responses
michaelneuder Mar 19, 2024
c00b2d8
verify signature check
michaelneuder Mar 19, 2024
c82960d
signed summary in EL block
michaelneuder Mar 19, 2024
4d54445
fc changes
michaelneuder Mar 19, 2024
920fab1
keying on parent_hash too
michaelneuder Mar 19, 2024
086d20b
tweaks
michaelneuder Mar 21, 2024
37ca0c9
fork choice filter
michaelneuder Mar 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
57 changes: 56 additions & 1 deletion specs/_features/eip7547/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [Introduction](#introduction)
- [Helpers](#helpers)
- [New `is_inclusion_list_available`](#new-is_inclusion_list_available)
- [Modified `filter_block_tree`](#modified-filter_block_tree)
- [New fork-choice handlers](#new-fork-choice-handlers)
- [New `on_inclusion_list`](#new-on_inclusion_list)

Expand All @@ -23,13 +24,67 @@ This is the modification of the fork choice accompanying EIP-7547.
### New `is_inclusion_list_available`

```python
def is_inclusion_list_available(self: ExecutionEngine, new_payload_request: NewPayloadRequest) -> bool:
def is_inclusion_list_available(block_root: Root) -> bool:
"""
Return ``True`` if and only if the payload has a corresponding inclusion list.
"""
...
```

### Modified `filter_block_tree`

Add filter for if the inclusion list is available.

```python
def filter_block_tree(store: Store, block_root: Root, blocks: Dict[Root, BeaconBlock]) -> bool:
block = store.blocks[block_root]
# [Modified in EIP-7547] Check that IL is available when considering heads.
children = [
root for (root, block) in blocks.items()
if block.parent_root == block_root
and is_inclusion_list_available(root)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work since you may have grand children that are valid

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make this work by doing the following:

  • as you add something to forkchoice, include an "IL available bool", store this bool along with the block
  • if the bool is true, iterate back to the justified root flipping all to true
  • is_inclusion_list_available here just checks this bool is true

Effectively tracking the latest seen block with an available IL which I think is what we want

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't really work because we may have to reorg back to a head for witch we haven't seen an IL. Without reconstructing it we always rely on external sources

Copy link
Contributor

@potuz potuz Mar 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make this work by doing the following:

  • as you add something to forkchoice, include an "IL available bool", store this bool along with the block
  • if the bool is true, iterate back to the justified root flipping all to true
  • is_inclusion_list_available here just checks this bool is true

Effectively tracking the latest seen block with an available IL which I think is what we want

Not sure if this was after or before the Discord discussion, but just in case and to leave it documented, this doesn't work either since you may be turning for true a node where no one has seen the IL except the child's builder. In this case this node should never be taken for head or the EL should be able to reconstruct the IL.

]

# If any children branches contain expected finalized/justified checkpoints,
# add to filtered block-tree and signal viability to parent.
if any(children):
filter_block_tree_result = [filter_block_tree(store, child, blocks) for child in children]
if any(filter_block_tree_result):
blocks[block_root] = block
return True
return False

current_epoch = get_current_store_epoch(store)
voting_source = get_voting_source(store, block_root)

# The voting source should be either at the same height as the store's justified checkpoint or
# not more than two epochs ago
correct_justified = (
store.justified_checkpoint.epoch == GENESIS_EPOCH
or voting_source.epoch == store.justified_checkpoint.epoch
or voting_source.epoch + 2 >= current_epoch
)

finalized_checkpoint_block = get_checkpoint_block(
store,
block_root,
store.finalized_checkpoint.epoch,
)

correct_finalized = (
store.finalized_checkpoint.epoch == GENESIS_EPOCH
or store.finalized_checkpoint.root == finalized_checkpoint_block
)

# If expected finalized/justified, add to viable block-tree and signal viability to parent.
if correct_justified and correct_finalized:
blocks[block_root] = block
return True

# Otherwise, branch not viable
return False
```

## New fork-choice handlers

### New `on_inclusion_list`
Expand Down