Skip to content

Track locker-side PUSH reversals and block untracked recovery - #24

Open
Zartaj0 wants to merge 4 commits into
mainfrom
pre-migration-rollout
Open

Track locker-side PUSH reversals and block untracked recovery#24
Zartaj0 wants to merge 4 commits into
mainfrom
pre-migration-rollout

Conversation

@Zartaj0

@Zartaj0 Zartaj0 commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

This PR fixes the locker-side accounting gap where PUSH could leave MigrationLocker without being reflected in the off-chain claim builder.

Changes

  • track locked balance per sender + recipient + epoch
  • add Unlocked(sender, recipient, amount, epoch)
  • add refundLockedFunds(...) to return PUSH to the original sender through an explicit tracked path
  • block recoverFunds(PUSH_TOKEN, ...)
  • update the single-locker event builder to generate claims from Locked - Unlocked
  • update deployment/init flows to pass refundsEnabled

Scope

  • no change to MigrationRelease
  • no change to Merkle leaf format
  • no change to release-side claim flow

Zartaj0 added 2 commits July 1, 2026 00:30
- Add lockedBySenderRecipientEpoch to track net claimable balance per
  sender/recipient/epoch so refunds can be validated against real deposits
- Add refundLockedFunds (onlyOwner) to return PUSH to original sender
  and emit Unlocked event, decrementing the tracked balance
- Block recoverFunds(PUSH_TOKEN, ...) to prevent invisible PUSH outflow
  that would silently break the off-chain balance-delta validation
- Add refundsEnabled flag at initialize time so refund capability is
  explicit and per-instance
- Update event builder to fetch and net Unlocked events against Locked
  events by sender/recipient/epoch before producing the claims file
- Replace single-locker config with fixed preMigration/migration topology
- Pre-migration source always processes Locked - Unlocked (refund netting)
- Migration source always processes Locked only
- resolveLockerSources validates both addresses are configured and distinct,
  preventing silent double-count if the same address is pasted into both slots
- mergeClaims combines per-source claim groups by recipient+epoch so both
  lockers contribute to a single merged root without duplicate leaves
- Add TwoLockerApproach tests documenting the double-claim and orphaned-leaf
  failure modes that make the operational sequencing rules load-bearing
@Zartaj0
Zartaj0 requested a review from zaryab2000 June 30, 2026 19:21
@Zartaj0
Zartaj0 changed the base branch from fix-recovery-tracking to main July 14, 2026 05:01
@Zartaj0 Zartaj0 changed the title Add pre-migration source integration to claim builder Track locker-side PUSH reversals and block untracked recovery Jul 14, 2026
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.

1 participant