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 klay_getRewards stakers amount to exclude remainder #1771

Merged
merged 2 commits into from Feb 1, 2023

Conversation

ian0371
Copy link
Contributor

@ian0371 ian0371 commented Feb 1, 2023

Proposed changes

Adjust return values of klay_getRewards so that minted + totalFee - burntFee = proposer + stakers + kgf + kir

  • Deduct shareRem from stakers

Updated output:

{
    "minted": 6400000000000000000,
    "totalFee": 0,
    "burntFee": 0,
    "proposer": 640000000000000001,
    "stakers": 2559999999999999999,
    "kgf": 2560000000000000000,
    "kir": 640000000000000000,
    "rewards": {
        "0x09635f643e140090a9a8dcd712ed6285858cebef": 640000000000000000,
        "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc": 2275555555555555555,
        "0x70997970c51812dc3a010c7d01b50e0d17dc79c8": 284444444444444444,
        "0x7a2088a1bfc9d81c55368ae168c2c02570cb814f": 2560000000000000000,
        "0xb76ff0fe2b836040f67cf84581e9c9d0a5945d6a": 640000000000000001
    }
}

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Related issues

  • Please leave the issue numbers or links related to this PR here.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@ian0371 ian0371 self-assigned this Feb 1, 2023
aidan-kwon
aidan-kwon previously approved these changes Feb 1, 2023
Due to https://go.dev/play/p/CUcu_oCBILj, assertEqualRewardSpecs
compares the json of `struct RewardSpec`.
@ian0371 ian0371 merged commit d520297 into klaytn:dev Feb 1, 2023
@blukat29 blukat29 changed the title Update klay_getRewards Fix klay_getRewards stakers amount to exclude remainder Feb 17, 2023
@ian0371 ian0371 added this to the v1.10.2 milestone Feb 22, 2023
@aidan-kwon aidan-kwon mentioned this pull request Feb 23, 2023
@blukat29 blukat29 mentioned this pull request Mar 3, 2023
9 tasks
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

4 participants