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

Incorrect output of fees_to_staker for rpc getblock/showblock #2566

Closed
iFoggz opened this issue Aug 13, 2022 · 6 comments · Fixed by #2567
Closed

Incorrect output of fees_to_staker for rpc getblock/showblock #2566

iFoggz opened this issue Aug 13, 2022 · 6 comments · Fixed by #2567
Assignees
Milestone

Comments

@iFoggz
Copy link
Member

iFoggz commented Aug 13, 2022

Bug Report

Current behavior
fees_to_staker show erroneous outputs.

Expected behavior
fees_to_staker should be zero unless the staker is receiving fees.

Steps to reproduce:
For instance on MainNet:
showblock 2656056:
however showblock/getblock shows "fees_to_staker": 18.02401069

For instance on TestNet:
showblock 1968886:
however showblock/getblock shows "fees_to_staker": 0.00000320

Screenshots
Not applicable

Gridcoin version
5.4.0.0 release .deb

Machine specs

  • OS: Ubuntu 22.04.01
  • CPU: AMD FX-8800P Radeon R7
  • RAM: 16GB
  • Disk size: 1TB
  • Disk Type (HD/SSD): SSD

Extra information

  • Low impact bug via rpc output (visual bug)
  • Likely leisure fix
@iFoggz iFoggz added the bug label Aug 13, 2022
@jamescowens
Copy link
Member

Interesting. We need to track this down. I may do a non-milestone leisure release even before the hardfork point to fix a few problems that have cropped up. All in all so far this was a pretty smooth release given the changes.

@jamescowens
Copy link
Member

@iFoggz, do you want to take a spin at it?

@iFoggz
Copy link
Member Author

iFoggz commented Aug 13, 2022

i should have some time tomorrow to do so just got home a bit ago and kids have visit with there older sister who in foster care. i may find time tonight as wel.

@iFoggz
Copy link
Member Author

iFoggz commented Aug 13, 2022

i have updated the report. fees_to_staker/fees_collected not really related. so corrected my report on it.

@jamescowens
Copy link
Member

No big big rush I think. But if we can get a fix pinned by the end of the weekend that would be good.

@jamescowens jamescowens added this to the LaVerne milestone Aug 13, 2022
@jamescowens
Copy link
Member

jamescowens commented Aug 14, 2022

The field is misnamed for one.... It should be called mrc_fees_to_staker rather than fees_to_staker, because it is supposed to tally the total fees to the staker from all mrc's in the claim. It is not supposed to include standard transaction fees that are also to the staker. This should be zero for all blocks with no mrcs (which also means any block < v12). Unfortunately I forgot to add a 0 initialzer for the requisite member variable, claim.m_mrc_fees_to_staker. For blocks with mrc's this doesn't matter, because it is assigned the correct value, but for all non-mrc blocks (including all < v12 blocks in 5.4.0.0), it assumes a random value. I will put up a small PR to rename the field so that it is not confusing, and also initialize the field to zero in the claim constructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants