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

Poison block handling: Interrupt block validation to produce block #1039

Closed
Tracked by #888
heifner opened this issue Nov 19, 2024 · 0 comments · Fixed by #1047
Closed
Tracked by #888

Poison block handling: Interrupt block validation to produce block #1039

heifner opened this issue Nov 19, 2024 · 0 comments · Fixed by #1047
Assignees
Labels
👍 lgtm OCI Work exclusive to OCI team

Comments

@heifner
Copy link
Member

heifner commented Nov 19, 2024

  • For BP nodes, interrupt a block validation when scheduled to produce
  • All nodes including BP nodes, interrupt a block validation when a new best-head* at the validation block height is received from the network.

Note new best-head here means that a fork switch is required. If the new best head is a descendant of the current block being validated then validation should not be interrupted. Only when the new block is on an alternative fork should validation be interrupted.

A BP will always produce on schedule with this approach. The produced block should nominally be a new best-head on all other nodes since it will have a higher block timestamp. When the newly produced block comes into nodeos, it will determine it is a new best-head, interrupt validation of the current block, and switch over to validating the new fork which includes the block. This provides a natural recovery when a node is stuck validating a block.

This approach brings back the old drop-late-blocks functionality as a BP will begin producing blocks immediately when scheduled to do so. If the BP is in the middle of validating a block from the previous BP, it will interrupt that validation and produce on the previous block. We could potentially provide a bit of time for validation to potentially complete before interruption. However, it is simpler to just interrupt immediately. BPs already have a mechanism for making sure their blocks are received by the next BP in time.

This also provides faster switching to a better fork under normal conditions.

In all cases interrupted blocks will not be removed from the fork-database. In nominal cases, the interrupted block will be purged from the fork-database when irreversible moves so that the branch is purged. However, the block could potentially be used again if a fork switch to its branch is received from the network. In that situation the node will begin validating the block no matter how long it takes; or until it receives yet another better block to validate.

@enf-ci-bot enf-ci-bot moved this to Todo in Team Backlog Nov 19, 2024
@heifner heifner added this to the Spring v1.1.0-rc1 milestone Nov 19, 2024
@heifner heifner self-assigned this Nov 19, 2024
@heifner heifner moved this from Todo to In Progress in Team Backlog Nov 19, 2024
@heifner heifner added the OCI Work exclusive to OCI team label Nov 19, 2024
heifner added a commit that referenced this issue Nov 20, 2024
@bhazzard bhazzard changed the title Interrupt block validation to produce block Poison block handling: Interrupt block validation to produce block Nov 21, 2024
heifner added a commit that referenced this issue Nov 22, 2024
heifner added a commit that referenced this issue Nov 25, 2024
heifner added a commit that referenced this issue Nov 25, 2024
…r new best head to be received from network if forkdb contains a poison block
@heifner heifner linked a pull request Nov 26, 2024 that will close this issue
@heifner heifner moved this from In Progress to Awaiting Review in Team Backlog Nov 26, 2024
heifner added a commit that referenced this issue Nov 26, 2024
heifner added a commit that referenced this issue Nov 27, 2024
heifner added a commit that referenced this issue Nov 27, 2024
…le to work through the fork switches and apply any forked out blocks
heifner added a commit that referenced this issue Dec 3, 2024
heifner added a commit that referenced this issue Dec 3, 2024
heifner added a commit that referenced this issue Dec 3, 2024
heifner added a commit that referenced this issue Dec 5, 2024
…dation

Interrupt block validation on new best head
@github-project-automation github-project-automation bot moved this from Awaiting Review to Done in Team Backlog Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👍 lgtm OCI Work exclusive to OCI team
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants