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

feat(manager): improve unhealthy status management #1304

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mtsitrin
Copy link
Contributor

@mtsitrin mtsitrin commented Jan 6, 2025

closes #1208

Main points in this refactor:

  • blockManager's loops runs in error group and return error for unrecoverable error
  • on error, block manager will enter unhealthy state
  • fraud is handled in single place for main loops

TODOs:

  • allow retries for errors in SettlementSync and SettlementValidator for m.SLClient.GetBatchAtHeight errors
  • fix TestLocalBlockWithFraud (I would consider remove applyLocalBlock for good)

@mtsitrin mtsitrin linked an issue Jan 6, 2025 that may be closed by this pull request
@mtsitrin mtsitrin marked this pull request as ready for review January 7, 2025 17:18
@mtsitrin mtsitrin requested a review from a team as a code owner January 7, 2025 17:18
@@ -283,7 +288,7 @@ func (m *Manager) doForkWhenNewRevision() error {

// this cannot happen. it means the revision number obtained is not the same or the next revision. unable to fork.
if expectedRevision.Number != m.State.GetRevision() {
panic("Inconsistent expected revision number from Hub. Unable to fork")
return fmt.Errorf("inconsistent expected revision number from Hub (%d != %d). Unable to fork", expectedRevision.Number, m.State.GetRevision())
Copy link
Contributor

Choose a reason for hiding this comment

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

params are better at the end but nvm

Copy link
Contributor

@danwt danwt left a comment

Choose a reason for hiding this comment

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

Nice, seems a big improvement.

Probs we can further simplify later

@mtsitrin mtsitrin requested a review from srene January 8, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve unhealthy status management
2 participants