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 governance bugs #2133

Merged
merged 5 commits into from
Nov 11, 2023
Merged

Fix governance bugs #2133

merged 5 commits into from
Nov 11, 2023

Conversation

grarco
Copy link
Contributor

@grarco grarco commented Nov 8, 2023

Describe your changes

Closes #1107.

Fixes the is_delegator function in the governance vp which could return true also for validators with self bonds.
Corrects the inflation mechanism for pgf.

Indicate on which release or other PRs this topic is based on

Commit 3a0ecd8 on base (v0.25.0)

Checklist before merging to draft

  • I have added a changelog
  • Git history is in acceptable state

@@ -830,22 +830,23 @@ where
pgf_fundings.sort_by(|a, b| a.id.cmp(&b.id));

for funding in pgf_fundings {
if credit_tokens(
if storage_api::token::transfer(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is complete, we also need to update/change https://github.com/anoma/namada/blob/main/apps/src/lib/node/ledger/shell/finalize_block.rs#L858 - I think we can actually use credit_tokens there, but then we shouldn't send the steward inflation to the PGF account in the first place (https://github.com/anoma/namada/blob/main/apps/src/lib/node/ledger/shell/finalize_block.rs#L812)

) -> Result<bool> {
let bond_handle = pos::namada_proof_of_stake::bond_handle(
Ok(pos::namada_proof_of_stake::is_delegator(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could also add a check if address != delegation_address

@grarco grarco marked this pull request as ready for review November 9, 2023 09:15
@grarco grarco mentioned this pull request Nov 9, 2023
cwgoes
cwgoes previously approved these changes Nov 9, 2023
Copy link
Collaborator

@bengtlofgren bengtlofgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

grarco added a commit that referenced this pull request Nov 9, 2023
@grarco grarco merged commit d3d88a9 into main Nov 11, 2023
14 checks passed
@grarco grarco deleted the grarco/fix-governance-bugs branch November 11, 2023 20:05
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.

is_delegator return true for a validator in Gov VP
4 participants