Skip to content

Commit

Permalink
grin v5.3 (0136) croaring-rs upgrade 0.5.2 -> 1.0.1 (mimblewimble#3779)
Browse files Browse the repository at this point in the history
  • Loading branch information
bayk committed Jun 23, 2024
1 parent 3f25b81 commit b0e747f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ jobs:
windows-release:
name: Windows Release
runs-on: windows-latest
runs-on: windows-2019
env:
ROARING_ARCH: x86-64-v2
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ jobs:

windows-tests:
name: Windows Tests
runs-on: windows-latest
runs-on: windows-2019
env:
ROARING_ARCH: x86-64-v2
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion chain/src/txhashset/txhashset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ impl<'a> Extension<'a> {
/// Once the PIBD set is downloaded, we need to ensure that the respective leaf sets
/// match the bitmap (particularly in the case of outputs being spent after a PIBD catch-up)
pub fn update_leaf_sets(&mut self, bitmap: &Bitmap) -> Result<(), Error> {
let flipped = bitmap.flip(0..bitmap.maximum().unwrap() as u32 + 1);
let flipped = bitmap.flip(0u32..bitmap.maximum().unwrap() + 1);
for spent_pmmr_index in flipped.iter() {
let pos0 = pmmr::insertion_to_pmmr_index(spent_pmmr_index.into());
self.output_pmmr.remove_from_leaf_set(pos0);
Expand Down
4 changes: 2 additions & 2 deletions store/src/leaf_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl LeafSet {

// First remove pos from leaf_set that were
// added after the point we are rewinding to.
let to_remove = ((cutoff_pos + 1) as u32)..bitmap.maximum().unwrap_or(0);
let to_remove = ((cutoff_pos + 1) as u32)..=bitmap.maximum().unwrap_or(0);
bitmap.remove_range(to_remove);

// Then add back output pos to the leaf_set
Expand All @@ -133,7 +133,7 @@ impl LeafSet {
pub fn rewind(&mut self, cutoff_pos: u64, rewind_rm_pos: &Bitmap) {
// First remove pos from leaf_set that were
// added after the point we are rewinding to.
let to_remove = ((cutoff_pos + 1) as u32)..self.bitmap.maximum().unwrap_or(0);
let to_remove = ((cutoff_pos + 1) as u32)..=self.bitmap.maximum().unwrap_or(0);
self.bitmap.remove_range(to_remove);

// Then add back output pos to the leaf_set
Expand Down
3 changes: 2 additions & 1 deletion store/src/prune_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ impl PruneList {
}

// Note: We will treat this as a "closed range" below (croaring api weirdness).
let cleanup_pos1 = (lc0 + 1)..size;
// Note: After croaring upgrade to 1.0.2 we provide an inclusive range directly
let cleanup_pos1 = (lc0 + 1)..=size;

// Find point where we can truncate based on bitmap "rank" (index) of pos to the left of subtree.
let idx = self.bitmap.rank(lc0);
Expand Down

0 comments on commit b0e747f

Please sign in to comment.