-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(nodebuiler): introduce ServiceBreaker and update FX (#2091)
This PR solves two problems: * Updates FX and fixes issues we observed in [the PR](#1801) * Fixes #2041 Surprisingly, those two problems were related, so I decided to fix them once and for all. The issue with FX happens after [this change](uber-go/fx#983). The outcome of this change is summarized: > In other words, lifecycle hook annotations can no longer pull in extra > dependencies outside of things on which > the annotated constructor is dependent, results that the annotated > constructor provides, context.Context > object which is injected by Lifecycle, and the Lifecycle object itself. Our current code does pull extra dependencies in the service having `modfraud.Lifecycle` on them, like [DASer](https://github.com/celestiaorg/celestia-node/blob/main/nodebuilder/das/module.go#L47). Specifically, it pulls FraudService, and this is no longer allowed. This forces us to rewrite the fraud lifecycling and here is the solution, which additionally satisfies #2041. This also unblocks #2040, which is now implemented in celestiaorg/go-fraud#1 I tried to split FX update and the refactor into two diff PRs. However, the solution does not work with the old FX version, so we have to couple those. The chain here is that I needed a new version of FX that fixes `OnStart/OnStop` hooks, and updating created the whole story. The PR that does clean-ups basing on new version of FX will com right after.
- Loading branch information
Showing
10 changed files
with
122 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters