filecoin-project / go-state-types

Primitive and low level types used in chain state and actor method parameters
Other
27 stars 37 forks source link

implement the migration for FIP0081 #313

Closed jennijuju closed 1 month ago

jennijuju commented 1 month ago

https://github.com/filecoin-project/builtin-actors/pull/1557

BigLep commented 1 month ago

@rvagg : @rjan90, @ZenGround0 , and I chatted during 2024-09-24 triage. There are two parts to this issue: 1) writing the migration and 2) testing the migration in Lotus. Per https://github.com/orgs/filecoin-project/projects/125/views/1, the migration code (not the Lotus testing) needs to complete by 2024-10-01 ("Actor/FVM Code Freeze"). Can you please take this up when you return?

Separately, @ZenGround0 is going to add notes about how to do the testing and there is also related pledge API updates: https://github.com/filecoin-project/lotus/issues/12494

ZenGround0 commented 1 month ago

Testing on devnets presents some challenges since the mainnet parameter for ramping up the change is 1 year.

Basic test that pledge has changed

We can still probably detect these slight differences in the pledge calculation with these parameters. The approach is to compute both the old and new pledge functions and check that pledge after the migration matches the new function.

Ramp test

In order to efficiently test that the ramping up eventually completes we would need non-mainnet parameters in the power actor state. Today builtin actors does not define the ramp start and ramp duration parameters it only consults the power actor state. The migration code gets to define these parameters. We could change the migration interface to pass these parameters in. Then lotus could keep track of these params, for example as a build constant the same way block time is tracked.

I'm not sure if we need the ramp test given the existing coverage in builtin actors. But it might be better to have the ramp constants defined in lotus then only in the go-state-types migration code.

ZenGround0 commented 1 month ago

Note that we won't expect to see ANY change between the calculations for 1052 epochs (1/1000 * 1 year of epochs) given that fip 0081 is implemented with per mille precision.

rjan90 commented 1 month ago

The PR implementing the migration for FIP-0081 is here: https://github.com/filecoin-project/go-state-types/pull/314