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

[Merged by Bors] - sync: require stated synced for node to be synced #4934

Closed

Conversation

countvonzero
Copy link
Contributor

@countvonzero countvonzero commented Aug 31, 2023

Motivation

Closes #4931

Changes

  • make sure state is synced before declaring node is synced
  • reduce gossip sync from 10 min to 2 min
  • do not print confusing log "failed to build proposal" when node is not synced

Test

  • manually synced with mainnet

@countvonzero countvonzero changed the title Require stated synced sync: require stated synced for node to be synced Aug 31, 2023
@countvonzero
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Aug 31, 2023
@codecov
Copy link

codecov bot commented Aug 31, 2023

Codecov Report

Merging #4934 (798c970) into develop (1f35f08) will increase coverage by 0.0%.
Report is 1 commits behind head on develop.
The diff coverage is 72.3%.

@@           Coverage Diff           @@
##           develop   #4934   +/-   ##
=======================================
  Coverage     77.0%   77.1%           
=======================================
  Files          263     263           
  Lines        30532   30532           
=======================================
+ Hits         23537   23543    +6     
+ Misses        5503    5497    -6     
  Partials      1492    1492           
Files Changed Coverage Δ
fetch/interface.go 100.0% <ø> (ø)
p2p/upgrade.go 63.9% <0.0%> (-0.9%) ⬇️
miner/proposal_builder.go 83.7% <33.3%> (-0.6%) ⬇️
syncer/syncer.go 92.4% <69.5%> (-1.7%) ⬇️
syncer/state_syncer.go 77.9% <85.7%> (+1.8%) ⬆️
config/mainnet.go 95.7% <100.0%> (+<0.1%) ⬆️
config/presets/fastnet.go 100.0% <100.0%> (ø)
fetch/cache.go 82.3% <100.0%> (-0.7%) ⬇️
fetch/fetch.go 78.1% <100.0%> (+0.2%) ⬆️
syncer/data_fetch.go 77.0% <100.0%> (ø)

... and 4 files with indirect coverage changes

@bors
Copy link

bors bot commented Aug 31, 2023

try

Build failed:

@countvonzero countvonzero marked this pull request as ready for review August 31, 2023 03:13
@@ -35,7 +35,8 @@ func minLayer(a, b types.LayerID) types.LayerID {

func (s *Syncer) stateSynced() bool {
current := s.ticker.CurrentLayer()
return current.Uint32() <= 1 || !s.mesh.ProcessedLayer().Before(current.Sub(1))
return current <= types.GetEffectiveGenesis() ||
(s.mesh.ProcessedLayer() >= current-1 && !s.stateErr.Load())
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason why checkMeshAgreement is based on this function instead of synced state?

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.

@countvonzero
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Aug 31, 2023
@bors
Copy link

bors bot commented Aug 31, 2023

try

Build failed:

@countvonzero
Copy link
Contributor Author

bors merge

bors bot pushed a commit that referenced this pull request Aug 31, 2023
## Motivation
Closes #4931

## Changes
- make sure state is synced before declaring node is synced
- reduce gossip sync from 10 min to 2 min
- do not print confusing log "failed to build proposal" when node is not synced

## Test
- manually synced with mainnet

## TODO
- [ ] Update [changelog](../CHANGELOG.md)
@countvonzero
Copy link
Contributor Author

bors cancel

@bors
Copy link

bors bot commented Aug 31, 2023

Canceled.

@countvonzero
Copy link
Contributor Author

bors merge

bors bot pushed a commit that referenced this pull request Aug 31, 2023
## Motivation
Closes #4931

## Changes
- make sure state is synced before declaring node is synced
- reduce gossip sync from 10 min to 2 min
- do not print confusing log "failed to build proposal" when node is not synced

## Test
- manually synced with mainnet
@bors
Copy link

bors bot commented Aug 31, 2023

Build failed:

@countvonzero
Copy link
Contributor Author

bors merge

bors bot pushed a commit that referenced this pull request Aug 31, 2023
## Motivation
Closes #4931

## Changes
- make sure state is synced before declaring node is synced
- reduce gossip sync from 10 min to 2 min
- do not print confusing log "failed to build proposal" when node is not synced

## Test
- manually synced with mainnet
@bors
Copy link

bors bot commented Aug 31, 2023

Pull request successfully merged into develop.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title sync: require stated synced for node to be synced [Merged by Bors] - sync: require stated synced for node to be synced Aug 31, 2023
@bors bors bot closed this Aug 31, 2023
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.

syncer: insufficient criteria for a node to become synced
2 participants