Tomasz Drwięga
39a776cd00
Streamline frame_system weight parametrization ( #6629 )
...
* Basic weights builder.
* Fixing WiP
* Make the tests work.
* Fix weights in node/runtime.
* WiP.
* Update pallets with new weights parameters.
* Validate returns a Result now.
* Count mandatory weight separately.
* DRY
* BREAKING: Updating state root, because of the left-over weight-tracking stuff
* Update tests affected by Mandatory tracking.
* Fixing tests.
* Fix defaults for simple_max
* Update frame/system/src/weights.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Rework the API a bit.
* Fix compilation & tests.
* Apply suggestions from code review
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Add extra docs & rename few things.
* Fix whitespace in ASCII art.
* Update frame/system/src/limits.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Fix max_extrinsic calculations.
* Fix conflicts.
* Fix compilation.
* Fix new code.
* re-remove generic asset
* Fix usage.
* Update state root.
* Update proxy.
* Fix tests.
* Move weights validity to integrity_test
* Remove redundant BlockWeights.
* Add all/non_mandatory comment
* Add test.
* Remove fn block_weights
* Make the macro prettier.
* Fix some docs.
* Make max_total behave more predictabily.
* Add BlockWeights to metadata.
* fix balances test
* Fix utility test.
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org >
Co-authored-by: thiolliere <gui.thiolliere@gmail.com >
2020-12-08 13:18:34 +01:00
Guillaume Thiolliere
15b0dece54
Renames of Trait to Config in README.md, weight templates and few minor ones ( #7636 )
...
* manual rename
* renamse in README.md
* fix template
2020-11-30 20:33:49 +00:00
Guillaume Thiolliere
1cbfc9257f
Rename pallet trait Trait to Config ( #7599 )
...
* rename Trait to Config
* add test asserting using Trait is still valid.
* fix ui tests
2020-11-30 14:34:54 +00:00
Bastian Köcher
5808f467c5
Make Substrate compile with latest nightly ( #7381 )
...
* Try to get it compiling
* One more
* Make stable happy
* Make stable even more happy ;)
* Update shell.nix
2020-10-23 21:08:04 +02:00
Kian Paimani
ba229c629f
Refactor CurrencyToVote ( #6896 )
...
* Refactor CurrencyToVote to avoid calls to total_issuance.
* Update frame/support/src/traits.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Some grumbles
* Fix last grumbles.
* Fix comment
* Final fix
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
2020-10-08 14:50:54 +00:00
Kian Paimani
4d036e0053
Fix offchain election to respect the weight ( #7215 )
...
* Mockup
* Fix offchain election to respect the weight
* Fix builds a bit
* Update frame/staking/src/offchain_election.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* Update frame/staking/src/offchain_election.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* Make it build, binary search
* Fix a number of grumbles
* one more fix.
* remove unwrap.
* better alg.
* Better alg again.
* Final fixes
* Fix
* Rollback to normal
* Final touches.
* Better tests.
* Update frame/staking/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Proper maxExtWeight
* Final fix
* Final fix for the find_voter
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
2020-10-02 13:45:17 +00:00
Bastian Köcher
86594727d9
Rename ModuleToIndex to PalletRuntimeSetup ( #7148 )
...
* Rename `ModuleToIndex` to `PalletRuntimeSetup`
Besides the renaming it also adds support getting the name of a pallet
as configured in the runtime.
* Rename it to `PalletInfo`
* Remove accidentally added files
2020-09-22 13:39:56 +00:00
Shawn Tabrizi
9e9e34fad8
WeightInfo for Session Pallet ( #7136 )
...
* whitelist caller in benchmarks
* remove unused component
* Add benchmark weights
* Remove `weightinfo` for `offences`
2020-09-21 09:13:31 +00:00
Shawn Tabrizi
9aa8698cfc
WeightInfo for Vesting Pallet ( #7103 )
...
* WeightInfo for Vesting Pallet
* clean up weight docs
* Update lib.rs
* try to pipe max locks
* Update for new type
* add warning when locks > MaxLocks
* Update lib.rs
* fix compile
* remove aliasing, fix trait def
* Update
2020-09-16 19:48:10 +00:00
Shawn Tabrizi
e69d12e76c
Support Staking Payout to Any Account ( #6832 )
...
* Support staking payout to any account
* fix offences benchmarks
2020-08-26 18:26:33 +02:00
pscott
046fda914a
Improve overall performance ( #6699 )
...
* Improve overall performance
* Clean up code
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Remove needless ::
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Remove needless ::
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2020-07-21 14:46:49 +02:00
André Silva
ae38a806ed
grandpa: report equivocations with unsigned extrinsics ( #6656 )
...
* grandpa: use unsigned extrinsics for equivocation reporting
* grandpa: allow signed reports as well
* grandpa: change runtime api for submitting unsigned extrinsics
* grandpa: fix tests
* grandpa: add test for unsigned validation
* grandpa: add benchmark for equivocation proof checking
* offences: fix grandpa benchmark
* grandpa: add proper weight for equivocation reporting extrinsic
* grandpa: fix weight unit
2020-07-17 12:32:20 +02:00
Shawn Tabrizi
2302898b8a
Add WeightInfo to all pallets with benchmarks. ( #6575 )
...
* Start adding weight info
* More weightinfo
* finish weight info
* more fixes
* inital update of node runtime
* fix the rest of the compilation
* update balances
* add docs
* fix balances tests
* Fix more tests
* Fix compile
* Fix pallet-evm tests
2020-07-08 18:22:01 +02:00
André Silva
a9c21b8b84
babe: report equivocations ( #6362 )
...
* slots: create primitives crate for consensus slots
* offences: add method to check if an offence is unknown
* babe: initial equivocation reporting implementation
* babe: organize imports
* babe: working equivocation reporting
* babe: add slot number to equivocation proof
* session: move duplicate traits to session primitives
* babe: move equivocation stuff to its own file
* offences: fix test
* session: don't have primitives depend on frame_support
* babe: use opaque type for key owner proof
* babe: cleanup client equivocation reporting
* babe: cleanup equivocation code in pallet
* babe: allow sending signed equivocation reports
* node: fix compilation
* fix test compilation
* babe: return bool on check_equivocation_proof
* babe: add test for equivocation reporting
* babe: add more tests
* babe: add test for validate unsigned
* babe: take slot number in generate_key_ownership_proof API
* babe: add benchmark for equivocation proof checking
* session: add benchmark for membership proof checking
* offences: fix babe benchmark
* babe: add weights based on benchmark results
* babe: adjust weights after benchmarking on reference hardware
* babe: reorder checks in check_and_report_equivocation
2020-07-04 12:18:13 +02:00
Guillaume Thiolliere
c2ad27271b
Introduce in-origin filtering ( #6318 )
...
* impl filter in origin
* remove IsCallable usage. Breaking: utility::batch(root, calls) no longer bypass BasicCallFilter
* rename BasicCallFilter -> BaseCallFilter
* refactor code
* Apply suggestions from code review
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* remove forgotten temporar comment
* better add suggestion in another PR
* refactor: use Clone instead of mem::replace
* fix tests
* fix tests
* fix tests
* fix benchmarks
* Make root bypass filter in utility::batch
* fix unused imports
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2020-06-15 17:05:41 +02:00
Kian Paimani
0eec4bb795
Accept new Phragmén solutions if they are epsilon better + Better pre-inclusion checks. ( #6173 )
...
* part1: Accept inly epsilon better solutions
* Fix pre-dispatch check
* Fix build
* review grumbles
* Epsilon -> Threshold
2020-06-02 17:22:56 +02:00
Kian Paimani
8279ba96df
Make Get<T> const friendly + Clean the runtime files a bit. ( #6132 )
...
* Make Get const friendly
* Better doc
* Grumble
* Better doc
* Clean runtime files more
2020-05-27 14:40:07 +02:00
Shawn Tabrizi
ac049a97be
Offences Weight for OnInitialize ( #5961 )
...
* Weight accounting for on_offence.
* Try to compute weight.
* Guesstimate upper bounds on db read/writes for slashing
* greater than or equal to
* add new trait
* Update mock.rs
* Add basic weight test
* one more test
* Update frame/staking/src/lib.rs
Co-authored-by: thiolliere <gui.thiolliere@gmail.com >
* Update frame/staking/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Add test for offences queue
Co-authored-by: Tomasz Drwięga <tomasz@parity.io >
Co-authored-by: thiolliere <gui.thiolliere@gmail.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2020-05-21 14:00:24 +02:00
Tomasz Drwięga
f74a7171be
Maximum extrinsic weight limit ( #6067 )
...
* Only check single extrinsics weight limit in validate_transaction.
* Add missing parameter to all pallets.
* Add tests, fix default configuration.
* Bump spec version.
* Use AvailableBlockRation to calculate MaxExtrinsicWeight
2020-05-20 15:05:16 +02:00
Benjamin Kampmann
be8c96adec
Relax substrate licensing scheme ( #5947 )
2020-05-15 13:21:56 +02:00
Tomasz Drwięga
66c02fe651
Benchmarks for offences pallet. ( #5851 )
...
* really rough mock runtime
* start to work on offences
* Make sure to start the session.
* Update to latest master.
* Add verify.
* Fix on_initialize benchmark.
* Add grandpa offence.
* Add Babe offence benchmarking.
* Enable babe test.
* Address review grumbles.
* Address review grumbles.
* Address review grumbles part 1/2
* use currency trait
* features
* Check events explicitly.
* Auto-impl tuple converter.
* Removed dead code.
* add test feature flag
* dont use std
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2020-05-06 14:27:47 +02:00
Marcio Diaz
fb9bbf306d
Benchmark Offences Pallet ( #5411 )
...
* Add initial report_ofence bench.
* Remove unused imports
* Style nit
* Add nominators
* Remove logs.
* Nits.
* Add nominators param.
* Reorg, comment.
* Remove whitespaces.
* Apply review suggestion: move benchmark to own crate.
* Remove import.
* Remove line.
* Add feature flag.
* Pass can_report.
* Cleaning up.
* More cleaning
2020-04-07 11:36:57 +02:00