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

Fix debug state api limitation #2633

Merged
merged 2 commits into from
Jun 5, 2021
Merged

Fix debug state api limitation #2633

merged 2 commits into from
Jun 5, 2021

Conversation

3xtr4t3rr3str14l
Copy link
Contributor

@3xtr4t3rr3str14l 3xtr4t3rr3str14l commented Jun 4, 2021

There were cases when I was testing the weak subjectivity state fetching where I couldn't get a very recently finalized state by its slot. The debug/state would not fetch the state if we couldn't find a block summary in the fork choice and it wouldn't trigger the state API's state regen functionality. This PR extends the existing solution to regen a state regardless of whether a block summary is found.

@codeclimate
Copy link

codeclimate bot commented Jun 4, 2021

Code Climate has analyzed commit b4a560e and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

View more on Code Climate.

Copy link
Member

@mpetrunic mpetrunic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any logic change here? Seems like just different syntax. If i'm not mistaken in old code is same logic, if block summary isn't found, it will regen state

@dapplion
Copy link
Contributor

dapplion commented Jun 4, 2021

I don't see any logic change here? Seems like just different syntax. If i'm not mistaken in old code is same logic, if block summary isn't found, it will regen state

This change allows to reach the getFinalizedState() code path even if there is a blockSummary available

@wemeetagain wemeetagain merged commit ecf5b5c into master Jun 5, 2021
@wemeetagain wemeetagain deleted the P0/state-api-fix branch June 5, 2021 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants