Skip to content

fix race condition#3344

Merged
antiochp merged 1 commit into
mimblewimble:masterfrom
antiochp:header_sync_race_condition
Jun 10, 2020
Merged

fix race condition#3344
antiochp merged 1 commit into
mimblewimble:masterfrom
antiochp:header_sync_race_condition

Conversation

@antiochp
Copy link
Copy Markdown
Member

@antiochp antiochp commented Jun 9, 2020

We were actually updating the header_head too early, after applying headers to the sync MMR, but before we actually apply the headers to the header MMR.

The process is roughly -

  • sync headers to sync MMR
  • update header_head (leads to race condition)
  • apply sync'd headers to header MMR
  • update header_head

This PR fixes the issue by simply skipping the redundant (and incorrect) interim update.

We don't normally see this during a fast sync on mainnet or floonet as we are very likely to receive a new latest header during the sync process.

I noticed this a couple of times on usertesting while testing fast sync with NRD kernels and here the fast sync is fast and we are more likely to hit the race condition.

@antiochp antiochp added this to the 4.0.0 milestone Jun 9, 2020
@antiochp antiochp requested a review from quentinlesceller June 9, 2020 21:30
@antiochp antiochp merged commit b98e5e0 into mimblewimble:master Jun 10, 2020
@antiochp antiochp deleted the header_sync_race_condition branch June 10, 2020 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants