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

client: don’t update validators produced counters when syncing #6762

Merged
merged 2 commits into from May 6, 2022

Conversation

mina86
Copy link
Contributor

@mina86 mina86 commented May 6, 2022

EpochManager::get_validator_info call querying information by block
hash turns out to be quite expensive while node is synchronising.

Normally, EpochManager maintains validator information up to the
latest final block. With that, calling get_validator_info with
a block hash usually needs to iterate over only a handful of blocks
until it hits the latest final block and then can read the already
aggregated data.

However, while node is syncing, the aggregated data is not maintained.
This means that getting validator info for a given block requires
iteration over all blocks until start of the epoch. This is an
expensive operation.

EpochManager::get_validator_info is called each time stats line is
generated. When synchronising this ends up taking a up all of the
processing time to the point that node doesn’t respond to /status
queries.

Stop getting the validator information when node is synchronising to
avoid this problem. The observable effect is that

  • near_validators_blocks_expected,
  • near_validators_blocks_produced,
  • near_validators_chunks_expected and
  • near_validators_chunks_produced

metrics are not updated.

Issue: #6763

EpochManager::get_validator_info call querying information by block
hash turns out to be quite expensive while node is synchronising.

Normally, EpochManager maintains validator information up to the
latest final block.  With that, calling get_validator_info with
a block hash usually needs to iterate over only a handful of blocks
until it hits the latest final block and then can read the already
aggregated data.

However, while node is syncing, the aggregated data is not maintained.
This means that getting validator info for a given block requires
iteration over all blocks until start of the epoch.  This is an
expensive operation.

EpochManager::get_validator_info is called each time stats line is
generated.  When synchronising this ends up taking a up all of the
processing time to the point that node doesn’t respond to /status
queries.

Stop getting the validator information when node is synchronising to
avoid this problem.  The observable effect is that
- near_validators_blocks_expected,
- near_validators_blocks_produced,
- near_validators_chunks_expected and
- near_validators_chunks_produced
metrics are not updated.
@mina86 mina86 requested a review from a team as a code owner May 6, 2022 18:48
@mina86 mina86 requested a review from jakmeier May 6, 2022 18:48
@near-bulldozer near-bulldozer bot merged commit 1c7f779 into near:master May 6, 2022
@janewang janewang added the T-node Team: issues relevant to the node experience team label May 6, 2022
@janewang janewang added this to In Development in Node Q2 2022 May 6, 2022
@janewang janewang removed this from In Development in Node Q2 2022 May 6, 2022
@mina86 mina86 deleted the a branch May 6, 2022 20:40
marcelo-gonzalez pushed a commit that referenced this pull request May 10, 2022
EpochManager::get_validator_info call querying information by block
hash turns out to be quite expensive while node is synchronising.

Normally, EpochManager maintains validator information up to the
latest final block.  With that, calling get_validator_info with
a block hash usually needs to iterate over only a handful of blocks
until it hits the latest final block and then can read the already
aggregated data.

However, while node is syncing, the aggregated data is not maintained.
This means that getting validator info for a given block requires
iteration over all blocks until start of the epoch.  This is an
expensive operation.

EpochManager::get_validator_info is called each time stats line is
generated.  When synchronising this ends up taking a up all of the
processing time to the point that node doesn’t respond to /status
queries.

Stop getting the validator information when node is synchronising to
avoid this problem.  The observable effect is that

- near_validators_blocks_expected,
- near_validators_blocks_produced,
- near_validators_chunks_expected and
- near_validators_chunks_produced

metrics are not updated.

Issue: #6763
@gmilescu gmilescu added the Node Node team label Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Node Node team T-node Team: issues relevant to the node experience team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants