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

feat(events): instrument token supply handler PE-6976 #104

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

arielmelendez
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.14%. Comparing base (219fa14) to head (dafa7d1).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #104   +/-   ##
========================================
  Coverage    83.14%   83.14%           
========================================
  Files            8        8           
  Lines         1685     1685           
========================================
  Hits          1401     1401           
  Misses         284      284           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +1384 to +1397
lastKnownTotalSupply = totalSupply
lastKnownCirculatingSupply = circulatingSupply
lastKnownLockedSupply = lockedSupply
lastKnownStakedSupply = stakedSupply
lastKnownDelegatedSupply = delegatedSupply
lastKnownWithdrawSupply = withdrawSupply

msg.ioEvent:addField("Total-Token-Supply", lastKnownTotalSupply)
msg.ioEvent:addField("Circulating-Supply", lastKnownCirculatingSupply)
msg.ioEvent:addField("Locked-Supply", lastKnownLockedSupply)
msg.ioEvent:addField("Staked-Supply", lastKnownStakedSupply)
msg.ioEvent:addField("Delegated-Supply", lastKnownDelegatedSupply)
msg.ioEvent:addField("Withdraw-Supply", lastKnownWithdrawSupply)
msg.ioEvent:addField("Protocol-Balance", protocolBalance)
Copy link
Collaborator

Choose a reason for hiding this comment

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

FWIW - this is mostly used as a dryRun only handler - so it's unlikely to ever surface event data. that being said, we can move the computation to a separate function and call it before/after every write message and add the event data you've added here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was toying with factoring this out and calling it any time functions that affect the supplies get called but I worry that it could get unnecessarily computationally expensive at scale (also from a gas perspective). I haven't ruled it out for ticks so that we get it all at least once a day.

@arielmelendez arielmelendez merged commit a847c80 into develop Oct 17, 2024
4 checks passed
@dtfiedler dtfiedler deleted the PE-6976_supply_events branch October 23, 2024 14:47
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.

3 participants