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

consensus, mrc, sidestake: add mrc fees to staker to rewards to be allocated via sidestaking #2753

Merged
merged 2 commits into from
Mar 31, 2024

Conversation

jamescowens
Copy link
Member

@jamescowens jamescowens commented Mar 17, 2024

In V13 testing with simultaneous mrcs and mandatory sidestakes, stakes were being rejected by the reward validation because the calculated total reward to the staker used in SplitCoinStakeOutput did not include mrc fees. This apparently has been an existing omission, but since sidestakes were not validated it went undetected. Now that mandatory sidestakes are validated in terms of both destination and amount, they were being rejected by the validator as being too low.

Adding the mrc fees due to the staker to the staker's reward parameter passed to SplitCoinStakeOutput fixes the problem.

This bug is only relevant for blocks v13 and above, since mandatory sidestakes are not present in v12 and below.

Also listmandatorysidestakes has been added since the older listdata rpc call has been retired with the removal of the remainder of the appcache.

@jamescowens jamescowens requested a review from div72 March 17, 2024 19:40
@jamescowens jamescowens self-assigned this Mar 17, 2024
@jamescowens jamescowens added this to the Natasha milestone Mar 17, 2024
@jamescowens jamescowens changed the title consensus, mrc: add mrc fees to staker to rewards to be allocated via sidestaking consensus, mrc, sidestake: add mrc fees to staker to rewards to be allocated via sidestaking Mar 17, 2024
In V13 testing with simultaneous mrcs and mandatory sidestakes,
stakes were being rejected because the calculated total reward
to the staker did not include mrc fees. This apparently has been
an existing omission, but since sidestakes were not validated it
went undetected. Now that mandatory sidestakes are validated in
terms of both destination and amount, they were being rejected
by the validator as being too low.

Adding the mrc fees due to the staker to the staker's reward
fixes the problem.
@jamescowens jamescowens removed the request for review from div72 March 31, 2024 17:56
@jamescowens jamescowens merged commit 12951c1 into gridcoin-community:development Mar 31, 2024
21 checks passed
jamescowens added a commit to jamescowens/Gridcoin-Research that referenced this pull request Apr 10, 2024
Added
 - build: add option for sanitizers gridcoin-community#2553 (@div72)
 - build: CMake: Initial Windows support (MSYS2) gridcoin-community#2733 (@CyberTailor)

Changed
 - build: enforce SSE2 on x86 targets gridcoin-community#2746 (@div72)
 - consensus: Update checkpoint data for mainnet and testnet gridcoin-community#2756 (@jamescowens)
 - gui, util: Enhance verify checkpoints fail handling; use RegistryBookmarks for DB passivation gridcoin-community#2758 (@jamescowens)

Removed

Fixed
 - build, depends: fix compilation with XCode 15 gridcoin-community#2747 (@div72)
 - Fix man page installation path for cmake builds gridcoin-community#2749 (@theMarix)
 - consensus, mrc, sidestake: add mrc fees to staker to rewards to be allocated via sidestaking gridcoin-community#2753 (@jamescowens)
 - Fix Systemd unit install location gridcoin-community#2754 (@theMarix)
 - scraper: Corrections to scraper_net after removal of cntPartsRcvd decrement and increment gridcoin-community#2755 (@jamescowens)
 - rpc: fix setban segfault gridcoin-community#2757 (@div72)
@jamescowens jamescowens deleted the cleanup_mrc branch July 21, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants