Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions packages/beacon-node/src/chain/prepareNextSlot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,18 @@ export class PrepareNextSlotScheduler {

this.computeStateHashTreeRoot(updatedPrepareState, isEpochTransition);

// If emitPayloadAttributes is true emit a SSE payloadAttributes event
// If emitPayloadAttributes is true emit a SSE payloadAttributes event for
// every slot. Without the flag, only emit the event if we are proposing in the next slot.
if (
this.chain.opts.emitPayloadAttributes === true &&
(feeRecipient || this.chain.opts.emitPayloadAttributes === true) &&
this.chain.emitter.listenerCount(routes.events.EventType.payloadAttributes)
) {
const data = getPayloadAttributesForSSE(fork as ForkPostBellatrix, this.chain, {
prepareState: updatedPrepareState,
prepareSlot,
parentBlockRoot: fromHex(headRoot),
parentBlockRoot: fromHex(updatedHead.blockRoot),
parentBlockHash,
// The likely consumers of this API are builders and will anyway ignore the
// feeRecipient, so just pass zero hash for now till a real use case arises
feeRecipient: "0x0000000000000000000000000000000000000000000000000000000000000000",
feeRecipient: feeRecipient ?? "0x0000000000000000000000000000000000000000",
Comment thread
nflaig marked this conversation as resolved.
});
this.chain.emitter.emit(routes.events.EventType.payloadAttributes, {data, version: fork});
}
Expand Down
Loading