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

polygon/sync: fix issues found during testing #9873

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

taratorio
Copy link
Member

@taratorio taratorio commented Apr 6, 2024

Fixes problems found during bor-mainnet sync tests:

  • sync.Run was missing a for loop for initial sync convergences
  • temporarily disabling ForkChoiceUpdate execution since we are yet to solve and add missing state sync events and spans
  • no need to flush storage inside block downloader (better async performance)
  • logging improvements

import "fmt"

func syncLogPrefix(message string) string {
return fmt.Sprintf("[sync] %s", message)
Copy link
Contributor

Choose a reason for hiding this comment

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

could this be solved by a new logger?

tip = newTip
}
var prevTip *types.Header
for tip != prevTip { // loop until we converge at latest checkpoint & milestone
Copy link
Contributor

Choose a reason for hiding this comment

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

is it because commitExecution is so slow that a new checkpoint might arrive?

nit: I prefer comments on a separate line

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, also other things can be slow - fetching headers, bodies, persisting the blocks - ie depending on timing by the time we finished iteration 1 there may be new checkpoints and milestones ready for us to fetch - btw this matches the initial spec design we have

@@ -110,20 +108,37 @@ func (d *blockDownloader) downloadBlocksUsingWaypoints(ctx context.Context, wayp
return nil, nil
}

d.logger.Info(
Copy link
Contributor

Choose a reason for hiding this comment

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

should be .Debug

}

d.logger.Info(syncLogPrefix("finished downloading blocks using waypoints"))
Copy link
Contributor

Choose a reason for hiding this comment

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

should be .Debug

@@ -54,6 +58,8 @@ func (s *executionClientStorage) Flush(ctx context.Context) error {
}

func (s *executionClientStorage) Run(ctx context.Context) error {
s.logger.Info(syncLogPrefix("running execution client storage component"))
Copy link
Contributor

Choose a reason for hiding this comment

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

should be .Debug

@@ -209,25 +221,36 @@ func (s *Sync) onNewBlockHashesEvent(
//

func (s *Sync) Run(ctx context.Context) error {
s.logger.Info(syncLogPrefix("running sync component"))
Copy link
Contributor

Choose a reason for hiding this comment

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

should be .Debug

@@ -91,6 +94,8 @@ func (te *TipEvents) Events() <-chan Event {
}

func (te *TipEvents) Run(ctx context.Context) error {
te.logger.Info(syncLogPrefix("running tip events component"))
Copy link
Contributor

Choose a reason for hiding this comment

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

should be .Debug

@battlmonstr battlmonstr enabled auto-merge (squash) April 8, 2024 14:50
taratorio and others added 2 commits April 8, 2024 16:58
Fixes problems found during bor-mainnet sync tests:

* sync.Run was missing a for loop for initial sync convergences
* temporarily disabling ForkChoiceUpdate execution since we are yet to solve and add missing state sync events and spans
* no need to flush storage inside block downloader (better async performance)
* logging improvements
@battlmonstr battlmonstr merged commit c672452 into devel Apr 8, 2024
7 checks passed
@battlmonstr battlmonstr deleted the astrid-sync-testing-fixes branch April 8, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants