Skip to content

Commit eb06acf

Browse files
authored
Clean up Gloas specs (part 3) (#4694)
This is an extension of the following PR: * #4693 This PR focusses on the `builder.md` specifications. * I didn't feel that "attributions" was a very good word for what builders do. * I've changed this to "activities" which I don't exactly love either. * Open to alternatives here. * I tried to simplify some paragraphs. Less words the better. * Use `engine_getPayloadV5` (new in fulu) instead of `engine_getPayloadV4`. * Lots of other little improvements 🙂
1 parent 61cf32d commit eb06acf

File tree

2 files changed

+75
-73
lines changed

2 files changed

+75
-73
lines changed

specs/gloas/beacon-chain.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -656,10 +656,10 @@ out-of-range list access) are considered invalid. State transitions that cause a
656656

657657
The post-state corresponding to a pre-state `state` and a signed execution
658658
payload envelope `signed_envelope` is defined as
659-
`process_execution_payload(state, signed_envelope)`. State transitions that
660-
trigger an unhandled exception (e.g. a failed `assert` or an out-of-range list
661-
access) are considered invalid. State transitions that cause an `uint64`
662-
overflow or underflow are also considered invalid.
659+
`process_execution_payload(state, signed_envelope, execution_engine)`. State
660+
transitions that trigger an unhandled exception (e.g. a failed `assert` or an
661+
out-of-range list access) are considered invalid. State transitions that cause
662+
an `uint64` overflow or underflow are also considered invalid.
663663

664664
### Modified `process_slot`
665665

specs/gloas/builder.md

Lines changed: 71 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
- [Process deposit](#process-deposit)
1212
- [Builder index](#builder-index)
1313
- [Activation](#activation)
14-
- [Builders attributions](#builders-attributions)
15-
- [Constructing the payload bid](#constructing-the-payload-bid)
14+
- [Builder activities](#builder-activities)
15+
- [Constructing the `SignedExecutionPayloadBid`](#constructing-the-signedexecutionpayloadbid)
1616
- [Constructing the `DataColumnSidecar`s](#constructing-the-datacolumnsidecars)
1717
- [Modified `get_data_column_sidecars`](#modified-get_data_column_sidecars)
1818
- [Modified `get_data_column_sidecars_from_block`](#modified-get_data_column_sidecars_from_block)
19-
- [Constructing the execution payload envelope](#constructing-the-execution-payload-envelope)
19+
- [Constructing the `SignedExecutionPayloadEnvelope`](#constructing-the-signedexecutionpayloadenvelope)
2020
- [Honest payload withheld messages](#honest-payload-withheld-messages)
2121

2222
<!-- mdformat-toc end -->
@@ -26,41 +26,38 @@
2626
This is an accompanying document which describes the expected actions of a
2727
"builder" participating in the Ethereum proof-of-stake protocol.
2828

29-
With the Gloas fork, the protocol includes new staked participants of the
30-
protocol called *Builders*. While Builders are a subset of the validator set,
31-
they have extra attributions that are optional. Validators may opt to not be
32-
builders and as such we collect the set of guidelines for those validators that
33-
want to act as builders in this document.
29+
With the Gloas fork, the protocol introduces a new type of validator called a
30+
*builder*. Builders have the option to produce execution payloads by submitting
31+
bids. This document is a collection of guidelines for builders.
3432

3533
## Becoming a builder
3634

3735
### Builder withdrawal credentials
3836

39-
The `withdrawal_credentials` field for builders has a specific format that
40-
identifies them as registered builders in the network. Builders must use the
41-
`BUILDER_WITHDRAWAL_PREFIX` to participate in the Gloas mechanism.
37+
The `withdrawal_credentials` field determines whether a validator is registered
38+
as a builder on the network. To be recognized as a builder, a validator’s
39+
`withdrawal_credentials` must use the `BUILDER_WITHDRAWAL_PREFIX`. This prefix
40+
distinguishes builders from other validator types.
4241

43-
The `withdrawal_credentials` field must be such that:
42+
The `withdrawal_credentials` field must be:
4443

45-
- `withdrawal_credentials[:1] == BUILDER_WITHDRAWAL_PREFIX` (i.e., `0x03`)
44+
- `withdrawal_credentials[:1] == BUILDER_WITHDRAWAL_PREFIX` (`0x03`)
4645
- `withdrawal_credentials[1:12] == b'\x00' * 11`
4746
- `withdrawal_credentials[12:] == builder_execution_address`
4847

49-
Where `builder_execution_address` is a 20-byte execution layer address that will
50-
receive:
51-
52-
- Withdrawal rewards (similar to `ETH1_ADDRESS_WITHDRAWAL_PREFIX`)
53-
- Compounding rewards (builders inherit compounding functionality)
48+
Where `builder_execution_address` is an execution layer address that will
49+
receive withdrawals.
5450

5551
### Submit deposit
5652

5753
Builders follow the same deposit process as regular validators, but with the
5854
builder-specific withdrawal credentials. The deposit must include:
5955

60-
- `pubkey`: The builder's BLS public key
61-
- `withdrawal_credentials`: Set with `BUILDER_WITHDRAWAL_PREFIX` (`0x03`)
62-
- `amount`: At least `MIN_DEPOSIT_AMOUNT`
63-
- `signature`: BLS signature over the deposit data
56+
- `pubkey`: The builder's BLS public key.
57+
- `withdrawal_credentials`: With the `BUILDER_WITHDRAWAL_PREFIX` (`0x03`)
58+
prefix.
59+
- `amount`: At least `MIN_DEPOSIT_AMOUNT` gwei.
60+
- `signature`: BLS signature over the deposit data.
6461

6562
### Process deposit
6663

@@ -75,54 +72,55 @@ the builder in execution payload bids and envelopes.
7572

7673
### Activation
7774

78-
Builder activation follows the same process as validator activation.
75+
Builder activation follows the same process as other validators. Note that the
76+
validator must have a balance of at least `MIN_ACTIVATION_BALANCE` to become
77+
eligible for activation.
7978

80-
## Builders attributions
79+
## Builder activities
8180

81+
Builders have two optional activities: submitting bids and submitting payloads.
8282
Builders can submit bids to produce execution payloads. They can broadcast these
83-
bids in the form of `SignedExecutionPayloadBid` objects, these objects encode a
83+
bids in the form of `SignedExecutionPayloadBid` objects. These objects encode a
8484
commitment to reveal an execution payload in exchange for a payment. When their
8585
bids are chosen by the corresponding proposer, builders are expected to
8686
broadcast an accompanying `SignedExecutionPayloadEnvelope` object honoring the
87-
commitment.
88-
89-
Thus, builders tasks are divided in two, submitting bids, and submitting
90-
payloads.
87+
commitment. If a proposer accepts a builder's bid, the builder will pay the
88+
proposer what it promised whether it submits the payload or not.
9189

92-
### Constructing the payload bid
90+
### Constructing the `SignedExecutionPayloadBid`
9391

9492
Builders can broadcast a payload bid for the current or the next slot's proposer
9593
to include. They produce a `SignedExecutionPayloadBid` as follows.
9694

9795
01. Set `bid.parent_block_hash` to the current head of the execution chain (this
9896
can be obtained from the beacon state as `state.latest_block_hash`).
99-
02. Set `bid.parent_block_root` to be the head of the consensus chain (this can
97+
02. Set `bid.parent_block_root` to be the head of the consensus chain; this can
10098
be obtained from the beacon state as
10199
`hash_tree_root(state.latest_block_header)`. The `parent_block_root` and
102100
`parent_block_hash` must be compatible, in the sense that they both should
103101
come from the same `state` by the method described in this and the previous
104102
point.
105103
03. Construct an execution payload. This can be performed with an external
106-
execution engine with a call to `engine_getPayloadV4`.
104+
execution engine via a call to `engine_getPayloadV5`.
107105
04. Set `bid.block_hash` to be the block hash of the constructed payload, that
108106
is `payload.block_hash`.
109-
05. Set `bid.gas_limit` to be the gas limit of the constructed payload, that is
110-
`payload.gas_limit`.
111-
06. Set `bid.builder_index` to be the validator index of the builder performing
112-
these actions.
113-
07. Set `bid.slot` to be the slot for which this bid is aimed. This slot
114-
**MUST** be either the current slot or the next slot.
115-
08. Set `bid.value` to be the value that the builder will pay the proposer if
116-
the bid is accepted. The builder **MUST** have enough balance to fulfill
117-
this bid and all pending payments.
118-
09. Set `bid.kzg_commitments_root` to be the `hash_tree_root` of the
119-
`blobsbundle.commitments` field returned by `engine_getPayloadV4`.
120-
10. Set `bid.fee_recipient` to be an execution address to receive the payment.
107+
05. Set `bid.fee_recipient` to be an execution address to receive the payment.
121108
This address can be obtained from the proposer directly via a request or can
122109
be set from the withdrawal credentials of the proposer. The burn address can
123110
be used as a fallback.
111+
06. Set `bid.gas_limit` to be the gas limit of the constructed payload, that is
112+
`payload.gas_limit`.
113+
07. Set `bid.builder_index` to be the validator index of the builder performing
114+
these actions.
115+
08. Set `bid.slot` to be the slot for which this bid is aimed. This slot
116+
**MUST** be either the current slot or the next slot.
117+
09. Set `bid.value` to be the value (in gwei) that the builder will pay the
118+
proposer if the bid is accepted. The builder **MUST** have enough excess
119+
balance to fulfill this bid and all pending payments.
120+
10. Set `bid.kzg_commitments_root` to be the `hash_tree_root` of the
121+
`blobsbundle.commitments` field returned by `engine_getPayloadV5`.
124122

125-
After building the `bid`, the builder obtains a `signature` of the bid by using
123+
After building the `bid`, the builder obtains a `signature` of the bid by using:
126124

127125
```python
128126
def get_execution_payload_bid_signature(
@@ -133,23 +131,25 @@ def get_execution_payload_bid_signature(
133131
return bls.Sign(privkey, signing_root)
134132
```
135133

136-
The builder assembles then
134+
Then the builder assembles
137135
`signed_execution_payload_bid = SignedExecutionPayloadBid(message=bid, signature=signature)`
138136
and broadcasts it on the `execution_payload_bid` global gossip topic.
139137

140138
### Constructing the `DataColumnSidecar`s
141139

142140
#### Modified `get_data_column_sidecars`
143141

144-
*Note*: The function `get_data_column_sidecars` is modified to remove
145-
`signed_block_header` and `kzg_commitments_inclusion_proof` parameters as header
146-
and inclusion proof verifications are no longer required in ePBS.
147-
148142
```python
149143
def get_data_column_sidecars(
144+
# [Modified in Gloas:EIP7732]
145+
# Removed `signed_block_header`
146+
# [New in Gloas:EIP7732]
150147
beacon_block_root: Root,
148+
# [New in Gloas:EIP7732]
151149
slot: Slot,
152150
kzg_commitments: List[KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK],
151+
# [Modified in Gloas:EIP7732]
152+
# Removed `kzg_commitments_inclusion_proof`
153153
cells_and_kzg_proofs: Sequence[
154154
Tuple[Vector[Cell, CELLS_PER_EXT_BLOB], Vector[KZGProof, CELLS_PER_EXT_BLOB]]
155155
],
@@ -207,36 +207,38 @@ def get_data_column_sidecars_from_block(
207207
)
208208
```
209209

210-
### Constructing the execution payload envelope
210+
### Constructing the `SignedExecutionPayloadEnvelope`
211211

212212
When the proposer publishes a valid `SignedBeaconBlock` containing a signed
213213
commitment by the builder, the builder is later expected to broadcast the
214214
corresponding `SignedExecutionPayloadEnvelope` that fulfills this commitment.
215215
See below for a special case of an *honestly withheld payload*.
216216

217-
To construct the `execution_payload_envelope` the builder must perform the
218-
following steps. We alias `block` to be the corresponding beacon block and alias
219-
`bid` to be the committed `ExecutionPayloadBid` in
217+
To construct the `ExecutionPayloadEnvelope` the builder must perform the
218+
following steps. We alias `block` to be the corresponding `BeaconBlock` and
219+
alias `bid` to be the committed `ExecutionPayloadBid` in
220220
`block.body.signed_execution_payload_bid.message`.
221221

222-
1. Set the `payload` field to be the `ExecutionPayload` constructed when
223-
creating the corresponding bid. This payload **MUST** have the same block
224-
hash as `bid.block_hash`.
225-
2. Set the `execution_requests` field to be the `ExecutionRequests` associated
222+
1. Set `envelope.payload` to be the `ExecutionPayload` constructed when creating
223+
the corresponding bid. This payload **MUST** have the same block hash as
224+
`envelope.bid.block_hash`.
225+
2. Set `envelope.execution_requests` to be the `ExecutionRequests` associated
226226
with `payload`.
227-
3. Set the `builder_index` field to be the validator index of the builder
227+
3. Set `envelope.builder_index` to be the validator index of the builder
228228
performing these steps. This field **MUST** be `bid.builder_index`.
229-
4. Set `beacon_block_root` to be `hash_tree_root(block)`.
230-
5. Set `slot` to be `block.slot`.
231-
6. Set `blob_kzg_commitments` to be the `commitments` field of the blobs bundle
232-
constructed when constructing the bid. This field **MUST** have a
233-
`hash_tree_root` equal to `bid.blob_kzg_commitments_root`.
229+
4. Set `envelope.beacon_block_root` to be `hash_tree_root(block)`.
230+
5. Set `envelope.slot` to be `block.slot`.
231+
6. Set `envelope.blob_kzg_commitments` to be the `commitments` field of the
232+
blobs bundle constructed when constructing the bid. This field **MUST** have
233+
a `hash_tree_root` equal to `bid.blob_kzg_commitments_root`.
234234

235-
After setting these parameters, the builder should run
236-
`process_execution_payload(state, signed_envelope, verify=False)` and this
237-
function should not trigger an exception.
235+
After setting these parameters, the builder assembles
236+
`signed_execution_payload_envelope = SignedExecutionPayloadEnvelope(message=envelope, signature=BLSSignature())`,
237+
then verify that the envelope is valid with
238+
`process_execution_payload(state, signed_execution_payload_envelope, execution_engine, verify=False)`.
239+
This function should not trigger an exception.
238240

239-
6. Set `state_root` to `hash_tree_root(state)`.
241+
7. Set `envelope.state_root` to `hash_tree_root(state)`.
240242

241243
After preparing the `envelope` the builder should sign the envelope using:
242244

@@ -249,7 +251,7 @@ def get_execution_payload_envelope_signature(
249251
return bls.Sign(privkey, signing_root)
250252
```
251253

252-
The builder assembles then
254+
Then the builder assembles
253255
`signed_execution_payload_envelope = SignedExecutionPayloadEnvelope(message=envelope, signature=signature)`
254256
and broadcasts it on the `execution_payload` global gossip topic.
255257

0 commit comments

Comments
 (0)