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

Protect against possible panics in header/horizon sync #2219

Merged

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Sep 11, 2020

Description

Added two missing checks in the header sync and horizon sync.
These checks exit early if the headers/utxo set is aready synchonized or
is ahead of the peer. Previously if this case occurred, the counter iterator
would panic (start > end is invalid).

Motivation and Context

Remove the possibility of a failed assertion (panic) in the base node.

How Has This Been Tested?

Header sync tested with base node.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Feature refactor (No new feature or functional changes, but performance or technical debt improvements)
  • New Tests
  • Documentation

Checklist:

  • I'm merging against the development branch.
  • I ran cargo-fmt --all before pushing.
  • I have squashed my commits into a single commit.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

Added two missing checks in the header sync and horizon sync.
These checks exit early if the headers/utxo set is aready synchonized or
is ahead of the peer. Previously if this case occurred, the counter iterator
would panic (start > end is invalid).
@sdbondi sdbondi force-pushed the sb-core-fix-horizon-sync-panic branch from ec3360a to 844c1fd Compare September 11, 2020 09:09
Copy link
Contributor

@philipr-za philipr-za left a comment

Choose a reason for hiding this comment

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

LGTM

@stringhandler stringhandler merged commit 803f9a8 into tari-project:development Sep 15, 2020
stringhandler added a commit that referenced this pull request Sep 18, 2020
Major Fixes since v0.5.4
* Many fixes and updates to tari_merge_mining_proxy
* Implement transaction negotiation message resending in the wallet (#2161)

Minor Fixes
* Added basic RPC interface for DHT (#2188)
* Refactor Tokio runtime out of wallet container (#2213)
* Add period stats UI call (#2189)
* Protect against possible panics in header/horizon sync (#2219)
* Fix coinbase vulnerability (#2143)
* Added a user configurable chain monitoring timeout (#2202)
* Implement LMDB automatic resizing
* Add `is_synced` flag to BaseNodeServiceResponse & update UTXO validator
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.

3 participants