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

[sovereign] Disable notifier registration until fully synced #6571

Conversation

mariusmihaic
Copy link
Contributor

@mariusmihaic mariusmihaic commented Oct 30, 2024

Reasoning behind the pull request

  • Disable notifier receiving events until fully synced to the network

Proposed changes

  • Created notifierBootstrapper which will start waiting on a go routine to be notified via nodeSyncedChan when the sovereign node is synced. Meanwhile, it will print the current node state in log. When node is fully synced, it will register the incoming header processor to the websocket listener and exit the waiting loop.

Testing procedure

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@mariusmihaic mariusmihaic self-assigned this Oct 30, 2024
@mariusmihaic mariusmihaic marked this pull request as ready for review October 31, 2024 16:08
axenteoctavian
axenteoctavian previously approved these changes Nov 4, 2024
@sasurobert sasurobert self-requested a review November 6, 2024 09:17
log.Debug("notifierBootstrapper.checkNodeState: worker's go routine is stopping...")
return
case <-nb.nodeSyncedChan:
err := nb.sovereignNotifier.RegisterHandler(nb.incomingHeaderHandler)
Copy link
Contributor

Choose a reason for hiding this comment

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

this is quite a problem is register is failing.

Can't we design in such a way that the node stops ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed it as requested to signal the node to stop if registration fails

Base automatically changed from MX-15962-chain-sim-test-incoming-header-finality to feat/sovereign-mainchain-header-sync November 7, 2024 14:44
@mariusmihaic mariusmihaic dismissed axenteoctavian’s stale review November 7, 2024 14:44

The base branch was changed.

@mariusmihaic mariusmihaic merged commit deaafbd into feat/sovereign-mainchain-header-sync Nov 8, 2024
4 checks passed
@mariusmihaic mariusmihaic deleted the MX-15963-disable-notifier-until-synced branch November 8, 2024 10:15
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.

3 participants