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 #25

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

Conversation

nathanieliov
Copy link

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 use of serializeCompactV2 for textual format in BuildCheckpoints
  • Added the use of deserializeCompactV2 to support 32 bytes chain work when reading textual checkpoints format
  • Added v2 format to LevelDBBlockStore

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 22 commits November 7, 2024 22:55
- Reorganize statics
- Remove unrelated tests
- Rename serializeCompact to serializeCompactLegacy to avoid confusion
- Add deprecate tag to serializeCompactLegacy
- Remove unnecessary check of chainWorkBytes size
- 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
- Refactored serializeCompactLegacy and serializeCompactV2 to get rid of duplicate logic
- add unit tests for LevelDBBlockStore testing v2 format
…BBlockStore

Add use of serialize/Deserialize compact v2 to LevleDbBlockStore
@nathanieliov nathanieliov changed the title 32 byte chainwork support integration Add support to 32 bytes chain work Nov 21, 2024
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