Skip to content

Commit

Permalink
fix: publish blobs sooner than later (#6431)
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech authored Feb 15, 2024
1 parent 83d7d70 commit e0b6e28
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/beacon-node/src/api/impl/beacon/blocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ export function getBeaconBlockApi({
const publishPromises = [
// Send the block, regardless of whether or not it is valid. The API
// specification is very clear that this is the desired behaviour.
//
// i) Publish blobs and block before importing so that network can see them asap
// ii) publish blobs first because
// a) by the times nodes see block, they might decide to pull blobs
// b) they might require more hops to reach recipients in peerDAS kind of setup where
// blobs might need to hop between nodes because of partial subnet subscription
...blobSidecars.map((blobSidecar) => () => network.publishBlobSidecar(blobSidecar)),
() => network.publishBeaconBlock(signedBlock) as Promise<unknown>,
() =>
// there is no rush to persist block since we published it to gossip anyway
Expand All @@ -191,7 +198,6 @@ export function getBeaconBlockApi({
}
throw e;
}),
...blobSidecars.map((blobSidecar) => () => network.publishBlobSidecar(blobSidecar)),
];
await promiseAllMaybeAsync(publishPromises);
};
Expand Down

0 comments on commit e0b6e28

Please sign in to comment.