Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Iris upgrade #49

Merged
merged 704 commits into from
May 9, 2022
Merged

Iris upgrade #49

merged 704 commits into from
May 9, 2022

Conversation

driemworks
Copy link

  • sync iris with substrate master (substrate v3)
  • upgrade to lastest rust-ipfs version

KiChjang and others added 30 commits February 4, 2022 15:42
* Make some UI test expectations crisper

* Update frame/support/test/tests/construct_runtime_ui/undefined_genesis_config_part.rs

* Update UI test expectations

* Missing newlines

* More whitespace issues
…to API (paritytech#10789)

* is_contract() and caller_is_origin() added to Ext API

* is_contract() exposed in wasm runtime.rs

* + test for is_contract()

* + seal_is_contract benchmark

* caller_is_origin() exposed to wasm/runtime.rs and covered by a test

* + seal_caller_is_origin benchmark

* Update frame/contracts/src/exec.rs

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

* Update frame/contracts/src/exec.rs

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

* Update frame/contracts/src/exec.rs

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

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

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

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

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

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

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

* Update frame/contracts/src/exec.rs

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

* identation fix for benchmark macroses; test cosmetic improvement

* benchmark fix

* + is_contract() wasm test

* + caller_is_origin() wasm test

* Apply suggestions from code review

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

* is_contract() to borrow param instead of taking ownership

* phrasing improved

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

* fixed wasm tests according to @athei feedback

* dead code warnings suppressed by unstable-interface attributes

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Co-authored-by: Alexander Theißen <[email protected]>
Co-authored-by: Hernando Castano <[email protected]>
Co-authored-by: Parity Bot <[email protected]>
* maybe_total_supply in pallet-assets

* Update frame/assets/src/functions.rs

Co-authored-by: Bastian Köcher <[email protected]>
* Initial draft of new referendum state machine.

* Docs

* Fixes

* Fixes

* Add conviction-voting pallet

* Basic build

* Building

* Some TODOs

* Tests building

* Add missing file

* Basic lifecycle test

* Add couple of tests

* Another test

* More tests

* Fixes

* Fixes

* Formatting

* Fixes

* Tests

* Fixes

* Fixes

* More tests

* Formatting

* First few benchmarks

* First few benchmarks

* Defered queue servicing

* More testing

* Benchmarks

* Fiddly benchmark

* Final nudge benchmarks

* Formatting

* Formatting

* Finished up benchmarks

* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_referenda --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/referenda/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Events finished

* Missing file

* No GenesisConfig for Referenda

* Formatting

* Docs

* Docs

* Docs

* Per-class conviction voting

* New test & mock utils

* More tests

* Tests

* Tests finished 🎉

* Benchmarking stuff

* Fixes

* Test harness

* Test harness

* Benchmarks for Conviction=Voting

* Benchmarking pipeline complete

* Docs

* Formatting

* Remove unneeded warning

* Fix UI tests

* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_conviction_voting --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/conviction-voting/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Docs

* Update frame/conviction-voting/src/vote.rs

Co-authored-by: Shawn Tabrizi <[email protected]>

* update sp-runtime version

* MEL Fixes for Referenda and Conviction Voting (paritytech#10725)

* free maxencodedlen

* more maxencodedlen

* more MEL

* more mel

* disable storage info

* More Referenda Patches (paritytech#10760)

* basic fixes

* fix benchmarking

* fix license

* prevent panic in curve math

* fmt

* bump crate versions

* Update mock.rs

Co-authored-by: Parity Bot <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>
* More efficient WASM instance memory decommit on macos

* Apply suggestions from code review

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

* Updated error message

Co-authored-by: Alexander Theißen <[email protected]>
…ritytech#10617)

* seal_call_code implementation

- tests
- benchmark

* Addressing @xgreenx's comments

* Fix test-linux-stable-int

* Rename seal_call_code to seal_delegate_call

* Pass value unchanged into lib contract

* Address @athei's comments

- whitespace .wat issues
- wrong/missing .wat comments
- redundant .wat calls/declarations

- change order of functions (seal_delegate_call right after seal_call)
  in decls, tests, benchmark
- fix comments, move doc comments to enum variants
- remove unnecessary empty lines

- rename runtime cost DelegateCall to DelegateCallBase
- do not set CallFlags::ALLOW_REENTRY for delegate_call

* Do not pass CallFlags::ALLOWS_REENTRY for delegate_call

* Update comment for seal_delegate_call and CallFlags

* Addressing @athei's comments (minor)

* Allow reentry for a new frame after delegate_call (revert)

* Same seal_caller and seal_value_transferred for lib contract

- test
- refactor frame args due to review
- logic for seal_caller (please review)

* Put caller on frame for delegate_call, minor fixes

* Update comment for delegate_call

* Addressing @athei's comments

* Update weights generated by benchmark

* Improve comments

* Address @HCastano's comments

* Update weights, thanks @joao-paulo-parity

* Improve InvalidCallFlags error comment
* atomic swap

* bounties

* bounties fmt

* gilt

* indices

* nicks

* randomness-collective-flip

* recovery

* reuse maxapprovals

* Update tests.rs

* Update frame/randomness-collective-flip/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <[email protected]>

* use the correct bound

* complete recovery

* use `bounded_vec` macro

* Update tests.rs

* transaction payment

* uniques

* mmr

* example offchain worker

* beefy-mmr

* Update frame/recovery/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <[email protected]>

* Use BoundedVec instead of a type-parameterized BoundedString

* cargo fmt

* Update frame/atomic-swap/src/lib.rs

* use config const

* Update lib.rs

* update mel_bound

* fmt

Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Keith Yeung <[email protected]>
* try-runtime-cli: Add to docs of pre/post hooks

* Add note about --ws-max-out-buffer-capacity 1000
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.132 to 1.0.136.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.132...v1.0.136)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ces readable when printing out errors (paritytech#10741)

* Add a new host function for reporting fatal errors

* Fix one of the wasmtime executor tests

* Have `#[runtime_interface(wasm_only)]` actually mean WASM-only, and not no_std-only

* Print out errors through `Display` instead of `Debug`

* Switch one more trait to require `Error` for its error instead of only `Debug`

* Align to review comments
…ference counter. (paritytech#10826)

* bug found

* fix logic

* a little simpler

* add test
…ON` (paritytech#10829)

* UncheckedExtrinsic: Harden decode and clarify `EXTRINSIC_FORMAT_VERSION`

* Apply suggestions from code review
…h#10786)

* pallet-staking: Add extrinsic `force_apply_min_commission`

* Add benchmarks

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Bound iteration by  max_validator_count

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Only apply to 1 validator

* Update doc comments

* Uncomment tests

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Accept signed origins

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Remove contains_key check

* Add test for try_mutate_exists

* Impove try_mutate_exists docs

* Delete redundant try_mutate_exists tests;

* Delete residual from removed test

* cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Return an error when the stash does not exist

* Update try_mutate_exist doc wording

* Update frame/staking/src/pallet/mod.rs

* Apply suggestions from code review

Co-authored-by: Parity Bot <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>
* 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: Alexander Theißen <[email protected]>

* Improve docs

* Improve docs

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

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

* Refactor set_code_hash test

* Minor change to benchmark

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

* Minor change to benchmark

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

* Minor comment refactor

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

* Address @HCastano's comments

* Update seal_set_code_hash comment

Co-authored-by: Hernando 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: Alexander Theißen <[email protected]>
Co-authored-by: Hernando Castano <[email protected]>
…les (paritytech#10563)

* Moves wasmi specific `ImportResolver` and `MemoryTransfer` impls to submodule

* Splits context store environmental, moves impl `Externals` to wasmi backend

* Adds wasmer sandbox backend stub module

* Move sandbox impl code to backend specific modules

* Moves wasmi stuff

* Fixes value conversion

* Makes it all compile

* Remove `with_context_store`

* Moves `WasmerBackend` to the impl

* Reformat the source

* Moves wasmer MemoryWrapper

* Reformats the source

* Fixes mutability

* Moves backend impls to a submodule

* Fix visibility

* Reformat the source

* Feature gate wasmer backend module

* Moves wasmi memory allocation to backend module

* Rename WasmerBackend to Backend

* Refactor dispatch result decoding, get rid of Wasmi types in common sandbox code

* Reformat the source

* Remove redundant prefixes in backend functions

* Remove wasmer-sandbox from default features

* Post-review changes

* Add conversion soundness proof

* Remove redundant prefix

* Removes now redundant clone_inner

* Add `Error::SandboxBackend`, refactor invoke result

* Fix comments

* Rename `Error::SandboxBackend` to `Sandbox`

* Simplifies logic in `wasmer_backend::invoke`

* Fixes memory management
* assets: execute `died` hook outside of mutate

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* assets: extend tests for `died` hook

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* assets: update doc of FrozenBalance::died

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* assets: review fixes

- fix cases where `died` should not have been called
- use `Option<DeadConsequence>` instead of `DeadConsequence`

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* assets: update comment in mock.rs

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* assets: return `Remove` in dead_account

The return value is ignored in the only case that it is produced
by a call, but having it this way makes it more understandable.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
dependabot bot and others added 29 commits April 4, 2022 11:21
Bumps [backtrace](https://github.com/rust-lang/backtrace-rs) from 0.3.63 to 0.3.64.
- [Release notes](https://github.com/rust-lang/backtrace-rs/releases)
- [Commits](rust-lang/backtrace-rs@0.3.63...0.3.64)

---
updated-dependencies:
- dependency-name: backtrace
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [dyn-clone](https://github.com/dtolnay/dyn-clone) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/dtolnay/dyn-clone/releases)
- [Commits](dtolnay/dyn-clone@1.0.4...1.0.5)

---
updated-dependencies:
- dependency-name: dyn-clone
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* transactional: Fix some nitpicks

This fixes some nitpicks related to the transactional storage stuff from me. As everything was
merged too fast, here are some nitpicks from me. First, the entire functionality is moved into its
own file to have a clear separation. Secondly I changed the `set_transactional_level` to not take
`Layer` by reference. Besides that I have added some docs etc.

* Add some comment

* Move tests

* 🤦
* Bump enumflags2 from 0.6.4 to 0.7.4

Bumps [enumflags2](https://github.com/NieDzejkob/enumflags2) from 0.6.4 to 0.7.4.
- [Release notes](https://github.com/NieDzejkob/enumflags2/releases)
- [Commits](meithecatte/enumflags2@v0.6.4...v0.7.4)

---
updated-dependencies:
- dependency-name: enumflags2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* use `#[bitflags]` attribute macro

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shawn Tabrizi <[email protected]>
This pr changes all default execution strategies to `Wasm`. This is basically a deprecation of the
native runtime. While the native runtime isn't removed and can still be used, it will not be used
anymore by default.

This will also improve the usage for people who want to run random commits, which most often forget
to run with `--execution wasm`. Otherwise they often run into storage root mismatches because of
using the native runtime.
* Fix fork-tree descendent check

* Add test assertions for the fix

* Improve documentation

* Nitpicks
* Grandpa revert procedure

* Trigger ci pipeline

* Test rename

* Update client/finality-grandpa/src/authorities.rs

Co-authored-by: André Silva <[email protected]>
* [ci] Remove vault

* remove anchors
* fix(bin/node): remove unsed dep jsonrpsee

* chore(remote ext): update jsonrpsee v0.10.1

* chore(try runtime): update jsonrpsee v0.10.1

* Update utils/frame/try-runtime/cli/src/commands/follow_chain.rs

* cargo fmt
* relax input conditions of fixed::checked_from_integer

* Fix build
…th fee (paritytech#10785)

* Apply WeightToFeePolynomials to length fee

* Remove TransactionByteFee

* Add test cases for ConstantModifierFee

* Restore import

* Use pallet::constant_name

* Remove irrelevant TODO comment

* Update frame/support/src/weights.rs

* Update frame/transaction-payment/src/lib.rs

* Update frame/transaction-payment/src/lib.rs

* Update frame/transaction-payment/src/lib.rs

Co-authored-by: Kian Paimani <[email protected]>

* s/ConstantModifierFee/ConstantMultiplier/

* Impl LengthToFee for test configs

* fmt

* Remove unused import

* Impl WeightToFeePolynomial for byte fee in ExtBuilder

* Remove unused import

* fix doc

Co-authored-by: Bastian Köcher <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>
These docs didn't mention how the removal works internally. This is important for the user to know
that calling such a method multiple times in the same block leads always to the same result.
* Restructure benchmark commands

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add benchmark block test

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fixup imports

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* CI

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Review fixes

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Extend error message

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Apply suggestions from code review

Co-authored-by: Zeke Mostov <[email protected]>

* Review fixes

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add commands to node-template

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

Co-authored-by: Zeke Mostov <[email protected]>
Bumps [impl-trait-for-tuples](https://github.com/bkchr/impl-trait-for-tuples) from 0.2.1 to 0.2.2.
- [Release notes](https://github.com/bkchr/impl-trait-for-tuples/releases)
- [Commits](bkchr/impl-trait-for-tuples@v0.2.1...v0.2.2)

---
updated-dependencies:
- dependency-name: impl-trait-for-tuples
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [lru](https://github.com/jeromefroe/lru-rs) from 0.7.3 to 0.7.5.
- [Release notes](https://github.com/jeromefroe/lru-rs/releases)
- [Changelog](https://github.com/jeromefroe/lru-rs/blob/master/CHANGELOG.md)
- [Commits](jeromefroe/lru-rs@0.7.3...0.7.5)

---
updated-dependencies:
- dependency-name: lru
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… `wasmtime` (paritytech#11189)

* Catch panics on the FFI boundary between the runtime and the host for `wasmtime`

* Use an already existing test runtime function

* Merge the tests together
* Add GHA for custom PR review

* Change FILES rule settings

* Update rules according to feedback

* Update .github/pr-custom-review.yml

Co-authored-by: Denis Pisarev <[email protected]>

* CI: PRCR new 🔒 team is locks-review

* CI: rename a confusing step

* Update .github/workflows/pr-custom-review.yml

Co-authored-by: João Paulo Silva de Souza <[email protected]>

* CI: use a proper new team for 

as per discussion with @drahnr it was decided to create a dedicated team for reviewing runtime files

* Update pr-custom-review.yml

* Update .github/workflows/pr-custom-review.yml

Co-authored-by: João Paulo Silva de Souza <[email protected]>

* Update .github/workflows/pr-custom-review.yml

Co-authored-by: João Paulo Silva de Souza <[email protected]>

Co-authored-by: Denis Pisarev <[email protected]>
Co-authored-by: TriplEight <[email protected]>
Co-authored-by: Denis Pisarev <[email protected]>
Co-authored-by: João Paulo Silva de Souza <[email protected]>
@driemworks driemworks merged commit d9e1429 into ideal-lab5:iris May 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.