-
Notifications
You must be signed in to change notification settings - Fork 251
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
Exit with an error if state missing for chosen mapping block #3252
Conversation
// Similarly, state can be pruned, even if the data is present. | ||
client | ||
.runtime_api() | ||
.extract_block_object_mapping(*best_block_data.block.header().parent_hash(), best_block_data.block.clone()) |
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.
We already have hash conveniently stored in a variable, no need to re-calculate it again:
.extract_block_object_mapping(*best_block_data.block.header().parent_hash(), best_block_data.block.clone()) | |
.extract_block_object_mapping(best_block_to_archive_hash, best_block_data.block.clone()) |
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.
Technically it’s the hash if the block itself, not the parent block hash?
But in this case, if we haven’t pruned the parent block, we definitely haven’t pruned the block itself.
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.
I see, I was not reading it correct and you're correct that this change is not equivalent.
d1b9157
to
46ed466
Compare
This PR handles an edge case where state is missing for a custom mapping start height:
#3242 (comment)
Code contributor checklist: