-
Notifications
You must be signed in to change notification settings - Fork 79
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(miner)!: remove DEAL_WEIGHT_MULTIPLIER and its input to QAP calc #1574
Conversation
17b9731
to
f81220d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks correct but... it would be nice to run a test on mainnet where we verify that it doesn't change power calculations in any way (if that's not too horribly difficult...).
My concern is mostly due to potential rounding/scaling issues... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you.
I think it would be prudent to add a few tests that spell out the old calculation and verify it gets exactly the same results as the newly modified function.
af6f03f
to
7685ae3
Compare
@anorth I added back in |
464f051
to
a47f724
Compare
a47f724
to
709a6d5
Compare
Updated with even more tests against the original form. Also matching the same tests in filecoin-project/go-state-types#308 but over there we get to test against the actual v14 form of it, which is nice. |
Ref: #1573
As outlined in #1573, as long as
QUALITY_BASE_MULTIPLIER
==DEAL_WEIGHT_MULTIPLIER
then we factor outdeal_space
in QAP calculations. It appears to me from the language of the spec that it was imagined that the "DealWeightMultiplier (DWM)" was something that could be tuned but unless anyone imagines a world where we tinker with anything other than the "VerifiedDealWeightMultiplier (VDWM)" then we should just do away with deal_weight entirely in the calculations to avoid confusion and overhead.In terms of what this does to
quality_for_weight
, here's what I see in that code as it is currently. WhereWSS
isweighted_sum_space_time
,S
issize
,D
isduration
,W
isdeal_weight
andV
isverified_deal_weight
, we end up doing this:Which leads to our QAP result (without precision adjusting):
i.e.
W
appears nowhere in the simplified version. We just do lots of unnecessary calculations with it.You can even see this in the test for the QAP calculation
quality_is_independent_of_size_and_duration
:Substitute
* (DEAL_WEIGHT_MULTIPLIER.clone() / QUALITY_BASE_MULTIPLIER.clone())
with* (10/10)
.It would be nice to take this simplification further and remove all "unverified space" calculations, but
SectorOnChainInfo
still needs it and I guess we should keep it accurate unless we FIP to remove it or set it to zero.