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

NEP Dynamic Invoke #19

Merged
merged 22 commits into from
Dec 13, 2017
Merged

Conversation

localhuman
Copy link
Contributor

This NEP Proposal outlines a mechanism whereby a Smart Contract is provided the ability to invoke other Smart Contracts not known until runtime, rather than being limited to invoking only Smart Contracts that are defined at compile time. In order to retain the ability for Smart Contracts to interface with a future Dynamic Sharding process, included is a proposed specification to be used in the creation of Smart Contracts to denote whether a Smart Contract needs the Dynamic Contract Invocation feature or not.

localhuman and others added 15 commits November 6, 2017 22:15
This is really great! I did a quick edit pass to fill in some sharding details. I also think `deterministic` is not the right word to be using here, as execution is deterministic either way, with dynamic calls or not. The problem is how much static analysis we can do in advance, to shard resources appropriately.
Update nep-dynamic-invoke.mediawiki
@erikzhang
Copy link
Member

Does dynamic invocation cost more fees?

Added sample implementation for an updated fee schedule.
@localhuman
Copy link
Contributor Author

It is my opinion that using the DYNAMICCALL should cost more than APPCALL or TAILCALL. I also believe that publishing an SC with the HasDynamicInvoke should cost more than publishing one without that feature.

@erikzhang
Copy link
Member

So should SC with HasStorage cost more than SC without HasStorage?

@localhuman
Copy link
Contributor Author

I think that would make sense.

@erikzhang
Copy link
Member

What about this:

  1. Every contract that be deployed costs 100 gas, this is the basic cost.
  2. If it has a HasStorage flag, the cost is increased by 400 gas.
  3. If it has a HasDynamicInvoke flag, the cost is increased by 500 gas.

@localhuman
Copy link
Contributor Author

That sounds about right. I will update the proposal with those figures.

@localhuman
Copy link
Contributor Author

Updated the fee structure, and removed the section of code demonstrating that the cost of a DYNAMICCALL would cost more than an APPCALL.

@erikzhang
Copy link
Member

perfect

@localhuman
Copy link
Contributor Author

I've updated the NEP number in the proposal to 4 🎉
Is it ok to begin implementation?

@erikzhang
Copy link
Member

Yes, let's do it!

@erikzhang erikzhang merged commit e7b84dd into neo-project:master Dec 13, 2017
@erikzhang
Copy link
Member

@localhuman Since we don't have an opcode DYNAMICCALL, can you edit the NEP to correct it?

@localhuman
Copy link
Contributor Author

Yes, will do!

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

Successfully merging this pull request may close these issues.

3 participants