Skip to content

Instantly share code, notes, and snippets.

@Terryhung
Created May 22, 2025 05:14
Show Gist options
  • Select an option

  • Save Terryhung/70f1ec16f943eb47a5804bac29bad84e to your computer and use it in GitHub Desktop.

Select an option

Save Terryhung/70f1ec16f943eb47a5804bac29bad84e to your computer and use it in GitHub Desktop.

The Flow the from apply_penalty to the Eventual burn

apply_penalty

Where func is called

From fee_debt to burn

After calling apply_penalty, the code further calls State::repay_partial_debt_in_priority_order. This method tries to use unlocked funds to repay fee_debt and returns the actual amount that can be burned.

In methods like dispute_windowed_post, process_early_terminations, or handle_proving_deadline, after penalties are applied, the actor may attempt to repay debt if there are sufficient unlocked funds.

Final burn

After getting to_burn, it calls burn_funds:

rt.send(
    &BURNT_FUNDS_ACTOR_ADDR,
    METHOD_SEND,
    None,
    amount,
)?;

This sends the funds to the burnt funds actor.

Summary

  1. apply_penalty → increases fee_debt
  2. repay_partial_debt_in_priority_order → repays fee_debt, calculates the amount to burn
  3. burn_funds → actually burns the funds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment