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

fix: market: use expiry-activation for deal weight calculation #291

Closed rvagg closed 3 months ago

rvagg commented 3 months ago

Ref: https://github.com/filecoin-project/go-state-types/pull/237

This is the same as #237 but on top of master and with v14 included and v12 excluded.

It's a 👍 from me and @magik6k endorsed this on slack and it possibly (but maybe not) addresses a live issue being experienced by lotus-miner @ https://github.com/filecoin-project/lotus/issues/12014

This apparently should have been done with the introduction of allocation term-min term-max.

As per my comment in #239 on the scope of this and what it touches:

In actors we calculate duration the same way: https://github.com/filecoin-project/builtin-actors/blob/8d957d2901c0f2044417c268f0511324f591cb92/actors/miner/src/lib.rs#L5522-L5534

This code gets used in lotus for StateMinerPreCommitDepositForPower here: https://github.com/filecoin-project/lotus/blob/21abfc69fb552b92fa3ce223e863f1d582dec237/node/impl/full/state.go#L1463-L1468

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 3.57%. Comparing base (345ace6) to head (28a49a1).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/filecoin-project/go-state-types/pull/291/graphs/tree.svg?width=650&height=150&src=pr&token=HKKDOH9D3X&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project)](https://app.codecov.io/gh/filecoin-project/go-state-types/pull/291?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project) ```diff @@ Coverage Diff @@ ## master #291 +/- ## ====================================== Coverage 3.57% 3.57% ====================================== Files 520 520 Lines 96959 96959 ====================================== Hits 3468 3468 Misses 92140 92140 Partials 1351 1351 ``` | [Files](https://app.codecov.io/gh/filecoin-project/go-state-types/pull/291?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project) | Coverage Δ | | |---|---|---| | [builtin/v13/market/market\_state.go](https://app.codecov.io/gh/filecoin-project/go-state-types/pull/291?src=pr&el=tree&filepath=builtin%2Fv13%2Fmarket%2Fmarket_state.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project#diff-YnVpbHRpbi92MTMvbWFya2V0L21hcmtldF9zdGF0ZS5nbw==) | `0.00% <0.00%> (ø)` | | | [builtin/v14/market/market\_state.go](https://app.codecov.io/gh/filecoin-project/go-state-types/pull/291?src=pr&el=tree&filepath=builtin%2Fv14%2Fmarket%2Fmarket_state.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project#diff-YnVpbHRpbi92MTQvbWFya2V0L21hcmtldF9zdGF0ZS5nbw==) | `0.00% <0.00%> (ø)` | | | [builtin/v13/market/policy.go](https://app.codecov.io/gh/filecoin-project/go-state-types/pull/291?src=pr&el=tree&filepath=builtin%2Fv13%2Fmarket%2Fpolicy.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project#diff-YnVpbHRpbi92MTMvbWFya2V0L3BvbGljeS5nbw==) | `0.00% <0.00%> (ø)` | | | [builtin/v14/market/policy.go](https://app.codecov.io/gh/filecoin-project/go-state-types/pull/291?src=pr&el=tree&filepath=builtin%2Fv14%2Fmarket%2Fpolicy.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=filecoin-project#diff-YnVpbHRpbi92MTQvbWFya2V0L3BvbGljeS5nbw==) | `0.00% <0.00%> (ø)` | |
rjan90 commented 3 months ago

@aarshkshah1992 Could you give this PR a review today? As I would like to have this together with the final GST v0.14.0 release.