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

Add support to 32 bytes chain work #122

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

nathanieliov
Copy link
Contributor

These changes provide a long-term fix for the 12-byte bug that we had at btc block 849,138.

List of the changes done.

  • Added deserializeCompactV2 method to deserialize block with 32-byte chain work.
  • Added serializeCompactV2 method to serialize block with 32-byte chainwork
  • Deprecated CheckpointManager.readBinary method
  • Added read binary checkpoints unit tests
  • Added the use of deserializeCompactV2 to support 32 bytes chain work when reading textual checkpoints format

How Has This Been Tested?

Unit tests

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 not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • Tests for the changes have been added (for bug fixes / features)
  • Requires Activation Code (Hard Fork)

nathanieliov and others added 21 commits November 7, 2024 20:07
- Reorganize statics
- Remove unrelated tests
- Rename serializeCompact to serializeCompactLegacy to avoid confusion
- Add deprecate tag to serializeCompactLegacy
- Remove unnecessary check of chainWorkBytes size
- Refactored serializeCompactLegacy and serializeCompactV2 to get rid of duplicate logic
- Refactored StoredBlockTest to make it easier to follow
- Deprecated deserializeCompactLegacy
- Deprecate CheckpointManager.readBinary  method
…rmed checkpoints file

- Add read binary checkpoints unit tests
- Add testnet and mainnet binary sample file for unit tests
Add serializeCompactV2 method to serialize block with 32-byte chainwork
Add deserializeCompactV2 method to deserialize block with 32-byte chain work
- Fix conditional to use context variable making more clear the purpose of it
- Deprecated deserializeCompactLegacy
Deprecate CheckpointManager.readBinary  method
Add support to 32 bytes chain work to textual checkpoints format
@nathanieliov nathanieliov requested a review from a team November 20, 2024 15:18
@nathanieliov nathanieliov marked this pull request as ready for review November 20, 2024 15:18
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