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(fraudserv): stop topics on Stop #1

Merged
merged 3 commits into from
Jul 13, 2023
Merged

fix(fraudserv): stop topics on Stop #1

merged 3 commits into from
Jul 13, 2023

Conversation

Wondertan
Copy link
Member

There was a blocker on the node side to implement this, but we have a solution for it now

@Wondertan Wondertan self-assigned this Apr 17, 2023
Copy link
Member

@renaynay renaynay left a comment

Choose a reason for hiding this comment

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

What's the solution? The fact we track topics and only try to close topics remaining in the map so we don't try to close twice?

@Wondertan
Copy link
Member Author

@renaynay, I will make a PR on celestia-node soon. It's the same solution as for FX update

Wondertan added a commit to celestiaorg/celestia-node that referenced this pull request Apr 18, 2023
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.
@Wondertan Wondertan enabled auto-merge (squash) July 13, 2023 12:21
@Wondertan Wondertan merged commit 1944f93 into main Jul 13, 2023
@Wondertan Wondertan deleted the stop-topics branch July 13, 2023 12:23
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