filecoin-project / curio

Curio is the next generation of SP software
Other
24 stars 9 forks source link

Fix pledge calc in Commit Submit #138

Open magik6k opened 2 months ago

magik6k commented 2 months ago

Similar to https://github.com/filecoin-project/lotus/pull/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 commented 2 weeks ago

Currently curio contains the custom pledge calculation method similar to lotus-miner (until recently): https://github.com/filecoin-project/curio/blob/8e211f4f90ee26bd69ce91852fde134ff59dce2c/tasks/snap/task_submit.go#L608

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.