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

Fix pledge calc in Commit Submit #138

Open
magik6k opened this issue Aug 9, 2024 · 2 comments
Open

Fix pledge calc in Commit Submit #138

magik6k opened this issue Aug 9, 2024 · 2 comments

Comments

@magik6k
Copy link
Collaborator

magik6k commented Aug 9, 2024

Similar to filecoin-project/lotus#12341, we use StateMinerInitialPledgeCollateral in https://github.com/filecoin-project/curio/blob/main/tasks/seal/task_submit_commit.go#L239; That method isn't DDO-aware

@rvagg
Copy link
Member

rvagg commented Oct 10, 2024

Currently curio contains the custom pledge calculation method similar to lotus-miner (until recently):

func (s *SubmitTask) pledgeForPower(ctx context.Context, addedPower abi.StoragePower) (abi.TokenAmount, error) {

After NV24 we have FIP-0081 activation which ramps up over a year to always include a 30% simple component, so over the course of the next 12 months the actual pledge will increasingly differ from that estimated by the custom pledge calculation included in Curio which likely lead to underestimations (unless network conditions change I suppose).

Lotus' StateMinerInitialPledgeCollateral has been marked as deprecated, and the new StateMinerInitialPledgeForSector API, which just takes duration, sector size and verified size should be used. This is both DDO-friendly and FIP-0081 aware so should be accurate into the future.

@rvagg
Copy link
Member

rvagg commented Nov 22, 2024

The delta is starting to show up on mainnet now, so it would be good to start using StateMinerInitialPledgeForSector to get the value for this to avoid a mismatch. IIRC there's a 5% slop in this calculation and some handy-wavy overestimations, so it'll probably take some time to catch up but it'll get there.

filecoin-project/FIPs#847 (comment)

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

No branches or pull requests

2 participants