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

consensus: Sync: timeout event is only handled when receiving Block message #1172

Closed
fed-franz opened this issue Dec 4, 2023 · 0 comments · Fixed by #1216
Closed

consensus: Sync: timeout event is only handled when receiving Block message #1172

fed-franz opened this issue Dec 4, 2023 · 0 comments · Fixed by #1216
Assignees

Comments

@fed-franz
Copy link
Contributor

Summary

In the current implementation, the timeout event is not handled when the timeout expires but only when receiving the next Block message.

Relevant Context

When the node is synchronizing with a peer (OutOfSync mode), a timeout is set within which the next tip+1 should be received.
This timeout is meant to prevent synchronization from stopping the consensus loop indefinitely.

Detailed Description

Currently, the timeout is handled by OutOfSync's function on_event (Block message) in fsm.rs: if a block is received and the timeout has expired, the function returns true, making the node switch back to InSync mode. Similarly, this function is only invoked by the on_event (Block message) function of SimpleFSM.

Possible Solution

The expiration of the timeout should be a separate event handled upon expiration.

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 a pull request may close this issue.

2 participants