Skip to content
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

Merged
merged 8 commits into from
Apr 7, 2025

Conversation

Terryhung
Copy link
Collaborator

@Terryhung Terryhung commented Mar 21, 2025

./lily migrate --db="postgres://postgres:postgres@localhost:5432/lily_test?sslmode=disable" --name migration --schema public --to 1.43

@Terryhung Terryhung force-pushed the terryhung/update-lotus-v1.32.0-rc3 branch from 9784acf to f402b45 Compare March 21, 2025 07:45
Comment on lines 231 to 239
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))))
Copy link
Member

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).

@Terryhung Terryhung merged commit 19e09fa into master Apr 7, 2025
7 checks passed
@Terryhung Terryhung deleted the terryhung/update-lotus-v1.32.0-rc3 branch April 7, 2025 02:33
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.

2 participants