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

Starting block is never added to head_tracker #4631

Open
michaelsproul opened this issue Aug 17, 2023 · 0 comments
Open

Starting block is never added to head_tracker #4631

michaelsproul opened this issue Aug 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@michaelsproul
Copy link
Member

Description

This is a slightly annoying inconcistency I encountered while working on Hydra: the genesis block isn't placed into the head_tracker when starting up from genesis.

The only place we insert into the head tracker is when importing a new block:

self.head_tracker
.register_block(block_root, parent_root, slot);

Because the genesis block isn't imported, and there's no special handling for it, it never makes it into the head_tracker.

There's one other register_block occurrence, but it's in the (broken) fork revert code which we don't expect to be called very often:

// Update head tracker.
head_tracker.register_block(block_root, block.parent_root(), block.slot());

I think the same logic applies for checkpoint sync. This may simplify the fix, as we might be able to just hack in a call to head_tracker.register_block for the head in BeaconChainBuilder::build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant