Skip to content

fix: stop bundle rewards after close or burn#37

Open
dtopenclaw wants to merge 12 commits intoetherisc:mainfrom
dtopenclaw:fix/issue-31-post-burn-rewards
Open

fix: stop bundle rewards after close or burn#37
dtopenclaw wants to merge 12 commits intoetherisc:mainfrom
dtopenclaw:fix/issue-31-post-burn-rewards

Conversation

@dtopenclaw
Copy link
Copy Markdown

Summary

  • clamp registered bundle expiry to block.timestamp when a bundle is closed
  • keep the same expiry pinned after burn instead of letting reward time drift forward
  • add a focused regression test for close/burn registry expiry sync

Why

Issue #31 reports that DIP rewards continue to accumulate after a risk bundle is closed, burned, and later unstaked.

Locally, the bundle registry/staking integration already syncs expiry on bundle creation and lifetime extension, but it did not sync expiry when the bundle lifecycle ends via close/burn. The UI/server reward surface reads bundle registry expiry as the relevant bundle end timestamp, so stale expiry can keep rewards appearing to accrue after the bundle is no longer active.

This patch adds the missing close/burn sync so the effective bundle expiry is clamped to the current time once the bundle is closed.

Validation

brownie test tests/test_bundle_registry_sync.py::test_close_and_burn_bundle_sync_registry_expiry -s
brownie test tests/test_bundle_extend.py::test_extend_bundle tests/test_bundle_registry_sync.py::test_close_and_burn_bundle_sync_registry_expiry tests/test_policy_lifecycle.py::test_close_policy_no_depeg_event -s

Local result:

  • 3 passed

Closes #31

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.

3 participants