* frame-system: explicit call index
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Use explicit call indices
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* pallet-template: explicit call index
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* DNM: Temporarily require call_index
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Revert "DNM: Temporarily require call_index"
This reverts commit c4934e312e12af72ca05a8029d7da753a9c99346.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* BREAKING: Rename Origin
* more renaming
* a bit more renaming
* fix
* more fixing
* fix in frame_support
* even more fixes
* fix
* small fix
* ...
* update .stderr
* docs
* update docs
* update docs
* docs
* update api
* update
* remove unused
* remove `one` api
* fix unused
* fmt
* add saturating accrue
* remove `Weight::new()`
* use some macros
* div makes no sense
* Update weight_v2.rs
* missed some
* more patch
* fixes
* more fixes
* more fix
* more fix
* remove RefTimeWeight
* Update frame/contracts/src/storage.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
* not needed
* Fixes
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* update api
* update
* remove unused
* remove `one` api
* fix unused
* fmt
* add saturating accrue
* remove `Weight::new()`
* use some macros
* div makes no sense
* Update weight_v2.rs
* missed some
* more patch
* fixes
* more fixes
* more fix
* more fix
* Update frame/support/src/weights/weight_v2.rs
* not needed
* fix weight file
* Add optimization flags to 'release' profile
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Optimized weights
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add missing pallets
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add `production` profile
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* 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 <oliver.tale-yazdi@parity.io>
* Remove all stale on_runtime_upgrade hooks in the runtime
* add docs
* cleanup
* fix warn
* fix more warnings
* fix offence test
* overwrite the damn UItest
* Changed named fields to struct variants
* Fixed errors.
* Made adjustments as per `cargo +nightly fmt`.
* Update frame/uniques/src/lib.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
* Removed redundant comments for structs.
* Moved frame-support to dev dependencies
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
* Generate one #[test] fn per bench case.
* Update benchmark macro syntax in frame pallets.
* Explain new benchmark macro syntax in example pallet.
* support with and without a semicolon
* update pallets to use individual tests
* migrate staking too
* migrate more pallets
* fix up democracy and use individual tests
* Fix comment
* Put println message in panic
* Remove `another_set_dummy` from doc
`another_set_dummy` is not present in the benchmarking.rs (anymore).
* Update doc for benchmarks macro
* Update doc for impl_benchmark_test_suite macro
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Support multiple, mergable vesting schedules
* Update node runtime
* Remove some TODO design questions and put them as commennts
* Update frame/vesting/src/benchmarking.rs
* Syntax and comment clean up
* Create filter enum for removing schedules
* Dry vesting calls with do_vest
* Improve old benchmarks to account for max schedules
* Update WeightInfo trait and make dummy fns
* Add merge_schedule weights
* Explicitly test multiple vesting scheudles
* Make new vesting tests more more clear
* Apply suggestions from code review
* Update remove_vesting_schedule to error with no index
* Try reduce spacing diff
* Apply suggestions from code review
* Use get on vesting for bounds check; check origin first
* No filter tuple; various simplifications
* unwrap or default when getting user schedules
* spaces be gone
* ReadMe fixes
* Update frame/vesting/src/lib.rs
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
* address some comments for docs
* merge sched docs
* Apply suggestions from code review
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* log error when trying to push to vesting vec
* use let Some, not is_some
* remove_vesting_schedule u32, not optin
* new not try_new, create validate builder; VestingInfo
* Merge prep: break out tests and mock
* Add files forgot to include in merge
* revert some accidental changes to merged files
* Revert remaining accidental file changes
* More revert of accidental file change
* Try to reduce diff on tests
* namespace Vesting; check key when key should not exist;
* ending_block throws error on per_block of 0
* Try improve merge vesting info comment
* Update frame/vesting/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* add validate + correct; handle duration > blocknumber
* Move vesting_info module to its own file
* Seperate Vesting/locks updates from writing
* Add can_add_vesting schedule
* Adjust min vested transfer to be greater than all ED
* Initial integrity test impl
* merge_finished_and_yet_to_be_started_schedules
* Make sure to assert storage items are cleaned up
* Migration initial impl (not tested)
* Correct try-runtime hooks
* Apply suggestions from code review
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* header
* WIP: improve benchmarks
* Benchmarking working
* benchmarking: step over max schedules
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_vesting --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/vesting/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Simplify APIs by accepting vec; convert to bounded on write
* Test: build_genesis_has_storage_version_v1
* Test more error cases
* Hack to get polkadot weights to work; should revert later
* Improve benchmarking; works on polkadot
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_vesting --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/vesting/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* WIP override storage
* Set storage not working example
* Remove unused tests
* VestingInfo: make public, derive MaxEndcodedLen
* Rename ending_block to ending_block_as_balance
* Superificial improvements
* Check for end block infinite, not just duration
* More superficial update
* Update tests
* Test vest with multi schedule
* Don't use half max balance in benchmarks
* Use debug_assert when locked is unexpected 0
* Implement exec_action
* Simplify per_block calc in vesting_info
* VestingInfo.validate in add_vesting_schedule & can_add_vesting_schedule
* Simplify post migrate check
* Remove merge event
* Minor benchmarking updates
* Remove VestingInfo.correct
* per_block accesor max with 1
* Improve comment
* Remoe debug
* Fix add schedule comment
* Apply suggestions from code review
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
* no ref for should_remove param
* Remove unused vestingaction derive
* Asserts to show balance unlock in merge benchmark
* Remove unused imports
* trivial
* Fix benchmark asserts to handle non-multiple of 20 locked
* Add generate_storage_info
* migration :facepalm
* Remove per_block 0 logic
* Update frame/vesting/src/lib.rs
* Do not check for ending later than greatest block
* Apply suggestions from code review
* Benchmarks: simplify vesting schedule creation
* Add log back for migration
* Add note in ext docs explaining that all schedules will vest
* Make integrity test work
* Improve integrity test
* Remove unnescary type param from VestingInfo::new
* Remove unnescary resut for ending_block_as_balance
* Remove T param from ending_block_as_balance
* Reduce visibility of raw_per_block
* Remove unused type param for validate
* update old comment
* Make log a dep; log warn in migrate
* VestingInfo.validate returns Err(()), no T type param
* Try improve report_schedule_updates
* is_valid, not validate
* revert node runtime reorg;
* change schedule validity check to just warning
* Simplify merge_vesting_info return type
* Apply suggestions from code review
* Apply suggestions from code review
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* Add warning for migration
* Fix indentation
* Delete duplicate warnings
* Reduce diff in node runtime
* Fix benchmark build
* Upgrade cargo.toml to use 4.0.0-dev
* Cleanup
* MaxVestingSchedulesGetter initial impl
* MinVestedTransfer getter inintial impl
* Test MaxVestingSchedules & MinVestedTransfer getters; use getters in benchmarks
* Run cargo fmt
* Revert MinVestedTransfer & MaxVestingSchedules getters; Add integrity test
* Make MAX_VESTING_SCHEDULES a const
* fmt
* WIP: benchmark improvements
* Finish benchmark update
* Add test for transfer to account with less than ed
* Rm min_new_account_transfer; move sp-io to dev-dep
* Reduce cargo.toml diff
* Explain MAX_VESTING_SCHEDULES choice
* Fix after merge
* Try fix CI complaints
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_vesting --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/vesting/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_vesting --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/vesting/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* fmt
* trigger
* fmt
Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: kianenigma <kian@parity.io>
* Run cargo fmt on the whole code base
* Second run
* Add CI check
* Fix compilation
* More unnecessary braces
* Handle weights
* Use --all
* Use correct attributes...
* Fix UI tests
* AHHHHHHHHH
* 🤦
* Docs
* Fix compilation
* 🤷
* Please stop
* 🤦 x 2
* More
* make rustfmt.toml consistent with polkadot
Co-authored-by: André Silva <andrerfosilva@gmail.com>
* Use 'Pallet' struct in construct_runtime.
* Fix genesis and metadata macro.
* Fix 'Pallet' type alias.
* Replace 'Module' with 'Pallet' for all construct_runtime use cases.
* Replace more deprecated 'Module' struct.
* Bring back AllModules and AllPalletsWithSystem type, but deprecate them.
* Replace deprecated 'Module' struct from merge master.
* Minor fix.
* Fix UI tests.
* Revert UI override in derive_no_bound.
* Fix more deprecated 'Module' use from master branch.
* Fix more deprecated 'Module' use from master branch.
* Create a macro which automates creation of benchmark test suites.
* bump impl_version
* allow unused on test_bench_by_name
* use proper doctest ignore attribute
* Explicitly hand the Module to the test suite
Much better practice than depending on it showing up implicitly in
the namespace.
* explicitly import what we need into `mod tests`
* bench_module is `ident` not `tt`
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* allow end users to specify arguments for new_test_ext
This turned out to be surprisingly easy. On reflection, it turns out
that of course the compiler can't eagerly evaluate the function call,
but needs to paste it in everywhere desired.
* enable explicitly specifying the path to the benchmarks invocation
also enable optional trailing commas
* Revert "bump impl_version"
This reverts commit 0209e4de33fd43873f8cfc6875815d0fd6151e63.
* list failing benchmark tests and the errors which caused the failure
* harden benchmark tests against internal panics
* suppress warning about ignored profiles
unfortunately, setting the profile here doesn't do anything; we'd
need to set it in every leaf package anyway. However, as this was
just making the default explicit anyway, I think it's safe enough
to remove entirely.
* impl_benchmark_test_suite for assets
* impl_benchmark_test_suite for balances
* impl_benchmark_test_suite for bounties
* impl_benchmark_test_suite for Collective
* impl_benchmark_test_suite for Contracts
* impl_benchmark_test_suite for Democracy
* don't impl_benchmark_test_suite for Elections-Phragmen
* impl_benchmark_test_suite for Identity
Note that Identity tests currently fail. They failed in an identical
way before this change, so as far as I'm concerned, the status quo is
good enough for now.
* impl_benchmark_test_suite for ImOnline
* impl_benchmark_test_suite for indices
For this crate also, the test suite fails identically with and without
this change, so we can say that this change is not the cause of the
tests' failure to compile.
* impl_benchmark_test_suite for lottery
* impl_benchmark_test_suite for merkle-mountain-range
* impl_benchmark_test_suite for Multisig
These tests fail identically with and without the change, so the change
seems unlikely to be the origin of the failures.
* impl_benchmark_test_suite for offences
* impl_benchmark_test_suite for Proxy
Fails identically with and without this change.
* impl_benchmark_test_suite for scheduler
* impl_benchmark_test_suite for session
It turns out to be important to be able to exclude items marked
`#[extra]` sometimes. Who knew?
* impl_benchmark_test_suite for staking
* impl_benchmark_test_suite for system
* impl_benchmark_test_suite for timestamp
* impl_benchmark_test_suite for tips
* impl_benchmark_test_suite for treasury
* impl_benchmark_test_suite for utility
Note that benchmark tests fail identically before and after this change.
* impl_benchmark_test_suite for vesting
* fix wrong module name in impl_benchmark_test_suite in Offences
* address line length nits
* enable optional keyword argument: exec_name
Took a _lot_ of macro-wrangling to get the functionality that I want,
but now you have the option to pass in
```rust
impl_benchmark_test_suite!(
Elections,
crate::tests::ExtBuilder::default().desired_members(13).desired_runners_up(7),
crate::tests::Test,
exec_name = build_and_execute,
);
```
and have it expand out properly. A selected fragment of the expansion:
```rust
fn test_benchmarks() {
crate::tests::ExtBuilder::default()
.desired_members(13)
.desired_runners_up(7)
.build_and_execute(|| {
```
* get rid of dead code
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* commented use of common
* hack to pass tests
* another hack
* remove all commented code
* fix the easy tests
* temp hack
* follow through comma hack until better solution
* patch macro
* missed one
* update benchmarks
* update docs
* fix docs
* removed too much
* fix changes
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>