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
introduce all the necessary features for reusing contract data memories #11144
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #11144 +/- ##
==========================================
+ Coverage 71.10% 71.11% +0.01%
==========================================
Files 773 773
Lines 154176 154214 +38
Branches 154176 154214 +38
==========================================
+ Hits 109625 109671 +46
+ Misses 40100 40093 -7
+ Partials 4451 4450 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
The untested code lines should become tested once the actual implementation using these new helper functions will land :) |
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.
My bad, had this reviewed last week but forgot to submit the review T_T
pub fn into_preallocated(self) -> Result<PreallocatedMemory, String> { | ||
Ok(PreallocatedMemory( | ||
Arc::into_inner(self.0) | ||
.ok_or("Multiple references to NearVmMemory prevent its reuse")? |
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.
Might be worthwhile to tracing::debug
this too, given that we're unlikely to act on this error.
)?))) | ||
} | ||
|
||
#[cfg(unused)] // TODO: this will be used once we reuse the memories | ||
pub fn into_preallocated(self) -> Result<PreallocatedMemory, String> { |
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.
pub fn into_preallocated(self) -> Result<PreallocatedMemory, String> { | |
pub fn into_preallocated(self) -> Result<PreallocatedMemory, &'static str> { |
No worries and thanks for the review! I haven't managed to finish the subsequent PR anyway. Once the next one is closer to completion, I'll handle your comments and land this one :) |
Closing, as per the results written down in #11033: it turns out the "optimization" is actually slower than the baseline, so there’s no longer any reason to land this code |
With this, all that’s missing should be the contract data memory queue, and checking that the
Arc::into_inner
actually works properly at least most of the time. I’m… not that hopeful about this second precondition, but let’s see what happens with a bit of testing.Part of #11033