Skip to content

Use inclusive ramp-start boundary for initial pledge ramp parameters - #7507

Draft
LesnyRumcajs with Copilot wants to merge 2 commits into
mainfrom
copilot/use-inclusive-ramp-start-condition
Draft

Use inclusive ramp-start boundary for initial pledge ramp parameters#7507
LesnyRumcajs with Copilot wants to merge 2 commits into
mainfrom
copilot/use-inclusive-ramp-start-condition

Conversation

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Forest鈥檚 initial pledge ramp-start handling differed at the boundary epoch, which could skip ramp parameters when current_epoch == ramp_start_epoch. This aligns the boundary semantics with the intended inclusive behavior used by Lotus.

  • Ramp-start boundary logic

    • Updated initial pledge ramp parameter selection to treat ramp start as active at the boundary epoch (start <= current), while preserving the existing start > 0 gate.
  • Single-purpose ramp helper

    • Extracted ramp parameter computation into a small helper used by compute_initial_pledge_for_power, making the boundary rule explicit and centralized.
  • Focused boundary regression coverage

    • Added targeted test cases for:
      • ramp disabled (start == 0)
      • pre-start (current < start)
      • boundary (current == start)
      • post-start (current > start)
fn pledge_ramp_params(
    current_epoch: ChainEpoch,
    ramp_start_epoch: ChainEpoch,
    ramp_duration_epochs: u64,
) -> (ChainEpoch, u64) {
    if ramp_start_epoch > 0 && ramp_start_epoch <= current_epoch {
        (current_epoch - ramp_start_epoch, ramp_duration_epochs)
    } else {
        (0, 0)
    }
}

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Co-authored-by: LesnyRumcajs <9642092+LesnyRumcajs@users.noreply.github.com>
Copilot AI changed the title [WIP] Update initial pledge calculation to use inclusive ramp-start condition Use inclusive ramp-start boundary for initial pledge ramp parameters Aug 18, 2026
Copilot AI requested a review from LesnyRumcajs August 18, 2026 18:27
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.

Use inclusive ramp-start condition in initial pledge calculation

3 participants