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

Only flush leaf_set if we have a prunable backend #2735

Merged
merged 1 commit into from
Apr 9, 2019

Conversation

antiochp
Copy link
Member

@antiochp antiochp commented Apr 8, 2019

Currently we have an "empty" leaf_set lying around in each PMMR backend dir for non-prunable backends.
We only use the leaf_set if we have a prunable backend. For non-prunable backends leaves are simply leaves (once added they are never removed).

This PR simply makes makes sure we only sync the leaf_set to disk if the backend is prunable.

Before (note the "empty" unused leaf_set file) -

ls -Gng chain_data/txhashset/kernel
total 184
-rw-r--r--  1 20  53352 Apr  8 14:38 pmmr_data.bin
-rw-r--r--  1 20  29792 Apr  8 14:38 pmmr_hash.bin
-rw-r--r--  1 20      8 Apr  8 14:38 pmmr_leaf.bin

After -

ls -Gng chain_data/txhashset/kernel       
total 176
-rw-r--r--  1 20  53352 Apr  8 14:27 pmmr_data.bin
-rw-r--r--  1 20  29792 Apr  8 14:27 pmmr_hash.bin

@antiochp antiochp merged commit 108bdba into mimblewimble:master Apr 9, 2019
@antiochp antiochp deleted the opt_leaf_set branch April 9, 2019 11:03
@antiochp antiochp added this to the 1.1.0 milestone Jun 5, 2019
@antiochp antiochp added the release notes To be included in release notes (of relevant milestone). label Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes To be included in release notes (of relevant milestone).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants