Gloas -- Optimistic Sync¶
Note: This document is a work-in-progress for researchers and implementers.
Introduction¶
This document extends the
Bellatrix optimistic sync specification for
Gloas. A beacon block no longer carries its execution payload: it commits to the
payload it builds on through bid.parent_block_hash, and its own payload
arrives separately in an ExecutionPayloadEnvelope. A block therefore has an
empty and a full fork choice node, and a block root no longer identifies a
payload. Optimistic status is tracked per payload.
Helpers¶
Modified OptimisticStore¶
Let optimistic_payloads: set[Hash32] be the set of block_hash for all
optimistically imported execution payloads which have only received a
NOT_VALIDATED designation from an execution engine.
Payloads of pre-Gloas blocks are tracked by body.execution_payload.block_hash.
Modified is_optimistic¶
Note: is_optimistic is modified to take a ForkChoiceNode. A full node
references the block's own payload, a pending or empty node references the
payload the block builds on.
Modified latest_verified_ancestor¶
Let a beacon node be an optimistic node if
is_optimistic(opt_store, get_head(store)) is True or if INVALIDATED
payloads leave the block tree without viable (with respect to FFG) branches.
Mechanisms¶
How to optimistically import payloads¶
Blocks are imported without consulting an execution engine. The optimistically imported unit is the execution payload envelope. To optimistically import an envelope:
verify_and_notify_new_payloadMUST returnTrueif the execution engine returnsNOT_VALIDATEDorVALID. AnINVALIDATEDresponse MUST returnFalse.- The payload the block builds on,
bid.parent_block_hash, MUST NOT beINVALIDATED.
On an execution engine error, the envelope MUST NOT be imported or applied to fork choice and MAY be queued for later processing.
The consensus engine MUST track which payloads returned NOT_VALIDATED and
which returned VALID for subsequent processing, and MUST be able to
retrospectively modify the status of NOT_VALIDATED payloads to VALID or
INVALIDATED based upon responses from an execution engine.
When a payload transitions from NOT_VALIDATED -> VALID, all ancestor
payloads MUST also transition from NOT_VALIDATED -> VALID.
When a payload transitions from NOT_VALIDATED -> INVALIDATED, all
descendant payloads MUST also transition from NOT_VALIDATED ->
INVALIDATED. The full node of each such payload and every node descending
from it MUST NOT be viable for head and its weight MUST NOT be applied to any
ancestor. A block's empty node is not affected by the invalidation of its own
payload.
When a payload transitions from the NOT_VALIDATED state, it is removed from
the set of opt_store.optimistic_payloads.
How to apply latestValidHash when payload status is INVALID¶
The Bellatrix rules apply to the payload chain, linked by parent_hash, with
"block" read as "payload": invalidPayload is the child of the payload with
block_hash == latestValidHash in the chain containing the payload in question,
or the payload in question itself if latestValidHash is null or unknown.
invalidPayload and all its descendant payloads MUST be transitioned from
NOT_VALIDATED to INVALIDATED.
However, an INVALIDATED response with a null latestValidHash to an
envelope being imported only rejects that envelope, as the verdict may stem from
the versioned hashes or execution requests of its bid.
Checkpoint Sync (Weak Subjectivity Sync)¶
A consensus engine MAY assume that the payload referenced by latest_block_hash
of a state used as an anchor for checkpoint sync is VALID without necessarily
providing that payload to an execution engine.
Validator assignments¶
Payload attestations¶
An optimistic validator SHOULD still produce payload attestations (i.e., sign
across the DOMAIN_PTC_ATTESTER domain), as they attest to the timeliness and
data availability of a payload and not its validity.
Builder duties¶
Let only a builder on an optimistic node be an optimistic builder.
An optimistic builder MUST NOT submit execution payload bids (i.e., sign an
ExecutionPayloadBid across the DOMAIN_BEACON_BUILDER domain).
Ethereum Beacon APIs¶
Consensus engines which provide an implementation of the
Ethereum Beacon APIs must set
execution_optimistic to is_optimistic(opt_store, node) for the fork choice
node a request resolves to. The Beacon APIs define which node each request
resolves to.