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

Separate accounting for shielded rewards #1730

Closed
Tracked by #2020 ...
cwgoes opened this issue Jul 17, 2023 · 4 comments · Fixed by #3375
Closed
Tracked by #2020 ...

Separate accounting for shielded rewards #1730

cwgoes opened this issue Jul 17, 2023 · 4 comments · Fixed by #3375
Assignees
Labels
breaking:state MASP pre-mainnet Must happen before mainnet.

Comments

@cwgoes
Copy link
Contributor

cwgoes commented Jul 17, 2023

We should keep a counter of all shielded rewards paid (separately from the MASP balance)

cc @bengtlofgren @mariari @juped

@cwgoes cwgoes added the MASP label Jul 17, 2023
@cwgoes
Copy link
Contributor Author

cwgoes commented Jul 17, 2023

We should also test that we can never withdraw more rewards than were originally paid.

@murisi
Copy link
Contributor

murisi commented May 27, 2024

@cwgoes I just want to clarify: is the goal to augment the namadac --balance command to indicate to the user how much of their balance is due to receiving MASP rewards? If so, this would take at most a day. Or do you have something else in mind?

@cwgoes
Copy link
Contributor Author

cwgoes commented May 27, 2024

No - the goal is to track in state (accessible with a distinct query command) the total NAM that have ever been allocated (minted through inflation) to shielded rewards and could potentially be withdrawn by using the convert circuit. It's possible that we even do this already - I'm not sure.

@murisi
Copy link
Contributor

murisi commented May 27, 2024

Ah, I see. This should be straightforward. This is the variable that holds the total reward to be distributed on an epoch boundary:

// The total transparent value of the rewards being distributed
. We just need to accumulate it.

Probably this task can be done in a few hours. Steps:

  • Make new storage key to hold the accumulation of total_reward
  • Make a new client command to query and display this storage key
    • Output would be a single number labelled roughly Total NAM allocated to shielded rewards
    • Since the output is only one number, could we instead just add this output to the namadac --conversions query (which also prints global MASP statistics)?

@tzemanovic tzemanovic self-assigned this Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking:state MASP pre-mainnet Must happen before mainnet.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants