-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Create pure_call.md #195
Create pure_call.md #195
Conversation
Does that mean it can only make pure calls itself? |
Not sure I understand; what do you mean? The EIP as written does not allow the child context to make any calls except for pure precompiles in order to guarantee state independence. I suppose you could allow the child context to itself make PURE_CALLs if you really want to, though there isn't too much additional value gained from that. |
Given how tiny contracts are, it provides a safe way to break a program into small, safe pieces, with all state interaction carefully isolated. |
Ok. I have no problem with allowing pure calls from inside a pure call context; we can do that. |
### Parameters | ||
|
||
* BASE_GAS_COST: 80 | ||
* CODE_BYTES_PER_GAS: 15 |
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.
Assuming we want to switch to EVM 1.5 - is that really the amount of gas we want to charge? Or shall we completely revise the scheme with 1.5?
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.
What revisions do you have in mind?
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.
Perhaps to add some more explanation: In EVM1.5, code that is about to be executed needs to be analyzed and sightly processed first. For regular contracts, this is done once at creation time and we can use the gas from the code deposit to pay for this preprocessing. Here, 15 bytes per gas could be too low for that.
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.
Agreed. Not sure what the right amount is, as the preprocessing can run from simple validation to full compilation.
Please make compliant with EIP-0 (eg, add a header with number/status etc), renumber to EIP 195 (or the issue number), and update in response to any comments, and tag with |
What will |
I would say that |
The EIP says it may make calls to non-state-changing precompiles. For forward compatibility; I'd like to clarify so it's clear that any non-state-changing precompiles that are added in the future are automatically included in the set of allowed precompiles. |
@chriseth yes, actually all auxiliary data including state read/write any calls with the exemption of non-state altering pre compiles will throw. Auxiliary includes address, coinbase, time, difficulty, blockheader, gaslimit |
Also...
|
Isn't that a state reading operation and therefore forbidden?
Is that actually a good idea? I think with time that might result in a very complex list of exceptions for
Also since |
Well, if I remember correctly, all precompiles (including metropolis) are non-state changing. So it would be all precompiles, rather than a list of exceptions. I do see a point in pure calls being able to use e.g. bigint math and ecrecover.
Yes, asides from the precompiles. So what is currently suggested in the EIP, afaict, is
|
Please update to follow the template here and rename to |
|
||
* Adding functional programming features for higher-level languages | ||
* Generally allowing for forms of computation that are safer and can be efficiently optimized/memoized due to their state-independence | ||
* Processing validation code for Casper validators in the future |
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.
Please waive the copyright with CC0.
I think two versions of this instead the current proposed one would make more sense:
Though for 2) practically it would need a new opcode to determine the current context type ( |
This is a courtesy notice to let you know that the format for EIPs has been modified slightly. If you want your draft merged, you will need to make some small changes to how your EIP is formatted:
If your PR is editing an existing EIP rather than creating a new one, this has already been done for you, and you need only rebase your PR. In addition, a continuous build has been setup, which will check your PR against the rules for EIP formatting automatically once you update your PR. This build ensures all required headers are present, as well as performing a number of other checks. Please rebase your PR against the latest master, and edit your PR to use the above format for frontmatter. For convenience, here's a sample header you can copy and adapt:
|
@pipermerriam we should revisit this proposal, specifically @axic's last comment, with @vbuterin in context of Casper |
I propose a different PURECALL that is more like STATICCALL:
I do not like the proposed CODESTART, CODELENGTH parameters proposed above because that is effectively a JUMP without a JUMPDEST. Also the semantics of CALL are well understood. If we wanted the seven-argument opcode as above then I would call the GOTOPURE instead. |
@vbuterin Do you still want to pursue this? If so it will need to be updated to match the latest EIP formatting requirements. |
There has been no activity on this pull request for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review. |
This pull request was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment. |
At
0xf5
, add an opcodePURE_CALL
that takes seven arguments from the stack: GAS, CODESTART, CODELENGTH, DATASTART, DATALENGTH, OUTPUTSTART, OUTPUTLENGTH. Processes a call with the given code and data that cannot read or write state, and pastes the result into the output memory slice.