-
Notifications
You must be signed in to change notification settings - Fork 627
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
feat(epoch-sync): adding EpochSyncInfo column and its continuous population #9440
Conversation
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.
IIUC, you need a compilation feature, because you create a new column, but you haven't yet implemented the proper migration that populates that column.
Co-authored-by: nikurt <86772482+nikurt@users.noreply.github.com>
Yes. |
…lation (near#9440) Adding EpochSyncInfo column and its population on epoch end in block postprocessing.
…lation (#9440) Adding EpochSyncInfo column and its population on epoch end in block postprocessing.
#10029 The fix is 10 lines in `chain/chain/src/chain.rs`. Everything else is for testing. I don't like this approach, I am fixing a symptom, not the problem. But it is good enough for now (and possibly forever). But, just for context, **the problem** is as follows. We should write `EpochSyncInfo` every time we write `EpochInfo` of a full epoch. It is fine not to write `EpochSyncInfo` for genesis epoch of one block for two reasons: - Everyone has full genesis epoch on startup - Next epoch has the same `epoch_id` and therefore it is incorrect to have that key in DB before the end of first proper epoch `EpochInfo` is written in function `record_block_info` that is called from `add_validator_proposals`. Both function belong to `EpochManager`, and we cannot add `EpochSyncInfo` generation to `EpochManager`, as it requires headers (including the last header of an epoch, that is probably not written into DB during the execution of anything in `EpochManager`). From an architecture point of view `EpochSyncInfo` generation is a `Chain` function. So, I couldn't enforce that `EpochSyncInfo` is tied to `EpochInfo` generation. But I traced every usage of `add_validator_proposals`, and we have only two usages that are - in `neard` - not in tests - not related to genesis epoch First usage was covered by the commit that introduced `EpochSyncInfo` #9440. Second usage is covered with this PR.
First step towards new epoch sync. Everything should be under new_epoch_sync feature.
Design doc: https://docs.google.com/document/d/14Itc9Hs7ewTRmcGANid9UCaYcJzaLzzM7FsvYYIFKDY/edit
Adding EpochSyncInfo column and its population on epoch end in block postprocessing.