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

Cleanup output pos idx #3227

Merged
merged 2 commits into from
Feb 14, 2020
Merged

Conversation

antiochp
Copy link
Member

@antiochp antiochp commented Feb 10, 2020

Related #3226.

We have two indices in the db -

  • COMMIT_POS_PREFIX
  • COMMIT_POS_HGT_PREFIX

The original COMMIT_POS_PREFIX (pos only) was replaced with COMMIT_POS_HGT_PREFIX (pos and height) and a migration process was used to convert from one to the other.
Now all nodes are on 3.0.0 this migration is no longer required and the old legacy index can be safely removed.

Also took the opportunity to rename it to OUTPUT_POS_PREFIX to make it clearer this index is specific to the output MMR.

Refactored get_output_pos() for less code duplication with get_output_pos_height().

cleanup unused migration code
consolidate use of output_pos index
@antiochp antiochp force-pushed the cleanup_output_pos_idx branch from de29c50 to 8490dc5 Compare February 13, 2020 10:30
@antiochp antiochp added this to the 3.1.0 milestone Feb 13, 2020
Copy link
Member

@quentinlesceller quentinlesceller left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@@ -32,8 +32,7 @@ const BLOCK_HEADER_PREFIX: u8 = b'h';
const BLOCK_PREFIX: u8 = b'b';
const HEAD_PREFIX: u8 = b'H';
const TAIL_PREFIX: u8 = b'T';
const COMMIT_POS_PREFIX: u8 = b'c';
const COMMIT_POS_HGT_PREFIX: u8 = b'p';
const OUTPUT_POS_PREFIX: u8 = b'p';
Copy link
Member

Choose a reason for hiding this comment

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

👍 for changing the name

@antiochp antiochp merged commit 2d4a2c3 into mimblewimble:master Feb 14, 2020
@antiochp antiochp deleted the cleanup_output_pos_idx branch February 14, 2020 20:42
@antiochp antiochp mentioned this pull request Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants