Commit Graph

67 Commits

Author SHA1 Message Date
Gavin Wood 6bfbb7c6f1 Cleanup our sort usage (#6754) 2020-07-29 14:00:51 +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
Benjamin Kampmann 629a801b6a Fixup cargo unleash (#6689)
* Bumping to rc5

* Revert "Bumping to rc5"

This reverts commit 5a63a8230e5a12db1b4ce4ac62e4967c52291da7.

* Bumping for rc5, correctly this time
2020-07-21 10:26:47 +00:00
Gavin Wood 85e1f9aa8d Treasury burning can be directed (#6671)
* Treasury burning can be directed

Also, Society is a imbalance handler

* Build

* Introduce from_permill in perthings.

* Rename to from_perthousand to avoid confusion with Permill

* Fixes
2020-07-17 12:04:42 +02:00
Benjamin Kampmann f6ebd5f87d Releasing rc4 – Rhinoceros (#6515)
Co-authored-by: Martin Pugh <pugh@s3kr.it>
2020-06-25 23:18:43 +02:00
Guillaume Thiolliere 44fb311f1f Bound Unsigned when signed is not supported. (#6367)
* bound unsigned when necessary

* convert more type to AtLeast32BitUnsigned

* Update primitives/arithmetic/src/traits.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* doc refactor

* line reorganize

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-06-25 11:30:20 +02:00
Kian Paimani e016a49322 Generic Normalize impl for arithmetic and npos-elections (#6374)
* add normalize

* better api for normalize

* Some grumbles

* Update primitives/arithmetic/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* More great review grumbles

* Way better doc for everything.

* Some improvement

* Update primitives/arithmetic/src/lib.rs

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
2020-06-24 13:32:50 +00:00
Arkadiy Paronyan 7b34438178 Validate encoding of extrinsics passed to runtime (#6442)
* Validate encoding of extrinsics passed to runtime

* Bump codec version explicitly
2020-06-19 19:27:16 +00:00
Shaopeng Wang a43a755a91 FixedPointNumber: zero is not positive. (#6385) 2020-06-18 09:35:49 +02:00
Kian Paimani 82bdf1a891 Fix the broken weight multiplier update function (#6334)
* Initial draft, has some todos left

* remove ununsed import

* Apply suggestions from code review

* Some refactors with migration

* Fix more test and cleanup

* Fix for companion

* Apply suggestions from code review

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* Update bin/node/runtime/src/impls.rs

* Fix weight

* Add integrity test

* length is not affected.

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
2020-06-17 13:20:17 +00:00
Benjamin Kampmann 881072e590 Intent to release rc3 (#6290) 2020-06-08 23:29:52 +02:00
Marcio Diaz 7c051caa42 Enable fixed point u128 (#6214)
* Add fixed u128.

* remove move

* Change sat_from_integer impl.

* checked_pow is always positive

* Revert.

* rename fixed file

* Rename to FixedI

* rename fixed file

* Add newline.

* Use Multiplier in impls.

* Renames negate() to saturating_negate().

* Uncomment test.

* Add Signed to macro.

* Add some tests for Saturating trait.
2020-06-06 13:04:39 +02:00
Kian Paimani 8a8b4f99c3 Rename all the election operations (#6245)
* Rename and move sp-phragmen

* More renames for equalise

* Update main module doc

* Fix line width

* Line width
2020-06-05 17:33:13 +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
Alexander Theißen c672cce4bd Make post dispatch fee consistent with a direct calculation (#6165)
* Make post dispatch fee consistent with a direct calculation

* Remove unnecessary `saturated_into` calls

* Add test with negative multipliers

* Added regression test

* Test improvements
2020-05-28 14:33:10 +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
Xiliang Chen c46b2020f2 fix lstrip in biguint (#6151)
* add failing test for multiply_by_rational

* fix BigUint

* fix length

* bump version

* merge tests
2020-05-27 10:18:53 +02:00
Marcio Diaz 288953942e Fix mul_acc. (#6145) 2020-05-26 18:03:29 +02:00
Benjamin Kampmann b64f55089d Releasing rc2 (#6136) 2020-05-26 14:32:23 +02:00
Bastian Köcher 4c138123b4 Make sure fixed arithmetic tests don't rely on debug assertions (#6126) 2020-05-25 18:37:53 +02:00
Benjamin Kampmann fb32ac8c51 Tagging as rc1 2020-05-25 18:30:48 +02:00
Marcio Diaz 72386f609a Implement FixedPoint trait. (#5877)
* Implement Fixed trait.

* Fix tests

* Fix tests

* Fix tests 2

* Address review comment regarding from_i129.

* Remove precision by using log10() as suggested in review.

* Add small comments.

* Use checked versions + panic for ops::*.

* Remove repeated test.

* Uncomment test.

* Remove casts.

* Add more comments.

* Add tests.

* Panic on saturating_div_int

* More tests.

* More docs.

* Saturating renames.

* Fix to_bound doc.

* Move some impl to trait.

* Add range

* Add macro pre.

* More round() tests.

* Delete confusion.

* More impl to trait

* Add doc for fixedpoint op.

* Remove trailing spaces.

* Suggested docs changes.

* More tests and comments for roundings.

* Some quickcheck tests.

* Add missing panic, more test/comments.

* Nits.

* Rename.

* Remove primitives-types import.

* Apply review suggestions

* Fix long lines and add some fuzz.

* fix long line

* Update fuzzer

* Bump impl

* fix warnings

Co-authored-by: Gavin Wood <gavin@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-05-21 19:32:44 +02:00
Benjamin Kampmann 7c565085e9 resetting to -dev (#6050) 2020-05-16 19:03:04 +02:00
Benjamin Kampmann d7463d348f Releasing Alpha.8 (#6048) 2020-05-15 21:56:56 +02:00
Benjamin Kampmann be8c96adec Relax substrate licensing scheme (#5947) 2020-05-15 13:21:56 +02:00
Marcio Diaz a1127f8f9d Fix saturating_mul (#5925) 2020-05-06 17:37:02 +02:00
Benjamin Kampmann 3860999ea3 post release dev reset (#5911) 2020-05-05 22:08:31 +01:00
Benjamin Kampmann 45886bd197 Release of Alpha.7 (#5904) 2020-05-05 20:50:46 +02:00
Bastian Köcher db2e916904 We should panic on division by zero (#5844) 2020-04-30 14:01:48 +02:00
Xiliang Chen fbc4e7f055 fix Fixed64 (#5784)
* fix fixed64

* improve

* bump version
2020-04-26 19:39:16 +02:00
Benjamin Kampmann 37bbe2a319 Exclude sp-*-fuzzer from release process (#5749) 2020-04-24 15:34:22 +02:00
Shawn Tabrizi 276b27a7d4 Add migration for transaction-payment (#5673) 2020-04-17 09:56:17 +02:00
Shawn Tabrizi 980b635c8d Weights to u64 + Balances Weights (#5446)
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-04-16 10:43:18 +02:00
Benjamin Kampmann 3426d662f7 Switch pre-release version to dev (#5637) 2020-04-15 13:18:08 +02:00
Benjamin Kampmann 51f9bb3c0e Prepping release of alpha.6 (#5629)
* bumping version

* cargo update

* adding changelog
2020-04-14 21:41:49 +02:00
Xiliang Chen d1261d3482 Introduce Fixed128 from ORML to sp_arithmetic (#5614)
* add fixed128

* fix build

* re-export

* fix test

* saturating_pow

* Update primitives/arithmetic/src/fixed128.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-04-14 10:07:59 +02:00
Kian Paimani 63e6f81776 Fix Collective <-> Elections initialization. (#5454)
* A patch

* Fix

* Better approach.

* Fix grumbles
2020-03-31 22:40:28 +02:00
Bastian Köcher 21c92dfd29 Check that PerThing valid on decode (#5475) 2020-03-31 20:54:57 +02:00
Nikolay Volf d82a2bf454 pub instead of remove (#5451) 2020-03-30 13:36:24 +02:00
pscott 408455f8bc Build for only one target for docs.rs (#5427)
* Add docs.rs metadata to all cargo.toml files

* Remove docs.rs metada in substrate's cargo.toml
2020-03-30 09:46:30 +02:00
Joseph Mark e8835d64a1 Extend PerThing + Saturating (#5281)
* Extend PerThing + Saturating

* Add saturating_pow to Saturating
* Add saturating_truncating_mul to PerThing (rounding-down mul)
* Add saturating_reciprocal_mul to PerThing (divide x by perthing)
* Provide default methods where possible

* Restore const functions

* Fix test

* Update primitives/arithmetic/src/per_things.rs

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Add comment and test verifying no overflow

* Formatting

* Fix possible overflow and change type constraint

* Use overflow pruning for all mul

* Formatting and comments

* Improve comments and names

* Comments in `rational_mul_correction` explain overflow aversion.

* Test rational_mul_correction

* Formatting

* Docs and formatting

* Add new trait methods to Perthing type impl

* Fix signature

* saturating_pow for Delegations

* Add missing trait method to impl

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-03-29 13:24:11 +02:00
Bastian Köcher 1242a7df3c Upgrade parity-scale-codec to 1.3.0 (#5443) 2020-03-28 22:16:05 +01:00
Bastian Köcher bd5758932b Make all PerThing types implement all trait methods on the type (#5422)
This removes the requirement to import `PerThing` to use a type that
implements the trait.
2020-03-27 11:21:14 +01:00
Kian Paimani 970c5f94f2 Offchain Phragmén BREAKING. (#4517)
* Initial skeleton for offchain phragmen

* Basic compact encoding decoding for results

* add compact files

* Bring back Self::ensure_storage_upgraded();

* Make staking use compact stuff.

* First seemingly working version of reduce, full of todos

* Everything phragmen related works again.

* Signing made easier, still issues.

* Signing from offchain compile fine 😎

* make compact work with staked asssignment

* Evaluation basics are in place.

* Move reduce into crate. Document stuff

* move reduce into no_std

* Add files

* Remove other std deps. Runtime compiles

* Seemingly it is al stable; cycle implemented but not integrated.

* Add fuzzing code.

* Cleanup reduce a bit more.

* a metric ton of tests for staking; wip 🔨

* Implement a lot more of the tests.

* wip getting the unsigned stuff to work

* A bit gleanup for unsigned debug

* Clean and finalize compact code.

* Document reduce.

* Still problems with signing

* We officaly duct taped the transaction submission stuff. 🤓

* Deadlock with keys again

* Runtime builds

* Unsigned test works 🙌

* Some cleanups

* Make all the tests compile and stuff

* Minor cleanup

* fix more merge stuff

* Most tests work again.

* a very nasty bug in reduce

* Fix all integrations

* Fix more todos

* Revamp everything and everything

* Remove bogus test

* Some review grumbles.

* Some fixes

* Fix doc test

* loop for submission

* Fix cli, keyring etc.

* some cleanup

* Fix staking tests again

* fix per-things; bring patches from benchmarking

* better score prediction

* Add fuzzer, more patches.

* Some fixes

* More docs

* Remove unused generics

* Remove max-nominator footgun

* Better fuzzer

* Disable it 

* Bump.

* Another round of self-review

* Refactor a lot

* More major fixes in perThing

* Add new fuzz file

* Update lock

* fix fuzzing code.

* Fix nominator retain test

* Add slashing check

* Update frame/staking/src/tests.rs

Co-Authored-By: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>

* Some formatting nits

* Review comments.

* Fix cargo file

* Almost all tests work again

* Update frame/staking/src/tests.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* Fix review comments

* More review stuff

* Some nits

* Fix new staking / session / babe relation

* Update primitives/phragmen/src/lib.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* Update primitives/phragmen/src/lib.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* Update primitives/phragmen/compact/src/lib.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* Some doc updates to slashing

* Fix derive

* Remove imports

* Remove unimplemented tests

* nits

* Remove dbg

* Better fuzzing params

* Remove unused pref map

* Deferred Slashing/Offence for offchain Phragmen  (#5151)

* Some boilerplate

* Add test

* One more test

* Review comments

* Fix build

* review comments

* fix more

* fix build

* Some cleanups and self-reviews

* More minor self reviews

* Final nits

* Some merge fixes.

* opt comment

* Fix build

* Fix build again.

* Update frame/staking/fuzz/fuzz_targets/submit_solution.rs

Co-Authored-By: Gavin Wood <gavin@parity.io>

* Update frame/staking/src/slashing.rs

Co-Authored-By: Gavin Wood <gavin@parity.io>

* Update frame/staking/src/offchain_election.rs

Co-Authored-By: Gavin Wood <gavin@parity.io>

* Fix review comments

* fix test

* === 🔑 Revamp without staking key.

* final round of changes.

* Fix cargo-deny

* Update frame/staking/src/lib.rs

Co-Authored-By: Gavin Wood <gavin@parity.io>

Co-authored-by: Joshy Orndorff <JoshOrndorff@users.noreply.github.com>
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Gavin Wood <gavin@parity.io>
2020-03-26 15:37:40 +01:00
André Silva e86fedba81 primitives: add missing cargo metadata to sp-arithmetic-fuzzer (#5402)
* primitives: add missing cargo metadata to sp-arithmetic-fuzzer

* ci: add sp-arithmetic-fuzzer to unleash skip list
2020-03-25 19:42:25 +01:00
André Silva 3a136bdcf9 Internal version dependencies cleanup (#5401)
* always depend on latest alpha version

* integrate arithmetic fuzzer into root workspace
2020-03-25 15:02:39 +01:00
Benjamin Kampmann ba06d5ef64 Releasing 2.0.0-alpha.5 (#5340)
* bump pre-version

* Changelog alpha.4->alpha.5

* repo + homepage to sp-consensus-vrf

* Add default rocksdb feature to `frame-benchmarking-cli` (#5367)

* Add default rocksdb feature

* Update Cargo.toml

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-03-24 15:08:02 +01:00
Benjamin Kampmann 0cc54008c8 Update dependencies (#5316)
* switching to released wasmtime

* update depdencies in general

* Update fdlimit

* Update parity common deps

* Also update schnorrkel

* update kvdb-rocksdb

* update further dependents

* also update primitive types

* update cargo.lock

* update merlin

* Bumping evm version
2020-03-19 16:03:26 +01:00
Benjamin Kampmann 25e25a83b9 Releasing 2.0.0-alpha.4 (#5279)
* Version bump

* Split generate_changelog.sh into separate script

Can be run in the format `generate_changelog.sh $previous_version $version`.

* remove early exit from publish_draft_release.sh

* adding changelog

* ci: change last_github_release to also find pre-releases

Co-authored-by: Martin Pugh <pugh@s3kr.it>
2020-03-18 14:37:21 +01:00
Bastian Köcher a1b53280b4 Update to SCALE 1.2.0 (#5113)
This updates `parity-scale-codec` to `1.2.0`, which includes multiple
performance improvements and a fix that bounds the capacity of a vector
at decoding.
2020-03-03 14:40:02 +01:00