celestiaorg / celestiaorg/go-header
sync: Add a boolean status to Syncer struct for tracking started state
- Dominant language
- Go
- Stars
- 21
- Forks
- 33
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 7
Description
The Syncer status can keep track of whether it has started already or not in a boolean.
It can check it in its `Start` and `Stop` method. If the status is started at the beginning of `Start` or `Stop`, the methods should be a no-op and can just return `nil`.
Otherwise, if we wish to not change `Start` or `Stop`, we can just add a getter for this status.
Rollkit uses the `go-header` library to implement `HeaderExchangeService` and it has to make a `SyncerStatus` struct to keep track of this state. Code [here](https://github.com/rollkit/rollkit/blob/1e1d8f9d8f5fe71fd5d7f0790408bbaf574dee80/node/header_exchange.go#L42).
Adding this to the `Syncer` struct would allow Rollkit to eliminate using the `SyncerStatus`.
Contributor guide
Research direction
Start at the Syncer struct and inspect its Start and Stop methods to understand their current lifecycle behavior. Decide whether the started status should make repeated calls no-ops or be exposed through a getter, then verify that the chosen behavior lets Rollkit avoid its separate SyncerStatus state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100