Skip to content

Conversation

@ashi20192020
Copy link

βœ„ -----------------------------------------------------------------------------

Thank you for your Pull Request! πŸ™

Before you submit, please check that:

  • Description: You added a brief description of the PR, e.g.:
    • What does it do?
    • What important points should reviewers know?
    • Is there something left for follow-up PRs?
  • Labels: You labeled the PR appropriately if you have permissions to do so:
    • A* for PR status (one required)
    • B* for changelog (one required)
    • C* for release notes (exactly one required)
    • D* for various implications/requirements
    • Github project assignment
  • Related Issues: You mentioned a related issue if this PR is related to it, e.g. Fixes #228 or Related #1337.
  • 2 Reviewers: You asked at least two reviewers to review. If you aren't sure, start with GH suggestions.
  • Style Guide: Your PR adheres to the style guide
    • In particular, mind the maximal line length of 100 (120 in exceptional circumstances).
    • There is no commented code checked in unless necessary.
    • Any panickers in the runtime have a proof or were removed.
  • Runtime Version: You bumped the runtime version if there are breaking changes in the runtime.
  • Docs: You updated any rustdocs which may need to change.
  • Polkadot Companion: Has the PR altered the external API or interfaces used by Polkadot?
    • If so, do you have the corresponding Polkadot PR ready?
    • Optionally: Do you have a corresponding Cumulus PR?

Refer to the contributing guide for details.

After you've read this notice feel free to remove it.
Thank you!

βœ„ -----------------------------------------------------------------------------

shawntabrizi and others added 30 commits January 20, 2022 18:17
When building a wasm binary from a different repo inside a local workspace, we did not used the
correct `Cargo.toml` to find the correct patches and features. The solution to this is to just walk
up from the target directory until we find the workspace we are currently compiling. If this
heuristic isn't working, we print a warning and let the user set an env variable
`WASM_BUILD_WORKSPACE_HINT` to tell the `wasm-builder` where the actual workspace is.
* fix doc

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

* Add MaxEncodedLen to implement_per_thing!

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

* Test that Percent et.al. can be used in Storage.

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

* Add comment

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

* Revert "Test that Percent et.al. can be used in Storage."

This reverts commit 52558af.

* Test MaxEncodedLen in implement_per_thing!

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

* Revert "Add comment"

This reverts commit 27a96f6.
* wip

Signed-off-by: Jimmy Chu <[email protected]>

* Added the rustdocs-release script

Signed-off-by: Jimmy Chu <[email protected]>

* updated gitlab-ci script

Signed-off-by: Jimmy Chu <[email protected]>

* Updated to set NIGHTLY to false by default

Signed-off-by: Jimmy Chu <[email protected]>

* Added documentation

Signed-off-by: Jimmy Chu <[email protected]>
* Remove some last `AccountId32::default()` leftovers

As we removed `Default` of account id, we have overseen some last bits. This pr removes these last
bits.

* Fix
…tytech#10716)

This is required for projects like Cumulus that have dependencies on `westend-runtime`, but this
runtime is only added when the `runtime-benchmarks` feature is enabled. By having all features
"enabled" in `cargo metadata` we ensure that all crates can be found.
* Add optimization flags to 'release' profile

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

* Optimized weights

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

* Add missing pallets

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

* Add `production` profile

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

* pallet-collective: fix tests

the weight of System.remark went to 0, the collective test uses a
remark call to trigger an out-of-gas condition so I replaced it
with a `remark_with_event` call.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
…#10626)

* add a blueprint of how defensive traits could look like

* add something for arithmetic as well

* add some use cases in different pallets

* some build fixing

* Some new stuff and examples

* Fix deadly bug

* add more doc.

* undo faulty change to assets pallet

* Update frame/support/src/traits/misc.rs

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

* some review comments

* remove draft comment

* Fix ident test

* Fix proxy tests as well

* a few new ideas

* Fix build

* Fix doc

Co-authored-by: Oliver Tale-Yazdi <[email protected]>
* use clap3 instead of structopt

Signed-off-by: koushiro <[email protected]>

* format

Signed-off-by: koushiro <[email protected]>

* update ss58-registry and revert some nits

Signed-off-by: koushiro <[email protected]>

* Fix clippy and doc

Signed-off-by: koushiro <[email protected]>

* update clap to 3.0.7

Signed-off-by: koushiro <[email protected]>

* Apply review suggestions

Signed-off-by: koushiro <[email protected]>

* remove useless option long name

Signed-off-by: koushiro <[email protected]>

* cargo fmt

Signed-off-by: koushiro <[email protected]>
* Fix seal_get_storage

* Fix seal_take_storage

* Add more benchmarks

* cargo run --quiet --release --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

* Fix seal_set_storage

* Fix seal_contains_storage and seal_clear_storage

* Fix benchmarks

* cargo run --quiet --release --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

* Get rid of mem::size_of in benchmarks

* Fix up code loading

* Apply suggestions from code review

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

* Fix test to call same function twice

* Replaced u32::MAX by SENTINEL const

* Fix seal_contains_storage benchmark

* 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: Parity Bot <[email protected]>
Co-authored-by: Hernando Castano <[email protected]>
* chore: modified example for balance AccountStore

* add example for account store balance

* add example for account store balance

* Update frame/balances/src/lib.rs

* Update frame/balances/src/lib.rs

* balance account store example

* balance account store example

* Update frame/balances/src/lib.rs

* Update frame/balances/src/lib.rs

* balance account store example

Co-authored-by: Bastian KΓΆcher <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
* Use proper bounded vector type for nominations

* add docs and tweak chill_other for cleanup purposes

* Fix the build

* remove TODO

* add a bit more doc

* even more docs
gushc

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

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

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

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

* Fix the nasty bug

* also bound the Snapshot type

* fix doc test

* document bounded_vec

* self-review

* remove unused

* Fix build

* frame-support: repetition overload for bounded_vec

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

* fix

* remove the need to allocate into unbounded voters etc etc

* Don't expect

* unbreal the build again

* handle macro a bit better

Co-authored-by: Zeke Mostov <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
…ch#10696)

* use thiserror instead of derive_more for error handling

Signed-off-by: koushiro <[email protected]>

* Update utils/prometheus/src/lib.rs

* Update utils/prometheus/src/lib.rs

Co-authored-by: Bastian KΓΆcher <[email protected]>
…it (paritytech#10697)

* basic-authorship: Add new metriscs for block size limit and weight limit

* Review feedback
* update node template from downsteam
template version = 4.0.0-dev
rust setup updated

* Update bin/node-template/runtime/Cargo.toml

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

* Review Rust setup README

* Apply suggestions from code review

Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: Sacha Lansky <[email protected]>
…0663)

* better way to resolve Phase::Emergency via governance

* Update frame/election-provider-multi-phase/src/lib.rs

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

* review grumbles

* Update frame/election-provider-support/src/onchain.rs

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

* revert usize -> u32

Co-authored-by: Zeke Mostov <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>
* Add stale branches heads to finality notifications

Warning. Previous implementation was sending a notification for
each block between the previous (explicitly) finalized block and
the new finalized one (with an hardcoded limit of 256).

Now finality notification is sent only for the new finalized head and it
contains the hash of the new finalized head, new finalized head header,
a list of all the implicitly finalized blocks and a list of stale
branches heads (i.e. the branches heads that are not part of the
canonical chain anymore).

* Add implicitly finalized blocks list to `ChainEvent::Finalized` message

The list contains all the blocks between the previously finalized block
up to the parent of the currently finalized one, sorted by block number.

`Finalized` messages handler, part of the `MaintainedTransactionPool`
implementation for `BasicPool`, still propagate full set of finalized
blocks to the txpool by iterating over implicitly finalized blocks list.

* Rust fmt

* Greedy evaluation of `stale_heads` during finalization

* Fix outdated assumption in a comment

* Removed a test optimization that is no more relevant

The loop was there to prevent sending to
`peer.network.on_block_finalized` the full list of finalized blocks.

Now only the finalized heads are received.

* Last finalized block lookup not required anymore

* Tests for block finality notifications payloads

* Document a bit tricky condition to avoid duplicate finalization notifications

* More idiomatic way to skip an iterator entry

Co-authored-by: Bastian KΓΆcher <[email protected]>

* Cargo fmt iteration

* Typo fix

Co-authored-by: Bastian KΓΆcher <[email protected]>

* Fix potential failure when a finalized orphan block is imported

* Apply suggestions from code review

Co-authored-by: Bastian KΓΆcher <[email protected]>

* Apply suggestions from code review

Co-authored-by: Bastian KΓΆcher <[email protected]>

Co-authored-by: Bastian KΓΆcher <[email protected]>
…tech#10737)

* remote ext: make it possible to pass ws client

* grumbles: introduce `map_uri`
* Add attributes and documentation to fork_id

* Update client/chain-spec/src/chain_spec.rs

Co-authored-by: Sacha Lansky <[email protected]>

Co-authored-by: Sacha Lansky <[email protected]>
* Fix lazy batch contract removal

* Apply suggestions

* Qualify ChildInfo

* Negligible change to restart pipeline

* Revert "Negligible change to restart pipeline"

This reverts commit b38abb6.

* 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: Parity Bot <[email protected]>
* Bump wasm-instrument 0.1.0 -> 0.1.1

* Fix benchmark
* pallet-scheduler: Fix migrations V2 to V3

V2 already supported origins, so we need to move them over instead of setting it to `Root`. Besides
that it also removes the custom `Releases` enum and moves it over to `StorageVersion`.

* Fixes

* Fixes

* 🀦
* Add production profile to wasm builder

* Fix profile detection

* Apply suggestions from code review

Co-authored-by: Bastian KΓΆcher <[email protected]>

* Replace panic! by println! + exit

* Default to `release` for wasm on debug builds

* Replaced unwrap by expect

* Update all weights

Rerun on the bm2 server.

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

* 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: Bastian KΓΆcher <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Parity Bot <[email protected]>
koushiro and others added 21 commits February 8, 2022 08:52
…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]>
* add test

* Assorted refactorings

* complete test

* saturating math

* final check

* use `default`

Co-authored-by: Gav Wood <[email protected]>
Copy link
Member

@mateuszaaa mateuszaaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looked briefly but LGTM

@ashi20192020 ashi20192020 requested a review from mateuszaaa May 17, 2022 15:10
Copy link
Member

@mateuszaaa mateuszaaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please dont merg it yet

@iStrike7 iStrike7 merged commit ffb41fa into mangata-dev Jul 25, 2022
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.