-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: update lotus to v1.32.0-rc3 #1338
Conversation
Terryhung
commented
Mar 21, 2025
•
edited
Loading
edited
9784acf
to
f402b45
Compare
expectedReward := big.Mul(sector.ExpectedDayReward, big.NewInt(int64(cappedSectorAge))) | ||
expectedReward := big.Mul(*sector.ExpectedDayReward, big.NewInt(int64(cappedSectorAge))) | ||
// relevant_replaced_age = min(PowerBaseEpoch - Activation, lifetimeCap - cappedSectorAge) | ||
relevantReplacedAge := big.NewInt(int64(min(sector.PowerBaseEpoch-sector.Activation, lifetimeCap-cappedSectorAge))) | ||
// Add the replaced sector's contribution. | ||
expectedReward = big.Add(expectedReward, big.Mul(sector.ReplacedDayReward, relevantReplacedAge)) | ||
expectedReward = big.Add(expectedReward, big.Mul(*sector.ReplacedDayReward, relevantReplacedAge)) | ||
// penalized_reward = expected_reward / TERMINATION_REWARD_FACTOR_DENOM | ||
penalizedReward := big.Div(expectedReward, big.NewInt(int64(TERMINATION_REWARD_FACTOR_DENOM))) | ||
// Termination fee = ExpectedStoragePledge + (penalized_reward / EPOCHS_IN_DAY) | ||
return big.Add(sector.ExpectedStoragePledge, big.Div(penalizedReward, big.NewInt(int64(EPOCHS_IN_DAY)))) | ||
return big.Add(*sector.ExpectedStoragePledge, big.Div(penalizedReward, big.NewInt(int64(EPOCHS_IN_DAY)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beware that these are going to start being nil
from nv25 so you should be careful to guard for them
But also, maybe this should be replaced with a go-state-types variation of this since termination fees have been "simplified" and have a different calculation now. See filecoin-project/go-state-types#376 for some exposed methods that help with this; filecoin-project/lotus#12968 has use of them but also exposes them through the lotus go-state-types abstractions which might be more helpful. See the itest in there for how it can be used (a couple of variations).