Skip to content

Commit

Permalink
SSE for payload attributes (#305)
Browse files Browse the repository at this point in the history
* SSE for payload attributes

* Tweak encoding wording

* Add comment about beacon node config
  • Loading branch information
michaelsproul authored Feb 28, 2023
1 parent 8fc2729 commit 1d8bb1a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions apis/eventstream/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ get:
- contribution_and_proof
- light_client_finality_update
- light_client_optimistic_update
- payload_attributes
responses:
"200":
description: Opened SSE stream.
Expand Down Expand Up @@ -91,6 +92,36 @@ get:
value: |
event: light_client_optimistic_update
data: {"version":"phase0", "data": {"attested_header": {"beacon": {"slot":"1", "proposer_index":"1", "parent_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}, "sync_aggregate": {"sync_committee_bits":"0x01", "sync_committee_signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"}, "signature_slot":"1"}}
payload_attributes:
description: |
The node has computed new payload attributes for execution payload building.
This event gives block builders and relays sufficient information to construct or
verify a block at `proposal_slot`. The meanings of the fields are:
- `version`: the identifier of the beacon hard fork at `proposal_slot`, e.g.
`"bellatrix"`, `"capella"`.
- `proposal_slot`: the slot at which a block using these payload attributes may be
built.
- `parent_block_root`: the beacon block root of the parent block to be built upon.
- `parent_block_number`: the execution block number of the parent block.
- `parent_block_hash`: the execution block hash of the parent block.
- `proposer_index`: the validator index of the proposer at `proposal_slot` on
the chain identified by `parent_block_root`.
- `payload_attributes`: beacon API encoding of `PayloadAttributesV<N>` as
defined by the `execution-apis` specification. The version `N` must match the
payload attributes for the hard fork matching `version`.
The beacon API encoded object must have equivalent fields to its counterpart in
`execution-apis` with two differences: 1) `snake_case` identifiers must be used
rather than `camelCase`; 2) integers must be encoded as quoted decimals rather
than big-endian hex.
The frequency at which this event is sent may depend on beacon node configuration.
The fee recipient may also be set via beacon node config, but should likely be
ignored by block builders and most other API consumers.
value: |
event: payload_attributes
data: {"version": "capella", "data": {"proposer_index": "123", "proposal_slot": "10", "proposal_block_number": "9", "parent_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "parent_block_hash": "0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "payload_attributes": {"timestamp": "123456", "prev_randao": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "suggested_fee_recipient": "0x0000000000000000000000000000000000000000", "withdrawals": [{"index": "5", "validator_index": "10", "address": "0x0000000000000000000000000000000000000000", "amount": "15640"}]}}},
"400":
description: "The topics supplied could not be parsed"
content:
Expand Down

0 comments on commit 1d8bb1a

Please sign in to comment.