rollmint icon indicating copy to clipboard operation
rollmint copied to clipboard

Move SyncerStatus into go-header library

Open Manav-Aggarwal opened this issue 2 years ago • 5 comments

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 avatar Jun 19 '23 01:06 Manav-Aggarwal

@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.

Wondertan avatar Jun 19 '23 08:06 Wondertan

Of course, here is the SyncerStatus struct in its current form. There's a PR open that moves it here.

Manav-Aggarwal avatar Jun 19 '23 14:06 Manav-Aggarwal

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.

Wondertan avatar Jun 22 '23 08:06 Wondertan

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.

Manav-Aggarwal avatar Jun 22 '23 23:06 Manav-Aggarwal

Thank you @Manav-Aggarwal !

Wondertan avatar Jun 23 '23 08:06 Wondertan

issue was opened in go-header closing this

tac0turtle avatar Mar 27 '25 08:03 tac0turtle