Skip to content

Commit 1fe1fa7

Browse files
committed
Add broadcast_validation to block publishing
1 parent 435c140 commit 1fe1fa7

File tree

4 files changed

+48
-3
lines changed

4 files changed

+48
-3
lines changed

apis/beacon/blocks/blinded_blocks.yaml

+20-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,27 @@ post:
1313
successful. The beacon node is expected to integrate the new block into its state, and
1414
therefore validate the block internally, however blocks which fail the validation are still
1515
broadcast but a different status code is returned (202). Pre-Bellatrix, this endpoint will accept
16-
a `SignedBeaconBlock`.
16+
a `SignedBeaconBlock`. The broadcast behaviour may be adjusted via the `broadcast_validation`
17+
query parameter.
1718
parameters:
19+
- name: broadcast_validation
20+
in: query
21+
required: false
22+
description: |
23+
Level of validation that must be applied to a block before it is broadcast.
24+
25+
Possible values:
26+
- **`gossip`** (default): lightweight gossip checks only
27+
- **`consensus`**: full consensus checks, including validation of all signatures and
28+
blocks fields _except_ for the execution payload transactions.
29+
30+
If the block fails the requested level of a validation a 400 status MUST be returned
31+
immediately and the block MUST NOT be broadcast to the network.
32+
33+
If validation succeeds, the block must still be fully verified before it is
34+
incorporated into the state and a 20x status is returned to the caller.
35+
schema:
36+
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/BroadcastValidation'
1837
- in: header
1938
schema:
2039
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion'

apis/beacon/blocks/blocks.yaml

+21-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,30 @@ post:
88
Instructs the beacon node to broadcast a newly signed beacon block to the beacon network,
99
to be included in the beacon chain. A success response (20x) indicates that the block
1010
passed gossip validation and was successfully broadcast onto the network.
11-
The beacon node is also expected to integrate the block into state, but may broadcast it
11+
The beacon node is also expected to integrate the block into the state, but may broadcast it
1212
before doing so, so as to aid timely delivery of the block. Should the block fail full
1313
validation, a separate success response code (202) is used to indicate that the block was
14-
successfully broadcast but failed integration.
14+
successfully broadcast but failed integration. The broadcast behaviour may be adjusted via the
15+
`broadcast_validation` query parameter.
1516
parameters:
17+
- name: broadcast_validation
18+
in: query
19+
required: false
20+
description: |
21+
Level of validation that must be applied to a block before it is broadcast.
22+
23+
Possible values:
24+
- **`gossip`** (default): lightweight gossip checks only
25+
- **`consensus`**: full consensus checks, including validation of all signatures and
26+
blocks fields _except_ for the execution payload transactions.
27+
28+
If the block fails the requested level of a validation a 400 status MUST be returned
29+
immediately and the block MUST NOT be broadcast to the network.
30+
31+
If validation succeeds, the block must still be fully verified before it is
32+
incorporated into the state and a 20x status is returned to the caller.
33+
schema:
34+
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/BroadcastValidation'
1635
- in: header
1736
schema:
1837
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion'

beacon-node-oapi.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ components:
207207
$ref: './types/state.yaml#/BeaconState'
208208
BeaconBlock:
209209
$ref: './types/block.yaml#/BeaconBlock'
210+
BroadcastValidation:
211+
$ref: './types/api.yaml#/BroadcastValidation'
210212
DepositSnapshotResponse:
211213
$ref: './types/api.yaml#/DepositSnapshotResponse'
212214
SignedBeaconBlock:

types/api.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,8 @@ Committee:
8181
description: "List of validator indices assigned to this committee"
8282
items:
8383
$ref: './primitive.yaml#/Uint64'
84+
85+
BroadcastValidation:
86+
description: Level of validation that must be applied to a block before it is broadcast.
87+
type: string
88+
enum: [gossip, consensus]

0 commit comments

Comments
 (0)