Skip to content

Conversation

@grarco
Copy link
Collaborator

@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


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

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)

_delegation_address: &Address,
) -> Result<bool> {
let bond_handle = pos::namada_proof_of_stake::bond_handle(
Ok(pos::namada_proof_of_stake::is_delegator(
Copy link
Collaborator

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
@grarco grarco requested review from Fraccaman and cwgoes November 9, 2023 09:20
cwgoes
cwgoes previously approved these changes Nov 9, 2023
Copy link
Contributor

@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
@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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

is_delegator return true for a validator in Gov VP

5 participants