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

Claimed/Unclaimed bounty/fee access #499

Open
lukanus opened this issue Jan 19, 2021 · 1 comment
Open

Claimed/Unclaimed bounty/fee access #499

lukanus opened this issue Jan 19, 2021 · 1 comment

Comments

@lukanus
Copy link

lukanus commented Jan 19, 2021

Hello!

During our work on indexer, we've been trying to reach information about claimed and unclaimed portions of bounty and fee.
This information is available in smart contracts but it's not accessible from external context because the structures are private. It would be great to either have access to that, or have a getter functions to get those values.

Fees

getEarnedFeeAmountOf link is returning current unclaimed fees. And calculating it from _feePaid. _feePaid is updated only on link so it should be consistent to get the value after emit BountyWasPaid(validatorId, amount);.

Bounties

There is no such function as getEarnedBountyAmountOf. the closest to that is getAndUpdateEarnedBountyAmountOf link but this one is not a read only operation. It would be great to have similar one to the fee for getting the amount.
Now, for the updates it is based on few values.

  • _bountyPaid is only updated on BountyWasPaid so we can call it on this.
  • _effectiveDelegatedToValidator (DelegationController.sol) , that updates of that are implicit, we cannot no from events when it got changed
  • _effectiveDelegatedByHolderToValidator (DelegationController.sol) this updates, similarly to the above that are also implicit.
    If there isn't any other place to get this information it would be great to have that in sol and have events on updates of those values to increase observability.

It might be solved in different way, but our need is to have that information, so that we would be able to get claimed and unclaimed fees/bounties for given point in time. And also have ability to track it's time by some events when it's added and deducted.

┆Issue is synchronized with this Jira Task

@gannakulikova
Copy link
Contributor

@lukanus Thank you very much for the details! we will keep you posted with the updates :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants