Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add IRM whitelist #59
Add IRM whitelist #59
Changes from all commits
1b48119
2224683
a4d3046
ac5e328
5bc9d6e
e0ce0f5
78c4ca1
5363c1d
36802db
2692eb8
cc22ada
ffc05c2
de937e7
4160f54
93f0f1c
6dd7fca
fe71f20
ab45331
4f9fb84
d6963be
32337d6
79a07d7
2c89aa9
057e0d7
6c1d842
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
It is not completely elegant to have the two in the interface but
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.
Yes it involves a keccack 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 had the same in my PoC: I had to pass the storage pointer aside from its corresponding id, for the same efficiency purposes.
It's not obvious though that keeping the id onto the stack is more efficient than keccaking-it again.
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.
@MerlinEgalite can you give it a try please ?
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.
And do the gas diff as well right?
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.
Crazy, but ok!
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.
weird, SHA3 is 30 gas.. https://www.evm.codes/#20?fork=shanghai
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.
It depends on the size of the input. Here it's the market so
20 bytes * 5 + 32 bytes = 132 bytes.
cost = 75
But I agree there's something else.
Note that
supplyCollateral
gas cost is not changing which is expected.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.
Maybe @Rubilmax you can checkout on both branches to check my results?
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.
According to my tests, computing the id of a market takes 340 gas. It's coherent because we need to load from calldata to memory 6 word of 32 bytes, and hash them. Additionally, there are some Solidity checks, which easily sum up to >300 gas.
But this explanation alone doesn't account for the 1k gas difference - even if we add the costs of the additional jumps. The only plausible explanation I see is that the Solidity compiler adds some additional logic in the second case. Anyway, I'm always in favor of giving the minimum set of arguments required - in this case the id, the irm and the lltv.