-
Notifications
You must be signed in to change notification settings - Fork 14
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
Pack heap size + array length #75
Conversation
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.
thanks! feel free to close my PR in favor of this one
Can I review after the fix of the conflicts? |
aa22d0a
to
ba7fb9e
Compare
Rebased and updated @MerlinEgalite |
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 don't think we should merge this PR, for the reasons explained in this comment. It would change the data-structure to improve gas consumption, when doing #63 would be better in that regard, and also better because it would spread liquidity evenly. So if we want to change the heap ordering I think we should go all the way and implement #63
given this comment, should we review? @MathisGD @QGarchery |
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.
given this comment, should we review?
Probably not, unless there are other arguments in favor of merging it I think we should close this PR for now
Extension of #73 by @moodlezoup.
Replaces the HeapArray.accounts array with a "virtual array" consisting of a mapping and a uint128 length. This lets us pack the array length and heap size into the same storage slot.
I just added the use of
uint256
as much as possible, preventing Solidity to go back and forth betweenuint128
anduint256
. I also removed useless and costlyelse
.