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

Don't write empty blobs to db #3848

Merged
merged 8 commits into from
Jan 6, 2023
Merged

Conversation

emhane
Copy link
Contributor

@emhane emhane commented Jan 4, 2023

Issue Addressed

Don't write empty blobs to db

Proposed Changes

Blob verification doesn't appear to happen on blobs loaded from db, so verification will occur where it is supposed to (i.e. where this is called

pub fn validate_blobs_sidecar<T: EthSpec>(
).

@emhane emhane requested review from realbigsean and pawanjay176 and removed request for realbigsean January 4, 2023 12:03
@emhane emhane changed the base branch from stable to eip4844 January 4, 2023 12:56
@emhane emhane added ready-for-review The code is ready for review deneb and removed ready-for-review The code is ready for review labels Jan 4, 2023
@emhane emhane force-pushed the empty_blobs_db branch 2 times, most recently from b3b580d to 8dd2e07 Compare January 5, 2023 10:30
@emhane emhane added the ready-for-review The code is ready for review label Jan 5, 2023
Copy link
Member

@realbigsean realbigsean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! there's a .DS_Store file committed here, would you mind deleting it? Looks good otherwise!

Copy link
Member

@pawanjay176 pawanjay176 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall. Just some clarifications.

beacon_node/beacon_chain/src/beacon_chain.rs Outdated Show resolved Hide resolved
blobs_sent += 1;
self.send_network_message(NetworkMessage::SendResponse {
peer_id,
response: Response::BlobsByRange(Some(Arc::new(blob))),
response: Response::BlobsByRange(response_data),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to understand this better, are we sending a stream terminator if the sidecar contains empty blobs? Is this a change in the spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't look right...good catch! The goal is to not send an empty blobs sidecar. I will interpret this as not sending a response at all for a block with no kzg_commitments. Relating to this pr ethereum/consensus-specs#3174 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would hold off making this change until the linked PR gets resolved. I personally don't have a preference between sending empty blobs v/s not sending empty blobs.
However, if we go down the not sending empty blobs route, then we also need to ensure that we handle that case on the receiving end to account for missing blobs in the response.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch Pawan!

However, if we go down the not sending empty blobs route, then we also need to ensure that we handle that case on the receiving end to account for missing blobs in the response.

We do handle handle it either way on the receiving end right now. Diva implemented that last week. Other clients should be able to handle empty blobs too even if they skip empty blobs when they serve them so I thinks it's OK to send empty blobs for now.

@realbigsean realbigsean merged commit 33ff847 into sigp:eip4844 Jan 6, 2023
@emhane emhane deleted the empty_blobs_db branch January 6, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deneb ready-for-review The code is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants