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

Create ManagementContract #2119

Merged
merged 22 commits into from
Dec 9, 2020
Merged

Create ManagementContract #2119

merged 22 commits into from
Dec 9, 2020

Conversation

erikzhang
Copy link
Member

@erikzhang erikzhang commented Dec 4, 2020

  1. Created a new native contract, ManagementContract, to manage all the contracts.
  2. Native contracts can be deployed in any block. The ManagementContract will check their ActiveBlockIndex field.
  3. Moved Contract.Create, Contract.Update, and Contract.Destroy to the native contract as methods.
  4. Moved ContractState and ContractIdState to the native contract as storage entries.

Close #2000
Close #2056

@erikzhang
Copy link
Member Author

@shargon @roman-khimov

@shargon
Copy link
Member

shargon commented Dec 4, 2020

I will fix the UT

@erikzhang
Copy link
Member Author

I will fix the UT

Please wait for me to complete the TODOs.

Do you think this direction is okay?

@shargon
Copy link
Member

shargon commented Dec 4, 2020

Do you think this direction is okay?

I think that it's simpler, the deploy method it was faster in the previous version, but as roman said in the meeting, the cost deserve because it's simpler.

@roman-khimov
Copy link
Contributor

Yeah, it's good.

@erikzhang
Copy link
Member Author

Ready to review. @shargon Please fix the UTs.

@erikzhang erikzhang added this to the NEO 3.0 milestone Dec 4, 2020
@erikzhang
Copy link
Member Author

@neo-project/ngd-shanghai Can you test it?

@superboyiii
Copy link
Member

Why native contracts don't include upgrade method? @erikzhang @shargon

@erikzhang
Copy link
Member Author

Because they are native, they have magic. 🤣

@superboyiii
Copy link
Member

superboyiii commented Dec 9, 2020

Because they are native, they have magic. 🤣

If we include upgrade method in native contract now, then they could avoid storage conflict after upgrading, especially when we resync the histroy data in a new version.

PS: I found it still can't solve this. Upgrade method is not necessary in native SC. 🤣

@shargon
Copy link
Member

shargon commented Dec 9, 2020

We can include upgrade later, if it's necessary

@erikzhang erikzhang merged commit beac9a9 into master Dec 9, 2020
@erikzhang erikzhang deleted the management-contract branch December 9, 2020 04:40
superboyiii added a commit to neo-project/neo-node that referenced this pull request Dec 10, 2020
* Sync to neo-project/neo#2119

* Update nuget

Co-authored-by: Shargon <shargon@gmail.com>
roman-khimov added a commit to nspcc-dev/neo-go that referenced this pull request Dec 13, 2020
Every contract now has these and they're always invoked. See
neo-project/neo#1913 and neo-project/neo#2119.
roman-khimov added a commit to nspcc-dev/neo-go that referenced this pull request Dec 13, 2020
roman-khimov added a commit to nspcc-dev/neo-go that referenced this pull request Dec 13, 2020
roman-khimov added a commit to nspcc-dev/neo-go that referenced this pull request Dec 14, 2020
roman-khimov added a commit to nspcc-dev/neo-go that referenced this pull request Dec 14, 2020
roman-khimov added a commit to nspcc-dev/neo-go that referenced this pull request Dec 14, 2020
roman-khimov added a commit to nspcc-dev/neo-go that referenced this pull request Dec 14, 2020
roman-khimov added a commit to nspcc-dev/neo-go that referenced this pull request Dec 14, 2020
superboyiii added a commit to neo-project/neo-node that referenced this pull request Dec 15, 2020
* Sync to management SC (#689)

* Sync to neo-project/neo#2119

* Update nuget

Co-authored-by: Shargon <shargon@gmail.com>

* Update to Neo v3.0.0-CI01105 (#692)

* Update to Neo v3.0.0-CI01015

* Update neo-cli.csproj

Co-authored-by: Shargon <shargon@gmail.com>
superboyiii added a commit to neo-project/neo-node that referenced this pull request Dec 18, 2020
* Sync to management SC (#689)

* Sync to neo-project/neo#2119

* Update nuget

Co-authored-by: Shargon <shargon@gmail.com>

* Update to Neo v3.0.0-CI01105 (#692)

* Update to Neo v3.0.0-CI01015

* Update neo-cli.csproj

* Update name nep17 (#695)

* Fix Parse manifestFilePath

* merge master

* Update Name for NEP17

* fix format

* show error message

* fix

* fix

Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: cloud8little <34291844+cloud8little@users.noreply.github.com>
shargon added a commit to neo-project/neo-node that referenced this pull request Dec 18, 2020
* Final merge for Preview4 (#693)

* Sync to management SC (#689)

* Sync to neo-project/neo#2119

* Update nuget

Co-authored-by: Shargon <shargon@gmail.com>

* Update to Neo v3.0.0-CI01105 (#692)

* Update to Neo v3.0.0-CI01015

* Update neo-cli.csproj

Co-authored-by: Shargon <shargon@gmail.com>

* Merge from master (#697)

* Sync to management SC (#689)

* Sync to neo-project/neo#2119

* Update nuget

Co-authored-by: Shargon <shargon@gmail.com>

* Update to Neo v3.0.0-CI01105 (#692)

* Update to Neo v3.0.0-CI01015

* Update neo-cli.csproj

* Update name nep17 (#695)

* Fix Parse manifestFilePath

* merge master

* Update Name for NEP17

* fix format

* show error message

* fix

* fix

Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: cloud8little <34291844+cloud8little@users.noreply.github.com>

* Preview4

* sync gui

* update changelog for preview 4 (#699)

Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: cloud8little <34291844+cloud8little@users.noreply.github.com>
Co-authored-by: Qiao Jin <43407364+Qiao-Jin@users.noreply.github.com>
ShawnYun pushed a commit to ShawnYun/neo that referenced this pull request Jan 8, 2021
cloud8little pushed a commit to cloud8little/neo that referenced this pull request Jan 24, 2021
ixje added a commit to CityOfZion/neo-mamba that referenced this pull request Feb 2, 2021
utterly broken after this but not fixing until all preview + preview 5 changes are in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contract to manage contracts
6 participants