Skip to content
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

Separate init and deployment code #174

Open
chfast opened this issue Feb 6, 2019 · 2 comments
Open

Separate init and deployment code #174

chfast opened this issue Feb 6, 2019 · 2 comments

Comments

@chfast
Copy link
Collaborator

chfast commented Feb 6, 2019

Instead of having single init code that outputs the deployment code change the process of creating new contract accounts as follows:

  1. The "create" message contains the "contract code" which is going to be deployed in the newly created account.
  2. The "create" message optionally has the "init code" which is executed by the VM once and then disposed.

Small details to figure out

  1. Is the "contract code" already deployed when "init code" runs?
  2. When calling itself from "init code" should the "contract code" be executable?

Pros

  1. Much less confusing for dapp devs and users than the current system.
  2. The contract code has to be metered ones (?).
  3. Because the init code is ephemeral, we can make it execution multiple times more expensive to allow to be always executed in interpreters.

Cons

  1. The EVM1 system is more generic (you can do more with it than with the init + contract code).
@axic
Copy link
Member

axic commented Feb 6, 2019

For context, this was discussed between the ewasm and research team as well as it was one of the options before the launch of original Eth 1.0.

@chfast
Copy link
Collaborator Author

chfast commented Feb 6, 2019

For context, this was discussed between the ewasm and research team as well as it was one of the options before the launch of original Eth 1.0.

Yes, this is a consequence of this discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants