-
Notifications
You must be signed in to change notification settings - Fork 925
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
service/header: Refactor HeaderService
to separate distinct components into clearer sub-components
#317
service/header: Refactor HeaderService
to separate distinct components into clearer sub-components
#317
Conversation
995a7ea
to
b75078d
Compare
HeaderService
refactoring in progressHeaderService
to only manage its sub-services' lifecycles
e0ad250
to
c59f5cb
Compare
HeaderService
to only manage its sub-services' lifecyclesHeaderService
to separate distinct components into clearer sub-components
2ad37dc
to
e2b712b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done!(even when I prefer medium-rare more 😄)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like great work! I definitely need to check out the code locally soon and go through each line again to get all the context again!
10ac82b
to
475729e
Compare
…nts into clearer sub-components (celestiaorg#317)
This PR does two things:
HeaderService
in order to make it agnostic to the details of its sub-services.HeaderService
's no longer has any function and only contains pointers to its subcomponents for later use once we scope out the RPC component. All ingredients necessary to construct its sub-services are created during node construction. Sub-service lifecycle management is also delegated to the DI application.P2PExchange
start the server-side component (which is necessary for all nodes), but not need it for its exchange component when in bridge mode, the server-side component is split out into a separate lifecycle which is present for every node type as all nodes can serve headers, but not all nodes request headers from the same method (p2p vs. directly from core).This PR is quite large but its necessary moving forward as
HeaderService
is the largest and most complicated component of celestia-node, and many other services are dependent on it, so keeping it clean and its sub-services nicely self-contained is crucial.Another thing to mention is that this PR includes commits from #277, rendering that PR unnecessary on its own, and should also precede #303.
Resolves #287