rollmint
rollmint copied to clipboard
Move SyncerStatus into go-header library
Currently, HeaderExchangeService and BlockExchangeService use a SyncerStatus struct that is created in Rollkit. Ideally, this should be moved inside the go-header library.
@Manav-Aggarwal, can you please link to SyncerStatus struct? I would like to take a look at it and assess if it's worth the addition to the lib. I wonder if it's something like SyncerState which already exists in the lib.
Of course, here is the SyncerStatus struct in its current form. There's a PR open that moves it here.
So the whole point of this struct is to keep the bool of Syncer's status? Hmm, I don't get why you need it. I found multiple places where the setStarted is used, but not getStarted on the commit you shared. We can consider moving it to go-header or, even better make the Syncer report through its state whether it's started or not. For this, we need to open an issue on the go-header repo and briefly describe the use case.
Relevant go-header issue: https://github.com/celestiaorg/go-header/issues/55
The status started is checking by HeaderExchangeService in its Stop method to make sure it's not calling Stop on a SyncerStatus that hasn't started. Ideally, the Syncer's stop method itself handles this and acts as a no-op in this scenario. Mentioned in the issue.
Thank you @Manav-Aggarwal !
issue was opened in go-header closing this