Skip to content
Commit e70ffbf4 authored by Yarik Bratashchuk's avatar Yarik Bratashchuk Committed by GitHub
Browse files

Upgradable contracts using `set_code` function (#10690)

* poc logic

* set_code_hash impl, tests, benchmark

* Address @xgreenx's comments

* Move func defs closer to set_storage

* Check if code exists

- increment/decrement codehash refcount

* Document error for non-existing code hash

* Revert unrelated change

* Changes due to @athei's review

* Fix error handling

- comment errors: ReturnCodes
- update mock ext implementation
- return Error::CodeNotFound when no code for such hash

* Emit ContractCodeUpdated when setting new code_hash

* Address @athei

's comments

* Move related defs to the bottom

* Minor comment update

Co-authored-by: default avatarAlexander Theißen <[email protected]>

* Improve docs

* Improve docs

* Update frame/contracts/src/wasm/runtime.rs

Co-authored-by: default avatarAlexander Theißen <[email protected]>

* Refactor set_code_hash test

* Minor change to benchmark

Co-authored-by: default avatarAlexander Theißen <[email protected]>

* Minor change to benchmark

Co-authored-by: default avatarAlexander Theißen <[email protected]>

* Minor comment refactor

Co-authored-by: default avatarAlexander Theißen <[email protected]>

* Address @HCastano

's comments

* Update seal_set_code_hash comment

Co-authored-by: default avatarHernando Castano <[email protected]>

* Move set_code_hash after delegate_call

* Move function to the bottom

* Moved and changed banchmark, added verify block

* Bring back previous benchmark

* Remove skip_meta for seal_set_code_hash

* Bring back skip_meta for seal_set_storage_per_new_kb

* Apply weights

Co-authored-by: default avatarAlexander Theißen <[email protected]>
Co-authored-by: default avatarHernando Castano <[email protected]>
parent 83eed801
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment