Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
28 changes: 17 additions & 11 deletions specs/gloas/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -604,17 +604,23 @@ def update_proposer_boost_root(store: Store, head: Root, root: Root) -> None:
# [Modified in Gloas:EIP7732]
is_timely = store.block_timeliness[root][ATTESTATION_TIMELINESS_INDEX]

# Add proposer score boost if the block is the first timely block
# for this slot, with the same proposer as the canonical chain.
if is_timely and is_first_block:
head_state = copy(store.block_states[head])
slot = get_current_slot(store)
if head_state.slot < slot:
process_slots(head_state, slot)
block = store.blocks[root]
# Only update if the proposer is the same as on the canonical chain
if block.proposer_index == get_beacon_proposer_index(head_state):
store.proposer_boost_root = root
def get_depdendent_root(root: Root) -> Root:
Comment thread
mkalinin marked this conversation as resolved.
Resolved
epoch = get_current_store_epoch(store)
if epoch <= MIN_SEED_LOOKAHEAD:
# Genesis block parent
return Root()

node = ForkChoiceNode(
root=root,
payload_status=PAYLOAD_STATUS_PENDING,
)
dependent_slot = Slot(compute_start_slot_at_epoch(epoch - MIN_SEED_LOOKAHEAD) - 1)
return get_ancestor(store, node, dependent_slot).root

# Add proposer score boost if the block is timely, not conflicting with an
# existing block, with the same dependent root as the canonical chain head.
if is_timely and is_first_block and get_depdendent_root(root) == get_depdendent_root(head):
store.proposer_boost_root = root
```

### Modified `validate_on_attestation`
Expand Down
23 changes: 13 additions & 10 deletions specs/phase0/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -860,17 +860,20 @@ def update_proposer_boost_root(store: Store, head: Root, root: Root) -> None:
is_first_block = store.proposer_boost_root == Root()
is_timely = store.block_timeliness[root]

def get_depdendent_root(root: Root) -> Root:
epoch = get_current_store_epoch(store)
if epoch <= MIN_SEED_LOOKAHEAD:
# Genesis block parent
return Root()

node = ForkChoiceNode(root=root)
dependent_slot = Slot(compute_start_slot_at_epoch(epoch - MIN_SEED_LOOKAHEAD) - 1)
return get_ancestor(store, node, dependent_slot).root

# Add proposer score boost if the block is timely, not conflicting with an
# existing block, with the same the proposer as the canonical chain.
if is_timely and is_first_block:
head_state = copy(store.block_states[head])
slot = get_current_slot(store)
if head_state.slot < slot:
process_slots(head_state, slot)
block = store.blocks[root]
# Only update if the proposer is the same as on the canonical chain
if block.proposer_index == get_beacon_proposer_index(head_state):
store.proposer_boost_root = root
# existing block, with the same dependent root as the canonical chain head.
Comment thread
jihoonsong marked this conversation as resolved.
Resolved
if is_timely and is_first_block and get_depdendent_root(root) == get_depdendent_root(head):
store.proposer_boost_root = root
```

### Handlers
Expand Down