eth2.0-specs/specs/capella/fork-choice.md

1.6 KiB

Capella -- Fork Choice

Notice: This document is a work-in-progress for researchers and implementers.

Table of contents

Introduction

This is the modification of the fork choice according to the Capella upgrade.

Unless stated explicitly, all prior functionality from Bellatrix is inherited.

Custom types

Protocols

ExecutionEngine

Note: The notify_forkchoice_updated function is modified in the ExecutionEngine protocol at the Capella upgrade.

notify_forkchoice_updated

The only change made is to the PayloadAttributes container through the addition of withdrawals. Otherwise, notify_forkchoice_updated inherits all prior functionality.

def notify_forkchoice_updated(self: ExecutionEngine,
                              head_block_hash: Hash32,
                              safe_block_hash: Hash32,
                              finalized_block_hash: Hash32,
                              payload_attributes: Optional[PayloadAttributes]) -> Optional[PayloadId]:
    ...

Helpers

Extended PayloadAttributes

PayloadAttributes is extended with the withdrawals field.

@dataclass
class PayloadAttributes(object):
    timestamp: uint64
    prev_randao: Bytes32
    suggested_fee_recipient: ExecutionAddress
    withdrawals: Sequence[Withdrawal]  # new in Capella