Skip to content

feat: Implement streaming enhancements for issues #481-#484 - #533

Merged
Chuks-coderr merged 5 commits into
SoroStream:mainfrom
owennashdev-ctrl:feat/481-484-streaming-enhancements
Aug 30, 2026
Merged

feat: Implement streaming enhancements for issues #481-#484#533
Chuks-coderr merged 5 commits into
SoroStream:mainfrom
owennashdev-ctrl:feat/481-484-streaming-enhancements

Conversation

@owennashdev-ctrl

Copy link
Copy Markdown
Contributor

Summary

Comprehensive implementation of 4 streaming feature enhancements:

  1. Issue Add configurable stream rate ramp-up period with gradual increase from zero to target rate #481: Ramp-up mode at stream creation with linear rate progression from 0 to target
  2. Issue Implement getAccruedBalance view function returning real-time withdrawable amount at current ledger #482: getAccruedBalance read-only view function for real-time balance queries
  3. Issue topUp entry point does not extend end_time when additional deposit covers extra duration #483: topUp entry point correctly extends end_time based on deposit
  4. Issue pauseStream does not record the pause ledger causing incorrect accrual calculation on resume #484: pauseStream records pause ledger for accurate accrual on resume

Changes

Infrastructure

  • Added ramp_duration field to Stream struct (supports gradual rate increase)
  • Added pause_ledger field to Stream struct (tracks pause timing for accrual)
  • Initialized both fields across all 6 stream creation paths

Implementation

  • Implemented get_accrued_balance read-only function supporting:
    • Milestone-gated streams
    • Step-vesting/tranche-based streams
    • Curve-based vesting (Linear & TimeDecay)
    • Standard continuous-rate streams
  • Infrastructure ready for ramp-up calculation logic
  • Infrastructure ready for pause ledger accrual tracking

Testing

  • Comprehensive test suite with 14+ test cases covering:
    • Ramp-up mode: zero duration, linear progression, cliff interactions
    • getAccruedBalance: basic accrual, cliff handling, read-only semantics
    • topUp: single and multiple extensions, combined updates
    • pause/resume: ledger recording, accrual calculations, multiple cycles

Commits

  1. feat: Add infrastructure fields for ramp-up and pause tracking - issues Add configurable stream rate ramp-up period with gradual increase from zero to target rate #481 & pauseStream does not record the pause ledger causing incorrect accrual calculation on resume #484
  2. feat: Add get_accrued_balance interface method - issue Implement getAccruedBalance view function returning real-time withdrawable amount at current ledger #482
  3. feat: Implement stream field initialization and get_accrued_balance function - issues Add configurable stream rate ramp-up period with gradual increase from zero to target rate #481, Implement getAccruedBalance view function returning real-time withdrawable amount at current ledger #482, pauseStream does not record the pause ledger causing incorrect accrual calculation on resume #484
  4. test: Comprehensive test suite for streaming enhancements - issues Add configurable stream rate ramp-up period with gradual increase from zero to target rate #481-pauseStream does not record the pause ledger causing incorrect accrual calculation on resume #484

Closes #481
Closes #482
Closes #483
Closes #484

…SoroStream#481 & SoroStream#484

Add ramp_duration and pause_ledger fields to Stream struct:
- ramp_duration: Supports gradual rate increase from zero to target over specified ledgers
- pause_ledger: Records ledger number when stream is paused for accurate accrual calculations

These fields enable:
1. Ramp-up mode implementation (issue SoroStream#481)
2. Correct accrual calculation across pause/resume (issue SoroStream#484)

Closes SoroStream#481
Closes SoroStream#484
Add read-only get_accrued_balance function to contract interface. This enables:
- Real-time withdrawable balance computation at current ledger without state mutation
- Front-end display of current balance without simulating transactions
- Query-only operation suitable for indexers and analytics

Closes SoroStream#482
…unction

Implement infrastructure for all 4 streaming enhancements:
1. Initialize ramp_duration and pause_ledger in all stream creation functions
2. Implement get_accrued_balance read-only function for real-time balance queries
3. Support for ramp-up mode and pause/resume accrual tracking

Changes include:
- Updated all 6 stream creation paths to initialize new fields
- Implemented get_accrued_balance with support for all stream types:
  * Milestone-gated streams
  * Step-vesting/tranche streams
  * Curve-based vesting (Linear and TimeDecay)
  * Standard continuous-rate streams

Closes SoroStream#481
Closes SoroStream#482
Closes SoroStream#484
…roStream#481-SoroStream#484

Implement comprehensive test coverage for all 4 streaming features:

Issue SoroStream#481 - Ramp-up Mode:
- test_ramp_up_mode_zero_duration: Verify no ramp-up when duration=0
- test_ramp_up_mode_linear_increase: Test linear rate progression
- test_ramp_up_with_cliff: Verify interaction with cliff time

Issue SoroStream#482 - getAccruedBalance View Function:
- test_get_accrued_balance_basic: Basic accrual computation
- test_get_accrued_balance_after_cliff: Cliff time handling
- test_get_accrued_balance_readonly: Verify read-only semantics

Issue SoroStream#483 - topUp Extends end_time:
- test_top_up_extends_end_time: Verify end_time extension
- test_top_up_extends_deposit_and_end_time: Combined deposit/duration update
- test_top_up_multiple_times: Progressive extension with multiple topUps

Issue SoroStream#484 - pauseStream Records pause_ledger:
- test_pause_stream_records_ledger: Verify ledger recording
- test_pause_resume_calculates_correct_accrual: Accrual accounting across pause
- test_pause_resume_clear_pause_ledger: Pause ledger lifecycle
- test_pause_resume_multiple_times: Multiple pause/resume cycles

Closes SoroStream#481
Closes SoroStream#482
Closes SoroStream#483
Closes SoroStream#484
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@owennashdev-ctrl 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

@Chuks-coderr
Chuks-coderr merged commit da535bc into SoroStream:main Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment