Skip to content
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

moved from weighted mean to weighted median #710

Merged
merged 2 commits into from
Feb 23, 2022

Conversation

SamAg19
Copy link
Member

@SamAg19 SamAg19 commented Feb 21, 2022

fixes #709
fixes #666

@coveralls
Copy link

coveralls commented Feb 21, 2022

Coverage Status

Coverage increased (+0.4%) to 96.139% when pulling a0c485a on SamAg19:mad into 5e9e44e on razor-network:master.

@GasCheckBot
Copy link

GasCheckBot commented Feb 21, 2022

Contract Method Current(Maximum) Master(Maximum) Change%(Maximum) Diff(Maximum) Current(Minimum) Master(Minimum) Diff(Minimum) Change%(Minimum)
BlockManager disputeForNonAssignedCollection 180721 180715 +0.00 +6.00 180721 180715 +6.00 +0.00
BlockManager finalizeDispute 168789 170955 -1.27 -2166 145560 147726 -2166 -1.47
BlockManager giveSorted 91199 109291 -16.55 -18092 56416 57888 -1472 -2.54
BlockManager initialize 159493 159494 -0 -1 159481 159482 -1 -0
BlockManager resetDispute 27028 29217 -7.49 -2189 27028 29217 -2189 -7.49

accWeight = accWeight + weight; // denominator: total influence revealed for this collection
accWeight = accWeight + weight; // total influence revealed for this collection
if (disputes[epoch][msg.sender].median == 0 && accWeight > medianWeight) {
disputes[epoch][msg.sender].median = sortedValues[i];
Copy link
Contributor

@0xcuriousapple 0xcuriousapple Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

break here
not possible due to acc weight

@hrishikeshio hrishikeshio merged commit 360be1b into razor-network:master Feb 23, 2022
SkandaBhat added a commit that referenced this pull request Mar 15, 2022
* Increased Coverage on CollectionManager (#715)

* moved from weighted mean to weighted median (#710)

* Natspec added to parameters and random manager (#712)

* natspec changes to randomManager

* natspec added to parameters

* linting fixes

* natspec fixes

* natspec added to internal functions

* lint fixes

* spelling fix

* test: increased test coverage (#725)

* test: increased Coverage on StakeManager and MerklePos (#730)

* docs: natspec added to delegator, block manager and vote manager (#729)

* docs: natspec added to delegator, block manager and vote manager

* docs: natspec fix

* docs: natspec added to events

* docs: natspec fix

* docs: lint fix

* docs: natspec added to staked token contracts (#734)

* feat: add docgen to the project from natspec (#731)

* feat: add docgen to the project from natspec

* fix: fix package.json versions

* fix: fix tests

* chore: fix locks

Co-authored-by: SkandaBhat <bhat.skanda.m@gmaill.com>

* fix: removed require statement from BlockManager (#740)

* test: increased coverage on BlockManager and RandomNoManager (#733)

* test: increased coverage on BlockManager and RandomNoManager

* test: increased coverage on BlockManager added test case

* test: increased coverage on blockManager

* feat: merged from master

* fix: fixed gascompare error

* fix: clean up docgen (#743)

Co-authored-by: SkandaBhat <bhat.skanda.m@gmaill.com>

* fix: only propose revealed assets of epoch (#726)

* fix: only propose revealed assets of epoch

* chore: lint

* fix: medianIndex renamed to activeCollectionIndex

* chore: slither and lint

* chore: silly slither

* fix: scenarios failing

* fix: disputes optimised and one bug with penalties fixed

* docs: added natspec comments

* chore: cleanup

* fix: reveal event updated for node needs

* fix: scenarios test failing

* fix: activeCollectionIndex renamed to leafId

* fix: optmized for calls in loop : slither warning (#745)

Co-authored-by: Gaurav Jain <65170724+GauravJain9@users.noreply.github.com>
Co-authored-by: SamAg19 <52957842+SamAg19@users.noreply.github.com>
Co-authored-by: SkandaBhat <bhat.skanda.m@gmaill.com>
Co-authored-by: Abhishek Vispute <abhivispute33@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fixing blockManager tests Move from mean to weighted median for median calculation
5 participants