Skip to content

fix: add deterministic accrual replay tie-break - #715

Open
pchieneye wants to merge 1 commit into
RevoraOrg:masterfrom
pchieneye:feat/accrual-tie-break
Open

fix: add deterministic accrual replay tie-break#715
pchieneye wants to merge 1 commit into
RevoraOrg:masterfrom
pchieneye:feat/accrual-tie-break

Conversation

@pchieneye

Copy link
Copy Markdown

fix: add deterministic accrual replay tie-break

Summary

This change makes accrual replay ordering deterministic when multiple updates share the same period and amount.

What changed

  • Added a canonical replay ordering for accrual updates based on:
    • period_id
    • amount
    • holder address as the final lexicographic tie-break
  • Added a regression test covering same-period, same-amount ties across different holders.
  • Documented the replay-ordering behavior in the accrual ledger docs.
  • Aligned the storage-layout registry with the current DataKey2 enum variants so the build script remains consistent.

Why

Without a deterministic tie-break, replay ordering could vary when multiple accrual updates shared identical period and amount values. This change keeps replay stable for indexers and downstream consumers without changing the underlying accrual totals.

Testing

  • Added regression coverage for the tie-break behavior in the accrual ledger tests.
  • Verified the modified files are free of editor-reported Rust errors.

Closes: #603

@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@pchieneye Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Add lexicographic tie-breaker for accrual-index updates when multiple entries share identical amounts

2 participants