-
Notifications
You must be signed in to change notification settings - Fork 740
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
Preserve orphaned blocks #2421
Comments
I would like to take this. |
Thanks @eklm that would be awesome! I'm working on some other database changes at the moment which are making me reconsider this part of the design:
I think it might be better to move the orphaned blocks to a separate part of the database. So maybe the column |
Hi @michaelsproul! Didn't have a chance to look at this yet, but I now get back to it and investigated the current implementation. So you are suggesting to move the orphaned blocks to different column in the hot db or also to the cold db?
The second variant looks much better for me ( I'm also thinking of if we should return the orphaned state in the api if it was requested by the root? I guess yes, right? In order to do that we may go to the corresponding orphaned block first and find the first ancestor which is part of canonical chain and replay the state from there... |
Description
We currently have no way of preserving orphaned blocks, even though they are useful for block explorers and analytics.
Steps to resolve
lighthouse bn
called something like--keep-orphaned-blocks
DBColumn::OrphanedBlocks
). The blocks themselves can be stored in the hot DB's main block storage, where all other blocks are currently stored.--keep-orphaned-blocks
is set, storing their block roots under theslot => Vec<Hash256>
mapping./eth/v1/beacon/headers?slot
so that it reads block roots from the orphaned block roots table, and then looks them up in the main block table./eth/v1/beacon/headers?parent_root
(I don't know what we do currently)/eth/v1/beacon/blocks/{root}
but not by their slot directly.Version
Lighthouse v1.4.0
The text was updated successfully, but these errors were encountered: