-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Beacon API: get blob fix retention cases #13585
Conversation
@@ -207,7 +215,25 @@ func (p *BeaconDbBlocker) Blobs(ctx context.Context, id string, indices []uint64 | |||
} | |||
} | |||
} | |||
|
|||
if !p.BeaconDB.HasBlock(ctx, bytesutil.ToBytes32(root)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this isn't needed if i just use p.BeaconDB.Block()
moc := &mockChain.ChainService{FinalizedCheckPoint: ð.Checkpoint{Root: blockRoot[:]}} | ||
blocker := &lookup.BeaconDbBlocker{ | ||
ChainInfoFetcher: moc, | ||
GenesisTimeFetcher: moc, // max slot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the meaning of the max slot
comment? I don't think genesis time is set to max slot - it's set to zero.
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
fixes the /eth/v1/beacon/blob_sidecars/{block_id} endpoint to handl the additional cases below correctly without a 500 error. currently, we will try to use the root even if the block doesn't exist which doesn't correctly handle all our cases.
block exists, no commitment, 200 w/ empty list
block exists, has commitments, inside retention period (greater of protocol- or user-specified) serve then w/ 200 unless we hit an error reading them. we are technically not supposed to import a block to forkchoice unless we have the blobs, so the nuance here is if we can't find the file and we are inside the protocol-defined retention period, then it's actually a 500.
Which issues(s) does this PR fix?
related to #13134