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(gar): optimize prescribed observers, use lookup table and comput… #279

Merged
merged 14 commits into from
Dec 17, 2024

Conversation

dtfiedler
Copy link
Collaborator

…e full array on read handlers

@codecov-commenter
Copy link

codecov-commenter commented Dec 17, 2024

Codecov Report

Attention: Patch coverage is 97.29730% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.42%. Comparing base (a620d4c) to head (f02067b).

Files with missing lines Patch % Lines
src/epochs.lua 97.05% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #279      +/-   ##
===========================================
- Coverage    94.45%   94.42%   -0.04%     
===========================================
  Files           10       10              
  Lines         2975     2976       +1     
===========================================
  Hits          2810     2810              
- Misses         165      166       +1     

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

@dtfiedler dtfiedler marked this pull request as ready for review December 17, 2024 15:16
@dtfiedler
Copy link
Collaborator Author

dtfiedler commented Dec 17, 2024

Note: the type in the SDK will change, but it was outdated already. It is also not used by any of our downstream apps.

Related: ar-io/ar-io-sdk#318

Comment on lines +601 to +604
if msg.From == ao.id then
LastKnownCirculatingSupply = LastKnownCirculatingSupply + quantity
addSupplyData(msg.ioEvent)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, saw some test errors when looking into that beforeEAch mystery that might be related to this fix

assert(providedEpochIndex or timestamp, "Epoch index or timestamp is required")

local epochIndex = providedEpochIndex or epochs.getEpochIndexForTimestamp(timestamp)
local epochIndex = msg.Tags["Epoch-Index"] and tonumber(msg.Tags["Epoch-Index"])
Copy link
Contributor

Choose a reason for hiding this comment

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

is epoch-index already sanitized as number?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@fedellen fedellen left a comment

Choose a reason for hiding this comment

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

Looks good -- I think its ready but needs re-integration with latest develop

fedellen
fedellen previously approved these changes Dec 17, 2024
@dtfiedler
Copy link
Collaborator Author

just FYI - it'll take 14 epochs to prune out all the old state of previous epochs. As mentioned, this type is not used externally anywhere so no breaking change.

@dtfiedler dtfiedler merged commit d7132d9 into develop Dec 17, 2024
5 checks passed
@dtfiedler dtfiedler deleted the PE-7203-prescribed-obsever-lookups branch December 17, 2024 23:20
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