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

Fix finalizdAllocation and cancelAllocation payments #217

Merged
merged 10 commits into from
May 5, 2021

Conversation

Sriep
Copy link
Contributor

@Sriep Sriep commented Apr 30, 2021

Resolves issue #198

  1. Modify Payments in finalizedAllocation and cancelAllocation.
  2. Merge cut and paste functions to payout to service charge and delegates, and make them global.
  3. Unit test for finalizedAllocation and cancelAllocation.
  4. Deactivate broken unit tests.
  5. Fix spelling cacnel -> cancel.

Modify Payments

  1. finalizedAllocation and cancelAllocation are approximate cut and paste of each other. Common code separated out into a local function finishAllocation.
  2. Pass rate calculations split into two functions, and the result passed to the new finishAllocation. The finalizedAllocation pass rates calculated by converting open requests to failiars.
  3. Min lock demand payments moved ahead of pass rate dependant sharing of the challenge pool.
  4. Blobber service charges payments rationalised.

Merge cut and paste functions

New functions moveReward for paying out service charges and delegate rewards. Replace cut and paste methods challengePool.moveReward and writePool.movePartToStake.

Deactivate broken unit tests

Broken unit tests disabled and added to issue #130

  • Test_finalize_allocation Fails because the challenge pool is less than the min lock demand, unrealistic.
  • Test_flow_no_challenge_responses_finalize Assumes blobbers don't get a reward. PR gives blobbers a service charge.

@Sriep Sriep mentioned this pull request Apr 30, 2021
@guruhubb guruhubb requested review from andrenerd and platsko and removed request for andrenerd May 1, 2021 21:47
@Sriep Sriep merged commit e3f488f into master May 5, 2021
@Sriep Sriep deleted the fix-finish-allocation branch May 5, 2021 16:37
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.

None yet

2 participants