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

Improve error handling in babe_config_repository_impl #1749

Merged
merged 4 commits into from
Aug 22, 2023

Conversation

kamilsa
Copy link
Contributor

@kamilsa kamilsa commented Aug 22, 2023

This change ensures errors in babe_api_->next_epoch are handled gracefully. Instead of using OUTCOME_TRY that could potentially terminate the process on failure, the new code checks if the 'next_epoch' method call was successful and only then proceeds with calculations. This aims to increase code's reliability by avoiding unexpected crashes in case of unsuccessful 'next_epoch' call.

Referenced issues

None

Description of the Change

Handle error of babe next epoch properly

Benefits

Sync of Kusama from scratch works again

Possible Drawbacks

None

This change ensures errors in babe_api_->next_epoch are handled gracefully. Instead of using OUTCOME_TRY that could potentially terminate the process on failure, the new code checks if the 'next_epoch' method call was successful and only then proceeds with calculations. This aims to increase code's reliability by avoiding unexpected crashes in case of unsuccessful 'next_epoch' call.
@kamilsa kamilsa enabled auto-merge (squash) August 22, 2023 07:43
@kamilsa kamilsa merged commit 6395a77 into master Aug 22, 2023
5 of 14 checks passed
@kamilsa kamilsa deleted the fix/babe-next-epoch branch August 22, 2023 07:50
Harrm pushed a commit that referenced this pull request Aug 28, 2023
* Improve error handling in babe_config_repository_impl

This change ensures errors in babe_api_->next_epoch are handled gracefully. Instead of using OUTCOME_TRY that could potentially terminate the process on failure, the new code checks if the 'next_epoch' method call was successful and only then proceeds with calculations. This aims to increase code's reliability by avoiding unexpected crashes in case of unsuccessful 'next_epoch' call.

* Update core/consensus/babe/impl/babe_config_repository_impl.cpp

Co-authored-by: Dmitriy Khaustov <khaustov.dm@gmail.com>

* clang-format

---------

Co-authored-by: Dmitriy Khaustov <khaustov.dm@gmail.com>
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.

3 participants