Skip to content

fix(pepper-sync): retain ZIP 318 anchor checkpoints - #2750

Open
dorianvp wants to merge 2 commits into
devfrom
retain_zip318_anchor_checkpoints
Open

fix(pepper-sync): retain ZIP 318 anchor checkpoints#2750
dorianvp wants to merge 2 commits into
devfrom
retain_zip318_anchor_checkpoints

Conversation

@dorianvp

Copy link
Copy Markdown
Member

Sends of exactly 1, 2, 5 × 10^n ZEC failed with AnchorNotFound: the canonical-crossing path anchors to a ZIP 318 grid boundary 147–290 blocks behind the tip, but pepper-sync retained only the newest 100 checkpoints, and the anchor_computable guard only checked scan completeness, so the doomed attempt was not rejected until after proposal acceptance.

  • zingolib: anchor_is_computable now also requires a checkpoint at the anchor height, so a canonical attempt at a pruned boundary degrades to the ordinary send path.
  • pepper-sync: create and pin grid-boundary checkpoints in all three pool trees during scanning (window of ANCHOR_AGE_CAP + 2 intervals from the Ironwood activation), re-derive the pins at sync start, exempt pinned checkpoints from the newest-100 serialization cap, and iterate the full checkpoint count when truncating to the next checkpoint.

Wallets with already-pruned boundaries send via the ordinary path immediately; canonical crossings resume once sync passes the next grid boundary.

🤖 Generated with Claude Code

@Oscar-Pepper Oscar-Pepper left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we also need to check spend migrations only use boundary anchors as only these are retained. im not sure what happens in the chain tip i.e. top 100 blocks etc.

Ok(())
})
.expect("Infallible");
if checkpoints.len() > MAX_REORG_ALLOWANCE as usize {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is good logic it just needs to use MAX_SHARDTREE_CHECKPOINTS instead

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