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

refactor!: Remove proposer-based rewards #12876

Merged
merged 13 commits into from
Aug 16, 2022

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Aug 9, 2022

Description

Remove base and bonus proposer rewards from the x/distribution mechanism.

Changelog

  • Deprecate base and bonus reward fields in Params
  • Bump x/distribution consensus version to 4
  • Refactor Keeper#AllocateTokens to no longer distribute a base and bonus to validators

closes: #12667
closes: #9161


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@github-actions github-actions bot added the C:x/distribution distribution module related label Aug 9, 2022
@@ -28,8 +28,7 @@
// TODO this is Tendermint-dependent
// ref https://github.com/cosmos/cosmos-sdk/issues/3095
if ctx.BlockHeight() > 1 {
previousProposer := k.GetPreviousProposerConsAddr(ctx)
k.AllocateTokens(ctx, sumPreviousPrecommitPower, previousTotalPower, previousProposer, req.LastCommitInfo.GetVotes())
k.AllocateTokens(ctx, previousTotalPower, req.LastCommitInfo.GetVotes())

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

Possible panics in BeginBock- or EndBlock-related consensus methods could cause a chain halt
@faddat
Copy link
Contributor

faddat commented Aug 10, 2022

this makes sense

@julienrbrt
Copy link
Member

julienrbrt commented Aug 10, 2022

Related: #9161

@codecov
Copy link

codecov bot commented Aug 10, 2022

Codecov Report

Merging #12876 (ff55412) into main (fabf739) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12876      +/-   ##
==========================================
- Coverage   55.75%   55.70%   -0.06%     
==========================================
  Files         650      646       -4     
  Lines       55011    54855     -156     
==========================================
- Hits        30674    30558     -116     
+ Misses      21877    21844      -33     
+ Partials     2460     2453       -7     
Impacted Files Coverage Δ
x/distribution/keeper/params.go 75.00% <ø> (-3.58%) ⬇️
x/distribution/module.go 64.28% <ø> (ø)
x/distribution/abci.go 100.00% <100.00%> (ø)
x/distribution/keeper/allocation.go 97.10% <100.00%> (+10.43%) ⬆️
x/distribution/keeper/store.go 51.25% <0.00%> (-2.50%) ⬇️
x/distribution/keeper/keeper.go 79.62% <0.00%> (-1.86%) ⬇️
tx/textual/valuerenderer/valuerenderer.go
tx/textual/valuerenderer/bytes.go
tx/textual/valuerenderer/int.go
... and 2 more

@alexanderbez alexanderbez marked this pull request as ready for review August 10, 2022 14:32
@alexanderbez alexanderbez requested a review from a team as a code owner August 10, 2022 14:32
@julienrbrt
Copy link
Member

Can we delete that test now: 8b32094?

@alexanderbez
Copy link
Contributor Author

Can we delete that test now: 8b32094?

We technically can, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Simulations C:x/distribution distribution module related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove proposer based rewards Proposer reward bug
7 participants