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: Always request initial non-mining state. #3476

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Feb 22, 2025

Currently, the existing logic to avoid requesting the initial mining state is slightly incorrect since the initial state was extended to include additional data that is not specifically related to the mining state. Concretely, it currently does not request any initial state at all when the no mining state synchronization flag is set instead of only avoiding the data specific to the mining state.

Since the flag is not set by default, most nodes would not encounter this condition, but the result for any nodes with the no mining sync flag set is that any unmined treasury spends that are currently being voted on would not immediately be accessible to nodes initially coming online.

This resolves the aforementioned by modifying the relevant logic to only avoid requesting the data specific to the mining state.

While here, it also changes the logic to prevent duplicate initial state requests to use a sync primitive that will ultimately allow requests to be run in parallel instead of requiring them all to go through a single goroutine to protect concurrent access.

@davecgh davecgh added this to the 2.1.0 milestone Feb 22, 2025
@davecgh davecgh force-pushed the netsync_init_state_req_once branch from ff50692 to d53b3ce Compare February 22, 2025 15:03
@davecgh davecgh force-pushed the netsync_init_state_req_once branch from d53b3ce to 95e7023 Compare February 25, 2025 01:46
Currently, the existing logic to avoid requesting the initial mining
state is slightly incorrect since the initial state was extended to
include additional data that is not specifically related to the mining
state.  Concretely, it currently does not request any initial state at
all when the no mining state synchronization flag is set instead of only
avoiding the data specific to the mining state.

Since the flag is not set by default, most nodes would not encounter
this condition, but the result for any nodes with the no mining sync
flag set is that any unmined treasury spends that are currently being
voted on would not immediately be accessible to nodes initially coming
online.

This resolves the aforementioned by modifying the relevant logic to only
avoid requesting the data specific to the mining state.

While here, it also changes the logic to prevent duplicate initial state
requests to use a sync primitive that will ultimately allow requests to
be run in parallel instead of requiring them all to go through a single
goroutine to protect concurrent access.
@davecgh davecgh force-pushed the netsync_init_state_req_once branch from 95e7023 to e321f28 Compare February 25, 2025 01:48
@davecgh
Copy link
Member Author

davecgh commented Feb 25, 2025

Update just fixed some typos in the commit message. No code changes.

@davecgh davecgh merged commit e321f28 into decred:master Feb 25, 2025
2 checks passed
@davecgh davecgh deleted the netsync_init_state_req_once branch February 25, 2025 02:01
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.

2 participants