Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

[Blockchain/IBFT] Update snapshot after processBlock ends #482

Merged
merged 3 commits into from
Apr 27, 2022

Conversation

dbrajovic
Copy link
Contributor

@dbrajovic dbrajovic commented Mar 30, 2022

Description

This PR delays the call to processHeaders() until after the block has been verified and processed completely.

Previously, snapshot updating was done during verifyHeaders() despite processBlock() potentially failing afterwards.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

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

Manual tests

Tested manually with a 4-node cluster. Steps:

  1. Spin up 4 nodes (develop build)
  2. Sequentially restart all nodes (fix/snapshot_update build)
  3. Nothing breaks

Tested PoA voting mechanism (manually). Steps:

  1. Spin up 4 nodes (fix/snapshot_update build)
  2. While the cluster is running, spin up a 5th node (--seal)
  3. Cluster votes for 5th node to be included in the validator set.
  4. Observe the 5th node is able to join consensus on new blocks.

Additional comments

Fixes EDGE-465

@dbrajovic dbrajovic self-assigned this Mar 30, 2022
@dbrajovic dbrajovic added the bug fix Functionality that fixes a bug label Mar 30, 2022
@dbrajovic dbrajovic requested a review from Kourin1996 April 26, 2022 15:00
Copy link
Contributor

@Kourin1996 Kourin1996 left a comment

Choose a reason for hiding this comment

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

LGTM

@dbrajovic dbrajovic merged commit 805f9ef into develop Apr 27, 2022
@dbrajovic dbrajovic deleted the fix/snapshot_update branch April 27, 2022 17:28
@github-actions github-actions bot locked and limited conversation to collaborators Apr 27, 2022
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.

4 participants