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

Fix validator build block when syncing #313

Merged
merged 3 commits into from
Mar 1, 2023

Conversation

DarianShawn
Copy link
Collaborator

Description

Validator nodes build blocks during sync, which makes it slow to sync and full of error logs.
This PR fixes it to only start building blocks when syncing is done.

Changes include

  • Bugfix (non-breaking change that solves an issue)

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

Manual tests

  1. start up a 4-validators network.
  2. stop a validator for about 2-3 minutes.
  3. restart the stopped validator and check its logs.

On current branch, validator will print out "sequence started" only when it catch up to the latest height.
On the target branch, validator will print out "sequence started" every time a new block arrives, and try to build an outdated block every turn.

@DarianShawn DarianShawn added the bug fix Functionality that fixes a bug label Mar 1, 2023
@DarianShawn DarianShawn self-assigned this Mar 1, 2023
@DarianShawn DarianShawn requested a review from 0xcb9ff9 as a code owner March 1, 2023 06:53
@codecov-commenter
Copy link

Codecov Report

Merging #313 (6b408d2) into dev (a840ee8) will decrease coverage by 3.54%.
The diff coverage is 41.12%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##              dev     #313      +/-   ##
==========================================
- Coverage   51.21%   47.67%   -3.54%     
==========================================
  Files         117      131      +14     
  Lines       17525    19836    +2311     
==========================================
+ Hits         8975     9457     +482     
- Misses       7789     9561    +1772     
- Partials      761      818      +57     
Impacted Files Coverage Δ
blockchain/storage/kvstorage/kvstorage.go 54.16% <ø> (+2.46%) ⬆️
chain/chain.go 28.69% <ø> (ø)
consensus/ibft/hooks.go 55.26% <ø> (ø)
consensus/ibft/pos.go 0.00% <0.00%> (ø)
helper/keccak/keccak.go 0.00% <ø> (ø)
helper/keccak/pool.go 0.00% <ø> (ø)
jsonrpc/debug_endpoint.go 36.08% <0.00%> (-0.76%) ⬇️
jsonrpc/net_endpoint.go 0.00% <0.00%> (ø)
network/bootnodes.go 85.71% <ø> (-14.29%) ⬇️
network/connections.go 98.07% <ø> (ø)
... and 131 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link

@0xcb9ff9 0xcb9ff9 left a comment

Choose a reason for hiding this comment

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

LGMT

@DarianShawn DarianShawn merged commit 3b1d596 into dev Mar 1, 2023
@DarianShawn DarianShawn deleted the fix-validator-build-block-when-syncing branch March 1, 2023 09:00
@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fix Functionality that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants