8000 move the check for is_height_processed forward before process_block_header by mzhangmzz · Pull Request #7831 · near/nearcore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

move the check for is_height_processed forward before process_block_header #7831

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
merged 2 commits into from
Oct 13, 2022

Conversation

mzhangmzz
Copy link
Contributor
@mzhangmzz mzhangmzz commented Oct 13, 2022

This PR actually includes two changes that should probably be separated into two PRs, for now, they are together since they are just going to 1.30.0

  1. The important change is to move the check for is_height_processed before process_block_header. Previously, this check happens after, which means, the node will re-process the block header (which takes a few ms) and re-broadcast an invalid block before drops it. In the case when there are many invalid blocks circulating in the network, this can cause the node to be too busy,
  2. A less important change is around when the block processing pool is full. Previously, we drop the block if the block processing pool is full and saves the block height as processed. This change gets rid of that because we want to be able to process the block again. Note that the behavior before does not mean the node can't process the dropped block forever. The node will eventually fall behind and gets into sync mode and request for the block, and the is_height_processed check only applies for unrequested blocks.

Both of these two changes can be merged to master as well. I'll do so later though.

@mzhangmzz mzhangmzz requested a review from a team as a code owner October 13, 2022 20:58
@mzhangmzz mzhangmzz requested a review from mina86 October 13, 2022 20:58
@mzhangmzz mzhangmzz changed the base branch from master to 1.30.0 October 13, 2022 20:59
@mzhangmzz mzhangmzz requested review from mm-near and robin-near and removed request for a team and mina86 October 13, 2022 20:59
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.

2 participants
0