-
Notifications
You must be signed in to change notification settings - Fork 263
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
Implement LazyLoadVersion #148
Conversation
Let me know if this looks correct @liamsi or if there are any cases I need to be aware of. I've successfully tested this in Gaia. |
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.
🌟
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.
The changes look good to me 👍 My only concern is that this adds yet another public method to the API and as a user it might not be clear when to use LazyLoadVersion
over LoadVersion
. A test that showcases the different behaviour, or a comment in the godoc when to use which method might help here. I'm also wondering if LazyLoadVersion
shouldn't be the default (and only) method.
Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>
@liamsi that's a good point. And as you've brought up, I can't think of a reason why one would use If we are in agreement, how about we replace |
Sorry, I don't have any more context on this. Maybe @jaekwon (or @ethanfrey) have?
As far as I understand it does not make sense to load all the roots. I'm OK with replacing |
Okay I am not 100% sure we should replace LoadVersion is not DOSable. LazyLoadVersion is. Ie. Once you load a tree with
|
Valid concerns @zmanian. From doing another pass through of the IAVL implementation and it's relation/usage in the SDK's multistore (I've done this now a few times), I don't quite see where a DOS attack vector could occur? I could very well be wrong here. Here's what I can tell:
|
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'm in favor of replacing LoadVersion entirely at the movement.
Ok so actually taking a stab at replacing The original That being the case, I'm going to leave |
Implement lazy loading of a given version.
ref: cosmos/cosmos-sdk#4326