Skip to content

Commit 3b5735b

Browse files
committed
updates to api
1 parent 37c8e87 commit 3b5735b

8 files changed

Lines changed: 66 additions & 58 deletions

File tree

apis/builder/execution_payload_bid.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ post:
1010
- The hash of the execution layer block the proposer will build on.
1111
- The root of the beacon block the proposer will build on.
1212
- The index of the proposer.
13-
- A signed bid request auth using the builder's on-chain index to authenticate the request.
13+
- A signed request auth containing the builder's public key and slot to authenticate the request.
1414
1515
The builder responds with a 200 response containing an execution payload bid if it can provide one.
1616

apis/builder/preferences.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,15 @@ post:
2121
- Builder
2222
requestBody:
2323
description: |
24-
Signed per-builder preferences, along with signed request authentication.
24+
Signed per-builder preferences.
2525
required: true
2626
content:
2727
application/json:
2828
schema:
2929
type: object
3030
required:
31-
- signed_request_auth
3231
- preferences
3332
properties:
34-
signed_request_auth:
35-
$ref: "../../builder-oapi.yaml#/components/schemas/Gloas.SignedRequestAuth"
3633
preferences:
3734
type: array
3835
items:
@@ -41,7 +38,7 @@ post:
4138
$ref: "../../builder-oapi.yaml#/components/examples/Gloas.SignedBuilderPreferences"
4239
application/octet-stream:
4340
schema:
44-
description: "SSZ serialized `Container[SignedRequestAuth, List[SignedBuilderPreferences, VALIDATOR_REGISTRY_LIMIT]]` bytes. Use content type header to indicate that SSZ data is contained in the request body."
41+
description: "SSZ serialized `List[SignedBuilderPreferences, VALIDATOR_REGISTRY_LIMIT]` bytes. Use content type header to indicate that SSZ data is contained in the request body."
4542
responses:
4643
"200":
4744
description: Success response.

examples/gloas/signed_builder_preferences.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
{
22
"value": {
3-
"signed_request_auth": {
4-
"message": {
5-
"builder_index": "0x2a"
6-
},
7-
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
8-
},
93
"preferences": [
104
{
115
"message": {
126
"builder_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
7+
"slot": "32",
138
"max_trusted_bid": "1000000000000000000"
149
},
1510
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"

examples/gloas/signed_request_auth.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"value": {
33
"message": {
4-
"builder_index": "0x2a"
4+
"builder_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
5+
"slot": "1"
56
},
67
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
78
}

specs/gloas/builder.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ describes how builders interact with validators through
3131

3232
## Constants
3333

34-
| Name | Value |
35-
| ----------------------------------------- | ------------------ |
34+
| Name | Value |
35+
| ----------------- | ----------- |
3636
| `MAX_TRUSTED_BID` | `2**64 - 1` |
3737

3838
## Containers
@@ -44,6 +44,7 @@ describes how builders interact with validators through
4444
```python
4545
class BuilderPreferences(Container):
4646
builder_pubkey: BLSPubkey
47+
slot: Slot
4748
max_trusted_bid: uint64
4849
```
4950

@@ -62,7 +63,9 @@ class SignedBuilderPreferences(Container):
6263

6364
```python
6465
def verify_builder_preferences_signature(
65-
state: BeaconState, signed_preferences: SignedBuilderPreferences, validator_index: ValidatorIndex
66+
state: BeaconState,
67+
signed_preferences: SignedBuilderPreferences,
68+
validator_index: ValidatorIndex,
6669
) -> bool:
6770
validator = state.validators[validator_index]
6871
pubkey = validator.pubkey
@@ -117,14 +120,14 @@ def is_eligible_for_bid(
117120

118121
Validators send per-builder preferences directly to the builder via the
119122
[`submitBuilderPreferences`][submit-builder-preferences-api] API call. This
120-
allows a proposer to express trust preferences for a specific builder. Currently,
121-
the only preference that is supported is:
123+
allows a proposer to express trust preferences for a specific builder.
124+
Currently, the only preference that is supported is:
122125

123126
- `max_trusted_bid`: Specifies the maximum value (in Gwei) that a proposer is
124127
willing to accept as a trusted execution layer payment from the builder. A
125128
value of `0` indicates that the proposer does not accept any trusted payments
126-
from the builder, requiring all payments to be cryptographically verifiable
127-
on-chain. A value of `MAX_TRUSTED_BID` indicates that the proposer will accept
129+
from the builder, requiring all payments to use the on-chain trustless payments mechanism.
130+
A value of `MAX_TRUSTED_BID` indicates that the proposer will accept
128131
any trusted payment amount from the builder. Proposers may adjust this
129132
parameter based on their level of trust in the builder's reliability and
130133
reputation.
@@ -134,12 +137,14 @@ for.
134137

135138
## Proposer Preferences (Deprecation of Validator Registrations)
136139

137-
*Note*: `ValidatorRegistrationV2` is **deprecated** in favour of
140+
*Note*: `ValidatorRegistrationV1` is **deprecated** in favour of
138141
[`ProposerPreferences`][proposer-preferences] from the consensus specs.
139142

140-
Builders SHOULD subscribe to the [`proposer_preferences`][proposer-preferences-topic]
141-
gossip topic to learn about a validator's general preferences for upcoming
142-
proposal slots. The `ProposerPreferences` message contains:
143+
Builders SHOULD subscribe to the
144+
[`proposer_preferences`][proposer-preferences-topic] gossip topic to learn about
145+
a validator's general preferences. Validators broadcast these messages at the
146+
beginning of each epoch for their proposal slots in the next epoch. The
147+
`ProposerPreferences` message contains:
143148

144149
- `validator_index`: The index of the validator proposing.
145150
- `fee_recipient`: The execution layer address where fees should go.
@@ -177,7 +182,9 @@ def process_builder_preferences(
177182
# (implementation specific check)
178183

179184
# Verify builder preferences signature
180-
assert verify_builder_preferences_signature(state, signed_preferences, validator_index)
185+
assert verify_builder_preferences_signature(
186+
state, signed_preferences, validator_index
187+
)
181188
```
182189

183190
## Constructing a `SignedExecutionPayloadBid`

specs/gloas/validator.md

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Validators request a [`SignedExecutionPayloadBid`][signed-execution-payload-bid]
3333
from the external builder network to put it in their `SignedBeaconBlock`. The
3434
external builder network broadcasts the
3535
[`SignedExecutionPayloadEnvelope`][signed-execution-payload-envelope]
36-
corresponding to the bid to the PTC committee.
36+
corresponding to the included bid to the PTC committee.
3737

3838
## Containers
3939

@@ -46,7 +46,8 @@ that other builders do not DDOS or run replay attacks on the builder.
4646

4747
```python
4848
class RequestAuth(Container):
49-
builder_index: BuilderIndex
49+
builder_pubkey: BLSPubkey
50+
slot: Slot
5051
```
5152

5253
#### `SignedRequestAuth`
@@ -63,43 +64,42 @@ class SignedRequestAuth(Container):
6364

6465
To construct the `RequestAuth`, we need to fill the following information:
6566

66-
- `builder_index`: This is the on-chain index associated with the builder.
67+
- `builder_pubkey`: The BLS public key of the builder the request is intended for.
68+
- `slot`: The slot for which the bid is being requested.
6769

6870
The validator constructs the `SignedRequestAuth` by signing the `RequestAuth`.
6971
It sends the `SignedRequestAuth` in the request body along with the request to
7072
get the bid in the [`getExecutionPayloadBid`][get-execution-payload-bid-api] API
71-
call. It also sends the `SignedRequestAuth` in the
72-
[`submitBuilderPreferences`][submit-builder-preferences-api] to avoid replay
73-
attacks. A builder could send the preferences to another builder and make them do
74-
unnecessary work.
73+
call.
7574

7675
## Proposer Preferences
7776

78-
*Note*: Validator registrations (`ValidatorRegistrationV2`) are **deprecated** in
79-
favour of [`ProposerPreferences`][proposer-preferences] from the consensus specs.
77+
*Note*: Validator registrations (`ValidatorRegistrationV1`) are **deprecated**
78+
in favour of [`ProposerPreferences`][proposer-preferences] from the consensus
79+
specs.
8080

8181
General validator preferences are now communicated via the
8282
[`proposer_preferences`][proposer-preferences-topic] gossip topic defined in the
83-
[Gloas consensus specs][gloas-consensus-specs]. Validators broadcast
84-
[`SignedProposerPreferences`][proposer-preferences] messages at the beginning of
85-
each epoch containing:
83+
[Gloas consensus specs][gloas-consensus-specs]. At the beginning of each epoch,
84+
validators broadcast [`SignedProposerPreferences`][proposer-preferences] messages
85+
for their proposal slots in the next epoch containing:
8686

8787
- `fee_recipient`: An execution layer address where fees for the validator
8888
should go.
8989
- `gas_limit`: The value a validator prefers for the execution block gas limit.
9090
- `validator_index`: The validator's index.
91-
- `proposal_slot`: The slot in which the validator will be proposing. This can be
92-
looked up in `state.proposer_lookahead`.
91+
- `proposal_slot`: The slot in which the validator will be proposing. This can
92+
be looked up in `state.proposer_lookahead`.
9393

9494
Builders SHOULD subscribe to this gossip topic to learn about proposer
9595
preferences for upcoming slots.
9696

9797
## Builder Preferences
9898

9999
For per-builder preferences that cannot be communicated via a global gossip
100-
topic, validators send [`SignedBuilderPreferences`][builder-preferences] directly
101-
to the builder via the [`submitBuilderPreferences`][submit-builder-preferences-api]
102-
API call.
100+
topic, validators send [`SignedBuilderPreferences`][builder-preferences]
101+
directly to the builder via the
102+
[`submitBuilderPreferences`][submit-builder-preferences-api] API call.
103103

104104
### Constructing the `BuilderPreferences`
105105

@@ -108,23 +108,28 @@ To construct the `BuilderPreferences`, the validator client assembles a
108108

109109
- `builder_pubkey`: The BLS public key of the builder that these preferences are
110110
intended for.
111+
- `slot`: The proposal slot of the validator. This can be looked up in
112+
`state.proposer_lookahead`.
111113
- `max_trusted_bid`: The amount (in Gwei) the proposer is willing to accept as a
112114
trusted execution layer payment from the builder.
113115

114116
### Builder Preferences dissemination
115117

116118
Validators send builder preferences to each builder they wish to interact with
117-
for their upcoming proposal slots. Validators run
118-
`create_builder_preferences` at every epoch boundary to create builder
119-
preferences for all the builders they trust.
119+
for their upcoming proposal slots. Validators run `create_builder_preferences`
120+
in the epoch prior to the epoch in which the validator will become a proposer,
121+
using the `proposer_lookahead` in the beacon state to determine their proposal
122+
slots.
120123

121124
```python
122125
def create_builder_preferences(
123126
builder_pubkey: BLSPubkey,
127+
slot: Slot,
124128
max_trusted_bid: uint64,
125129
) -> BuilderPreferences:
126130
return BuilderPreferences(
127131
builder_pubkey=builder_pubkey,
132+
slot=slot,
128133
max_trusted_bid=max_trusted_bid,
129134
)
130135
```
@@ -175,9 +180,9 @@ builder pays the validator via execution layer payments, we require that the
175180
bid's fee recipient matches the validators expected fee recipient and not the
176181
builder's fee recipient.
177182

178-
To express per-builder preferences we need validators to remember which
179-
builder preferences they have sent to each builder, so that they can validate
180-
whether the bid conforms to the preferences expressed by the validators.
183+
To express per-builder preferences we need validators to remember which builder
184+
preferences they have sent to each builder, so that they can validate whether
185+
the bid conforms to the preferences expressed by the validators.
181186

182187
## Block proposal
183188

@@ -200,10 +205,8 @@ block on top of a beacon `state` must take the following actions:
200205
3. The proposer returns the `SignedBeaconBlock` back to the upstream block
201206
building software via [`submitSignedBeaconBlock`][submit-signed-beacon-block]
202207
API call.
203-
4. The upstream block building software constructs the
204-
[`SignedExecutionPayloadEnvelope`][signed-execution-payload-envelope]
205-
corresponding to the
206-
[`SignedExecutionPayloadBid`][signed-execution-payload-bid] and broadcasts it
208+
4. The upstream block building software constructs the corresponding
209+
[`SignedExecutionPayloadEnvelope`][signed-execution-payload-envelope] and broadcasts it
207210
to the PTC committee.
208211

209212
## Liveness failsafe

types/gloas/preferences.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ Gloas:
22
BuilderPreferences:
33
type: object
44
description: "Per-builder preferences that a validator can express to a specific builder."
5-
required: [builder_pubkey, max_trusted_bid]
5+
required: [builder_pubkey, slot, max_trusted_bid]
66
properties:
77
builder_pubkey:
88
$ref: "../../beacon-apis/types/primitive.yaml#/Pubkey"
99
description: "The BLS public key of the builder that these preferences are intended for."
10+
slot:
11+
$ref: "../../beacon-apis/types/primitive.yaml#/Uint64"
12+
description: "The proposal slot of the validator."
1013
max_trusted_bid:
1114
$ref: "../../beacon-apis/types/primitive.yaml#/Uint64"
1215
description: "Indicates the maximum amount that a proposer is willing to accept as a trusted payment amount from the builder."

types/gloas/request_auth.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
Gloas:
22
RequestAuth:
33
type: object
4-
required: [builder_index]
4+
required: [builder_pubkey, slot]
55
properties:
6-
builder_index:
7-
type: string
8-
pattern: "^0x[a-fA-F0-9]{1,16}$"
9-
description: "The on-chain index associated with the builder, represented as a hex string."
6+
builder_pubkey:
7+
$ref: "../../beacon-apis/types/primitive.yaml#/Pubkey"
8+
description: "The BLS public key of the builder the request is intended for."
9+
slot:
10+
$ref: "../../beacon-apis/types/primitive.yaml#/Uint64"
11+
description: "The slot for which the bid is being requested."
1012
SignedRequestAuth:
1113
type: object
1214
required: [message, signature]

0 commit comments

Comments
 (0)