Skip to content

BlockId::root doesn't work at oldest_block_slot #7690

@michaelsproul

Description

@michaelsproul

While doing some testing I noticed that we're unable to load the block at the oldest_block_slot by slot:

curl -s "http://localhost:5052/eth/v1/beacon/blinded_blocks/3174625" | jq
{
  "code": 404,
  "message": "NOT_FOUND: beacon block at slot 3174625",
  "stacktraces": []
}

This is because block_root_at_slot_skips_none always tries to load the block root of the previous slot to the one queried, which fails when requesting the oldest_block_slot.

if let Some(((prev_root, _), (curr_root, curr_slot))) = process_results(
self.forwards_iter_block_roots_until(prev_slot, request_slot)?,
|iter| iter.tuple_windows().next(),
)? {
// Sanity check.
if curr_slot != request_slot {
return Err(Error::InconsistentForwardsIter {
request_slot,
slot: curr_slot,
});
}
Ok((curr_root != prev_root).then_some(curr_root))

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions