Skip to content

feat: emit acc_idx topic on accrual index updates#502

Open
rosemary21 wants to merge 1 commit into
RevoraOrg:masterfrom
rosemary21:feat/accrual-index-event
Open

feat: emit acc_idx topic on accrual index updates#502
rosemary21 wants to merge 1 commit into
RevoraOrg:masterfrom
rosemary21:feat/accrual-index-event

Conversation

@rosemary21

Copy link
Copy Markdown

Add acc_idx indexed event emitted via EVENT_INDEXED_V2 on every accepted revenue report (rv_init and rv_ovr). The event carries the cumulative accrual index in 1e18 fixed-point precision, letting off-chain indexers rebuild per-holder owed amounts without re-reading all periods.

Security properties enforced and pinned by tests:

  • Rejected duplicates (rv_rej) never emit acc_idx
  • Zero-amount reports (no-op) never emit acc_idx
  • period_id in topic always matches the reported period
  • Index is strictly monotonically increasing

Pre-existing compilation blockers fixed to unblock the test suite:

  • DataKey exceeded the Soroban ≤50 XDR union variant limit; removed the two duplicate variants (PaymentTokenDecimals, FrozenOffering) that already existed in DataKey2 and updated their call sites accordingly
  • Added missing PauseState contracttype enum (SoftPaused/HardPaused/NotPaused)
  • Added missing DataKey2 variants: SupplyCap, DepositedRevenue, MinRevenueThreshold, InvestmentConstraints, AccrualIndex
  • Fixed RevoraError discriminant 48 conflict (VestingTransferBlocked vs PeriodAlreadyClosed); assigned PeriodAlreadyClosed=51
  • Added RevoraError::StaleConcentrationData=52
  • Fixed test_compute_share_invariants: i128 constant overflow and for-pattern
  • Fixed test_claim_transfer_fail: get_pending_periods→get_pending_periods_page, missing payout/payment_token args in register_offering/deposit_revenue

closes #482

Add acc_idx indexed event emitted via EVENT_INDEXED_V2 on every accepted
revenue report (rv_init and rv_ovr). The event carries the cumulative accrual
index in 1e18 fixed-point precision, letting off-chain indexers rebuild
per-holder owed amounts without re-reading all periods.

Security properties enforced and pinned by tests:
- Rejected duplicates (rv_rej) never emit acc_idx
- Zero-amount reports (no-op) never emit acc_idx
- period_id in topic always matches the reported period
- Index is strictly monotonically increasing

Pre-existing compilation blockers fixed to unblock the test suite:
- DataKey exceeded the Soroban ≤50 XDR union variant limit; removed the two
  duplicate variants (PaymentTokenDecimals, FrozenOffering) that already
  existed in DataKey2 and updated their call sites accordingly
- Added missing PauseState contracttype enum (SoftPaused/HardPaused/NotPaused)
- Added missing DataKey2 variants: SupplyCap, DepositedRevenue,
  MinRevenueThreshold, InvestmentConstraints, AccrualIndex
- Fixed RevoraError discriminant 48 conflict (VestingTransferBlocked vs
  PeriodAlreadyClosed); assigned PeriodAlreadyClosed=51
- Added RevoraError::StaleConcentrationData=52
- Fixed test_compute_share_invariants: i128 constant overflow and for-pattern
- Fixed test_claim_transfer_fail: get_pending_periods→get_pending_periods_page,
  missing payout/payment_token args in register_offering/deposit_revenue

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@rosemary21 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 structured-event topic for accrual-index updates so indexers can rebuild ledger

1 participant