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

netsync: Request init state immediately upon sync. #2812

Merged
merged 2 commits into from Nov 17, 2021

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Nov 16, 2021

This modifies the logic that requests the initial state to happen immediately when the initial chain sync process is complete as opposed to the existing approach that uses a separate goroutine with polling on a 3 second interval.

This approach is more efficient since it avoids extra goroutines and it also allows obtaining initial data, most notably pending treasury spend transactions and votes for the current best block, more quickly.

@davecgh davecgh added this to the 1.7.0 milestone Nov 16, 2021
@davecgh davecgh force-pushed the netsync_immediate_initial_state branch from 545fb6c to a4c0a17 Compare November 16, 2021 10:12
Copy link
Member

@matheusd matheusd left a comment

Choose a reason for hiding this comment

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

Tested the behavior in simnet.

@davecgh davecgh force-pushed the netsync_immediate_initial_state branch 2 times, most recently from 677ce12 to 1b214a1 Compare November 16, 2021 20:03
internal/netsync/manager.go Outdated Show resolved Hide resolved
internal/netsync/manager.go Outdated Show resolved Hide resolved
@davecgh davecgh force-pushed the netsync_immediate_initial_state branch from 1b214a1 to af40896 Compare November 17, 2021 02:55
In an effort to consolidate the handling when the manager determines the
initial chain sync process completes, this introduces a new method named
onInitialChainSyncDone that is invoked accordingly and moves the
duplicate log statement into the new method.

This will also allow future commits to more easily add additional
handling when the initial chain sync process completes.
This modifies the logic that requests the initial state to happen
immediately when the initial chain sync process is complete as opposed
to the existing approach that uses a separate goroutine with polling on
a 3 second interval.

This approach is more efficient since it avoids extra goroutines and
also it also allows obtaining initial data, most notably pending
treasury spend transaction and votes for the current best block, more
quickly.
@davecgh davecgh force-pushed the netsync_immediate_initial_state branch from af40896 to 19ffb98 Compare November 17, 2021 02:59
@davecgh davecgh merged commit 19ffb98 into decred:master Nov 17, 2021
@davecgh davecgh deleted the netsync_immediate_initial_state branch November 17, 2021 05:02
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.

None yet

4 participants