Skip to content

[DataAvaliability] Add opportunity to extract data from storages #7394

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

Merged
merged 9 commits into from
May 27, 2025

Conversation

illia-malachyn
Copy link
Contributor

@illia-malachyn illia-malachyn commented May 9, 2025

Closes #7378

This PR introduces Data() function that returns a copy of cached data in every storage. Not sure persister will need a copy, but as we use mutexes in the storages, we have to return a copy currently. This can be changed in the future

@illia-malachyn illia-malachyn requested a review from a team as a code owner May 9, 2025 11:42
@codecov-commenter
Copy link

codecov-commenter commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.76%. Comparing base (4cce4e9) to head (13c7cd4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7394      +/-   ##
==========================================
+ Coverage   41.05%   42.76%   +1.70%     
==========================================
  Files        2207     1591     -616     
  Lines      193490   146192   -47298     
==========================================
- Hits        79442    62514   -16928     
+ Misses     107439    78337   -29102     
+ Partials     6609     5341    -1268     
Flag Coverage Δ
unittests 42.76% <100.00%> (+1.70%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -125,3 +125,15 @@ func (t *TransactionResultErrorMessages) Store(

return nil
}

// Data returns a copy of all stored transaction result error messages keyed by block ID.
func (t *TransactionResultErrorMessages) Data() []flow.TransactionResultErrorMessage {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is redundant as we use storage for only 1 block. This ByBlockID func can be used instead. Maybe, there's more such functions.

Copy link
Contributor

@peterargue peterargue left a comment

Choose a reason for hiding this comment

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

added a comment about using consistent naming, otherwise looks good. we can make any needed tweaks when implementing the persister

@Guitarheroua Guitarheroua requested a review from peterargue May 23, 2025 15:48
@peterargue peterargue added this pull request to the merge queue May 27, 2025
Merged via the queue into master with commit 0075514 May 27, 2025
57 checks passed
@peterargue peterargue deleted the illia-malachyn/7378-persister-interface-for-caches branch May 27, 2025 20:22
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.

[DataAvailability] Add methods to expose data in caches
4 participants