Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use correct fork digest when broadcasting blob sidecars and sync msgs #6440

Merged
merged 1 commit into from
Jul 23, 2024
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
17 changes: 11 additions & 6 deletions beacon_chain/networking/eth2_network.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2694,23 +2694,28 @@ proc broadcastBlobSidecar*(
node: Eth2Node, subnet_id: BlobId, blob: deneb.BlobSidecar):
Future[SendResult] {.async: (raises: [CancelledError], raw: true).} =
let
forkPrefix = node.forkDigestAtEpoch(node.getWallEpoch)
topic = getBlobSidecarTopic(forkPrefix, subnet_id)
contextEpoch = blob.signed_block_header.message.slot.epoch
topic = getBlobSidecarTopic(
node.forkDigestAtEpoch(contextEpoch), subnet_id)
node.broadcast(topic, blob)

proc broadcastSyncCommitteeMessage*(
node: Eth2Node, msg: SyncCommitteeMessage,
subcommitteeIdx: SyncSubcommitteeIndex):
Future[SendResult] {.async: (raises: [CancelledError], raw: true).} =
let topic = getSyncCommitteeTopic(
node.forkDigestAtEpoch(node.getWallEpoch), subcommitteeIdx)
let
contextEpoch = msg.slot.epoch
topic = getSyncCommitteeTopic(
node.forkDigestAtEpoch(contextEpoch), subcommitteeIdx)
node.broadcast(topic, msg)

proc broadcastSignedContributionAndProof*(
node: Eth2Node, msg: SignedContributionAndProof):
Future[SendResult] {.async: (raises: [CancelledError], raw: true).} =
let topic = getSyncCommitteeContributionAndProofTopic(
node.forkDigestAtEpoch(node.getWallEpoch))
let
contextEpoch = msg.message.contribution.slot.epoch
topic = getSyncCommitteeContributionAndProofTopic(
node.forkDigestAtEpoch(contextEpoch))
node.broadcast(topic, msg)

proc broadcastLightClientFinalityUpdate*(
Expand Down
Loading