Reduce miner state size by removing expected_storage_pledge from sectorOnChainInfo #546
Replies: 5 comments 4 replies
-
@jennijuju Thank you for starting this! I also want to mention that the value in question ( I think a good next step would be to quickly examine the impact of this proposal. I would consider iterating over all sectors in state, and calculate their termination penalty today, and compare it against their termination penalty if we replace |
Beta Was this translation helpful? Give feedback.
-
I haven't gone deep on this, but projecting over 20 days is not identical to projecting over 1 day and multiplying. The projection is a non-linear function. |
Beta Was this translation helpful? Give feedback.
-
I would agree it is doable to simplify the calculation like this: |
Beta Was this translation helpful? Give feedback.
-
Currently these block rewards projections are done using the position and velocity estimates from the alpha-beta filters, for the total new rewards From this it can be quantified what would be lost by replacing Whether this difference is large or small, will depend on the current trends, positions and velocities, as well as what our tolerance is for what we consider small. Another note is that given these formulas, we would need to keep four separate numbers (positions and velocities, or four different time projections), to reproduce from that all the possible time projections we would like. Keeping only one number, however, is not enough information to calculate all other projections from it. |
Beta Was this translation helpful? Give feedback.
-
I don't think we should resolve the issue as written. Instead, we should reconfigure the termination fee calculation to not require any historical inputs and remove them all from sector state at once. |
Beta Was this translation helpful? Give feedback.
-
(discovered in a random convo by @arajasek @ZenGround0 )
Simple summary: It's possible to reduce miner state size by removing expected_storage_pledge from sectorOnChainInfo, and calculate the value of it via
expected_day_reward
* 20 * Epoch_In_Days.In each miner actor, sectors info are stored as a AMT[SectorNumber]SectorOnChainInfo . In SectorOnChainInfo, the following info is stored:
From the description, it seems like
expected_storage_pledge
=expected_day_reward
* 20 * Epoch_In_Days.in built-in actor:
where
INITIAL_PLEDGE_FACTOR
= 20.
two values share the same calculation algo
expected_reward_for_power
and the only difference isprojection_duration
with a 20x difference. So seems like potentially we can remove the expected_storage_pledge from state and just useexpected_day_reward
to calculate it.@ZenGround0 may help confirm the hypothesis, and suggest the potential state savings.
Beta Was this translation helpful? Give feedback.
All reactions