-
Notifications
You must be signed in to change notification settings - Fork 85
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
Added MutatedActiveLoan
storage for PoV optimization
#1283
Conversation
I think this change adds a lot of complexity to the code and makes the benchmarks difficult to measure correctly. Please double-check this. Is this PR really really needed if we get #1269 done? |
pub trait BoundedVecExt<T> { | ||
/// Same as [`BoundedVec::try_push()`] but returns a reference to the pushed element in the | ||
/// vector | ||
fn try_push_fetch(&mut self, element: T) -> Result<&mut T, T>; |
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.
A better name for this method?
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.
push_fetch_(trying_to_at_least)
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.
I do not get well what you mean here 🙂
I agree. We should definitely wait till PoV is benched too. And given a second thought, why would this even be a reduction in PoV size? It rather looks like an increase, but maybe I am getting the size impact not correctly For a successful state transition from block
if this assumption is correct, than we will anyways send the whole vector all the time, due to reading. |
I think (or I understand from previous conversations) each extrinsic is measured isolated for the PoV Size. So, for each active loan modification, we are writing now into This increases the PoV Size for |
Ahh, yeah, that is correct and a benchmarking issue... mmh |
cc @lemunozm |
I think we can close it 👍🏻. In case we want to go with this solution we can reopen, although I think the database has changed a lot from this. |
Description
Fixes #1193
Tasks
Changes and Descriptions
MutatedActiveLoans
.loan_id
fromActiveLoan
.Type of change