-
Notifications
You must be signed in to change notification settings - Fork 179
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
Remove duplicated top-level EncodableSnapshot
fields
#5884
Remove duplicated top-level EncodableSnapshot
fields
#5884
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5884 +/- ##
=======================================
Coverage 55.79% 55.79%
=======================================
Files 1128 1128
Lines 88998 89021 +23
=======================================
+ Hits 49652 49665 +13
- Misses 34608 34616 +8
- Partials 4738 4740 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
utils/unittest/staker.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contained only unused types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactoring, like the simplification a lot. I think performance is not the issue in this case. The only thing I would tweak is traversing in reverse order in LatestSealedResult
since we already do that for latest seal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice cleanup ✨. Thank you. Added some minor suggestion to reduce some minor ambiguity in the code. Feel free to skip, it if turns into a lot of effort. Not super important, but I think nice to have. Thanks
Co-authored-by: Alexander Hentschel <[email protected]>
…om:onflow/flow-go into jordan/rm-redundant-sealing-segment-fields
This PR removes the
Head
,LatestSeal
, andLatestResult
fields fromEncodableSnapshot
, addressing this outstanding TODO from #5666:In this implementation, I removed the redundant fields and replaced them with getters which searched for the corresponding data in the
SealingSegment
.Head
, it's very fast and easy to find the data inSealingSegment
LatestSeal
, it's relatively fast and a bit more conceptually complex to find the data. In the worst case we might need to search through one non-empty block payload, and hash several seals.LatestResult
, it's relatively easy, but potentially slow to find the data. In the worst case we might search through many block payloads and hash many results.These methods are used sparingly on
inmem.Snapshot
(everything in the critical path usesbadger.Snapshot
, so I don't think the performance regression will have a meaningful impact.