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
DepositableDelegateProxy: optimize for EIP-1884 #551
DepositableDelegateProxy: optimize for EIP-1884 #551
Changes from 5 commits
29d2986
03e6e9e
aa40a2f
6cd3c55
67a7ef4
95c9b54
1975607
948acea
d5bdcb0
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.
Actually, this one is not guaranteeing anything related to the gas amount, I'd call it
itForwardsToImplementation
simply.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's implicitly guaranteeing it as by not setting the gas explicitly, it uses the gas limit value in
truffle.js
, but I think it is a good idea to make it explicit for these testsThere 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.
Nit: perhaps it looks nice to wrap these into Constantinople and Istambul contexts
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 possible to perform a call with value from a contract with less than 2300 gas, as calls that transfer value get a 2300 gas stipend (at the protocol level).
I was doing some debugging and saw that
receiver.transfer()
sets the gas for the call to 0 if the value sent is greater than 0, and if it is 0 the compiler sets the gas for the call to 2300 gas (which is hardcoded in the bytecode). This results in the contract that receives a.transfer
always having at least 2300 gas regardless of whether it is coming from the protocol stipend or from the call being sent with 2300 gas.Even if you do a 'low-level call' (
receiver.call.value(v).gas(g)()
) ifv
is greater than 0, the actual gas that the receiver will be called with is2300 + g
. This makes it impossible to test the Istanbul scenario in which we'd need receiver to be called with1700
gas.