Commit Graph

548 Commits

Author SHA1 Message Date
Shaopeng Wang a6702b7121 decl_module! macro: use 'frame_system' instead of system as default ident (#6500)
* Use frame_system as default ident.

* Remove unused 'frame_system' to 'system' renaming.

* Fix construct_runtime_ui tests.

* Rename system to frame_system in sudo/utility pallet test.

* Bump runtime impl_version.

* Update formatting.
2020-07-07 23:06:21 +00:00
Bastian Köcher ad2e832289 Don't require module name in inherents (#6576)
* Start

* Cleanup `construct_runtime!`

* Add tests

* Fix after merge

* Update the docs
2020-07-06 10:29:17 +00:00
Shawn Tabrizi 2019f70768 Benchmarks Writer CLI (#6567)
* initial mockup

* add and wipe

* track writes

* start to add to pipeline

* return all reads/writes

* Log reads and writes from bench db

* causes panic

* Allow multiple commits

* commit before ending benchmark

* doesn't work???

* fix

* Update lib.rs

* switch to struct for `BenchmarkResults`

* add to output

* fix test

* line width

* @kianenigma review

* Add Whitelist to DB Tracking in Benchmarks Pipeline (#6405)

* hardcoded whitelist

* Add whitelist to pipeline

* Remove whitelist pipeline from CLI, add to runtime

* clean-up unused db initialized whitelist

* Add regression analysis to DB Tracking (#6475)

* Add selector

* add tests

* debug formatter for easy formula

* initial idea

* use all benchmarks

* broken

* working without trait

* Make work for multiple pallets

* Fix merge issues

* writer appends to file

* implement () for balances weight trait

* update name of trait

* Weights to WeightInfo

* auto trait writer

* Heap pages are configurable

* clean out runtime changes

* more clean up

* Fix string generation

* Update comments

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

Co-authored-by: arkpar <arkady.paronyan@gmail.com>
2020-07-06 09:34:24 +00: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
Xiliang Chen e1d0f84c67 Allow specify schedule dispatch origin (#6387)
* allow specify schedule dispatch origin

* fix tests

* use caller origin for scheduled

* fix tests

* line width

* check origin for cancel

* line width

* fix some issues for benchmarking

* fix doc test

* another way to constraint origin

* fix build issues

* fix cancel

* line width

* fix benchmarks

* bump version

* enable runtime upgrade

* add migration code and test

* Update frame/scheduler/src/lib.rs

Co-authored-by: Gavin Wood <github@gavwood.com>

* expose migration method

* add notes

* bump version

* remove on_runtime_upgrade

* fix test

Co-authored-by: Gavin Wood <github@gavwood.com>
2020-07-02 15:05:15 +02:00
Shawn Tabrizi 2e2af4b05a Allow retract_tip on tip_new (#6511)
* Allow `retract_tip` on `tip_new`

* initial migration code

* test migration

* make pub

* bump spec
2020-06-29 13:59:32 +00:00
Xiliang Chen dd3333f8b4 Implement Contains for pallet-membership (#6518)
* implement Contains for pallet-membership

* bump version
2020-06-26 15:37:45 +02:00
Ricardo Rius 59af5d6eae Change contract fees to MILLICENTS (#6509) 2020-06-25 15:46:18 +00:00
Shawn Tabrizi 935ee6f545 Add DB Read/Write Tracking to Benchmarking Pipeline (#6386)
* initial mockup

* add and wipe

* track writes

* start to add to pipeline

* return all reads/writes

* Log reads and writes from bench db

* causes panic

* Allow multiple commits

* commit before ending benchmark

* doesn't work???

* fix

* Update lib.rs

* switch to struct for `BenchmarkResults`

* add to output

* fix test

* line width

* @kianenigma review

* Add Whitelist to DB Tracking in Benchmarks Pipeline (#6405)

* hardcoded whitelist

* Add whitelist to pipeline

* Remove whitelist pipeline from CLI, add to runtime

* clean-up unused db initialized whitelist

* Add regression analysis to DB Tracking (#6475)

* Add selector

* add tests

* debug formatter for easy formula

* Update client/db/src/bench.rs

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

Co-authored-by: arkpar <arkady.paronyan@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-06-24 21:03:55 +02:00
Alexander Theißen b14b472edf seal: Remove ext_dispatch_call and ext_get_runtime_storage (#6464)
Those are way too hard to audit and make only sense with specific
chains. They shouldn't be in the core API.
2020-06-24 11:53:40 +00:00
Alexander Theißen a3a42f599a seal: Refactor ext_gas_price (#6478)
* seal: Refactor ext_gas_price

* Remove seals dependency on pallet_transaction_payment
* Add weight as an argument to ext_gas_price

* Fixed documentation nits from review

* Do not use unchecked math even in test code
2020-06-24 10:52:49 +00:00
Wei Tang 039c30f08c pallet-atomic-swap: generialized swap action (#6421)
* pallet-atomic-swap: generialized swap action

* Bump spec_version

* Fix weight calculation

* Remove unnecessary type aliases
2020-06-21 12:34:53 +02:00
Wei Tang bd5ad9fd6d Pallet: Atomic Swap (#6349)
* Init atomic swap pallet

* Implement module swap operations

* Add successful swap test

* Bump node spec_version

* Fix storage name

* Add ProofLimit parameter to prevent proof size being too large

* Add missing events

* Basic weight support

* Add basic docs

* Mark swap on claim

This handles the additional case if `repatriate_reserved` fails.

* Add additional expire handler

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

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Add docs on ProofLimit

* Fix test

* Return Ok(()) even when the transfer fails

Because we need to mark the swap as claimed no matter what.

* Remove retry logic

It's overkill. Swap is about something being executed, not necessarily successful.
Although there should be logic (reserve and unreserve) to make it so that both parties *believes*
that the execution is successful.

* succeed -> succeeded

* Add docs on duration -- revealer should use duration shorter than counterparty

* Missing trait type

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-06-18 09:42:31 +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
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
Shaopeng Wang ccdac645c8 "OR gate" for EnsureOrigin (#6237)
* 'OR gate' for EnsureOrigin.

* Formatting.

* More formatting.

* Add docstring; Update 'Success' type.

* Bump runtime impl_version.

* Fix successful_origin.

* Add either into std feature list.

* Update docs.
2020-06-10 11:11:26 +02:00
Gavin Wood d29baf9945 Introduce frozen indices. (#6307)
* Introduce frozen indices.

* Fix.

* Bump runtime

* Benchmark for freeze

* Fix

* fix benchmarks

* update freeze weights

* remove copy pasta

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-06-09 16:31:18 +02:00
Shawn Tabrizi 73851943c5 Weights for Indices Pallet (#6282)
* fix multisig benchmarking

* add indices benchmarks

* fix compile

* Weights for indices
2020-06-08 19:11:52 +02:00
Gavin Wood 15ecac5cb6 Introduce stacked filtering (#6273)
* Introduce stacked filtering.

* Benchmarks

* Remove unneeded crates

* Fix proxy type's permissiveness checks.

* Repot multisig to make utility stateless.

* Repot filter stack impl into macro

* Fix wasm build

* Tests

* Final test.

* Tests for the macro

* Fix test

* Line width

* Fix

* Update frame/multisig/src/benchmarking.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update primitives/std/with_std.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Grumble

* Update frame/support/src/traits.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/support/src/traits.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/support/src/traits.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/support/src/traits.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/support/src/traits.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update frame/multisig/src/tests.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/multisig/src/tests.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Grumble

* Migration

* Grumble

* Comments

* Migration

* Fix

* Fix

* Line width

* Allow unused

* Update frame/multisig/src/lib.rs

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

* Fix up grumble.

* Remove Utility constraint in NonTransfer

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
2020-06-08 13:09:12 +02:00
Gavin Wood 0761a8e0c3 Allow "anonymous" proxied accounts (#6236)
* Anonymous proxiers

* More testing

* More testing

* Build fix

* Build fix

* Benchmarks.

* fix benchmarking

* add weights

* fix line width

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-06-06 10:55:52 +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
Gavin Wood 4adac40c07 Generalised proxies (#6156)
* Initial work

* It should work

* Fix node

* Fix tests

* Initial test

* Tests

* Expunge proxy functionality from democracy and elections

* Allow different proxy types

* Repotted

* Build

* Build

* Making a start on weights

* Undo breaking change

* Line widths.

* Fix

* fix tests

* finish benchmarks?

* Storage name!

* Utility -> Proxy

* proxy weight

* add proxy weight

* remove weights

* Update transfer constraint

* Again, fix constraints

* Fix negation

* Update frame/proxy/Cargo.toml

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

* Remove unneeded event.

* Grumbles

* Apply suggestions from code review

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

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-06-02 18:15:15 +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
tgmichel 7b9add7a71 pallet-evm ensure gas_price + Storage getter (#6191)
* evm: move gas price check to top-level dispatchable

* Add AccountCodes get fn and account_exists helper

* Remove account_exists, evm handles non-existing accounts

* Runtime bump impl_version 251/2

* Fix Runtime impl_version and spec_version

Co-authored-by: Wei Tang <hi@that.world>
2020-06-02 17:18:45 +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
Gavin Wood 42ad0d138f Filter calls in utility (#6131)
* Filter calls.

* Remove old proxy code

* Docs and repot

* Update frame/utility/src/tests.rs

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>

* fix test

* Grumble

* Bump runtime version

* fix

* Attempt general fix

Co-authored-by: Marcio Diaz <marcio.diaz@gmail.com>
Co-authored-by: NikVolf <nikvolf@gmail.com>
2020-05-26 06:34:25 +02:00
Xiliang Chen efae379676 make calls public (#6109) 2020-05-22 09:04:20 +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
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
thiolliere b50c3338d6 Allow operational recovery path if on_initialize use fullblock. (#6089)
* note_preimage using operational

* Update frame/democracy/src/lib.rs

Co-authored-by: Gavin Wood <gavin@parity.io>
2020-05-21 13:51:47 +02:00
Alexander Theißen 9dd21b1eed Allow fee calculation to happen off-chain (#6076)
* Emit a PaymentParameters event once per block

This contains per-block paramaters need to calculate
fees off-chain.

* Add WeightToFee trait

* Add documentation to polynomial types

* Ignore pseudo code snippet for doc tests

* Use `Mul` implementation of Perbill

* Add tests for WeightToFeePolynomial

* Revert "Emit a PaymentParameters event once per block"

This reverts commit 6c4763baff3d8179676a3c1660fe7063fd56a8ca.

Co-authored-by: Gavin Wood <gavin@parity.io>
2020-05-21 12:16:04 +02:00
Wei Tang 3f3753b8e4 evm: allow setting pre-defined accounts in genesis (#6086)
* evm: allow setting pre-defined accounts in genesis

* Only build GenesisAccount in std
2020-05-20 19:33:16 +00: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
Alexander Theißen 80accdbf7c Include post dispatch corrected weight in extrinsic events (#6024)
* Include post dispatch corrected weight in extrinsic events

* Drop the 'Post' from ApplyExtrinsicResultWithPostInfo to make it less verbose

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Use proper Event type in pallet_system tests

* Add test that the actual weight is returned by events

* Make fn extract_actual_weight cap at pre dispatch weight

* Bump spec version

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Gavin Wood <gavin@parity.io>
2020-05-18 18:44:29 +02:00
Wei Tang cd0ffec1fe Refactor EVM operations to module functions (#6056)
* Refactor EVM operations to module functions

* Bump impl version
2020-05-18 18:42:56 +02:00
Nikolay Volf d5411969ac fix whitespace (#6062) 2020-05-18 13:51:28 +02:00
Kian Paimani 7a8d59199e Benchmarks for elections-phragmen pallet (#5845)
* Fist benchmark barely working

* Debug checkpoint

* add rest of benchmarks

* Add to runtime

* Fix build

* Update frame/elections-phragmen/src/benchmarking.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/elections-phragmen/src/benchmarking.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* major imp

* Make them run on release

* Help finish phragmen benchmarks (#5886)

* update caller, account, and member/runner-up creation

* remove stuff

* ocd

* make it work with real run

* relax the numbers a bit

* New and improved version

* Make elections-phragmen weighable and secure. (#5949)

* Make elections-phragmen weighable.

* Update frame/elections-phragmen/src/lib.rs

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

* Update frame/elections-phragmen/src/lib.rs

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

* Fix all tests

* Fix everything

* Add note

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

* Doc update

* Fix some complexity params

* Once more ready to benchmark

* ready for bench

* final tunes

* Update frame/elections-phragmen/src/lib.rs

* Fix fix

* Update frame/elections-phragmen/src/lib.rs

* Update frame/elections-phragmen/src/benchmarking.rs

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

* Update frame/elections-phragmen/src/benchmarking.rs

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

* Update to latest weights

* Some fixes

* Fix dual voter read from @thiolliere

* Remove todos

* review from @shawntabrizi

* Fix bench tests.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
2020-05-15 14:07:12 +02:00
thiolliere 1dbd761192 Democracy weight (#5828) 2020-05-15 13:25:43 +02:00
Benjamin Kampmann be8c96adec Relax substrate licensing scheme (#5947) 2020-05-15 13:21:56 +02:00
Demi Obenour ddea306044 Add ‘transaction_version’ to the signed transaction (#5979)
* Add ‘transaction_version’ to the signed transaction

This allows hardware wallets to know which transactions they can safely
sign.  To reduce transaction size, I reduced it to a ‘u8’ from a ‘u32’.

Fixes #5951.

* Restore transaction_version to a u32

* Fix comments

`transaction_version` is not part of a tx, but is still signed.

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Fix the test suite

I had forgotten to change the production of transactions in the test
code.

* Fix benchmarks

* Improve docs for `CheckTxVersion` in `frame_system`

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Remove spurious cast

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
2020-05-15 00:01:56 +02:00
Alexander Popiak 9057d713d9 Collective weights (#5802) 2020-05-14 17:20:03 +02:00
joe petrowski b718c45dbd Change BlockHashCount Parameter in Node/Node Template (#5990)
* change BlockHashCount param

* fix test and lock
2020-05-13 10:46:39 +02:00
Shawn Tabrizi b0d17b02ea Update System Weights (#5888)
* Update system weights

* Use maximum block weight for scheduler

* Update offences to use full block

* Move weight inside if statement

* Add one read to offences `on_initialize`

* Delete factory test

* Revert "Delete factory test"

This reverts commit 8f95aacd63a028ef1b415185b45367b4140d86fd.

* Revert "Add one read to offences `on_initialize`"

This reverts commit 7df7ebc73625ed79b14086f13c247d4058ee87d6.

* Revert "Move weight inside if statement"

This reverts commit 87277d07913a7d1868eeee85ef4673f51ee4013b.

* Revert "Update offences to use full block"

This reverts commit 0bbe0ce18e9419b032157f7d37dea6481078cdc0.

* Use scheduler in Sudo

* Apply suggestions from code review

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

* Revert "Use scheduler in Sudo"

This reverts commit 95bd2768dfea100bdf682cf4fe6c0f46e8e1f66e.

* remove max extrinsic weight (it does nothing useful)

* fix tests

* introduce `sudo_unchecked_weight`

* bump spec version

* scheduler 80 percent of maximum

* Update `set_changes_trie_config` weight

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

* Update frame/democracy/src/tests.rs

* Update tests.rs

* update based on feedback

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
2020-05-07 14:33:33 +02:00
Shawn Tabrizi d8b7520a90 Extend Schedule Pallet for Root Scheduling/Canceling (#5907)
* Add root dispatch to scheduler

* Move encode operation upwards

* fix benchmark

* extend extrinsics

* add some clarifying comments

* start to add benchmarking

* finish weights

* remove double encode

* bump spec

* Update weights

* more accurate weights

* bump base weight
2020-05-07 11:47:23 +02:00
André Silva fbd2ac8f3b grandpa: report equivocations (#3868)
* session: runtime api for generating session membership proofs

* grandpa: add runtime api for creating equivocation report txs

* grandpa: submit signed equivocation report transactions

* grandpa: use proper equivocation report type

* grandpa: report equivocations

* grandpa: validate equivocation proof

* grandpa: update to finality-grandpa 0.9.1

* grandpa: fix encoding of session membership proof

* grandpa: initialize set id session mapping for genesis session

* grandpa: fix bug in set_id session validation

* fix compilation

* cleanup from merge conflicts

* cleanup crate tomls

* grandpa: refactor equivocation handling to separate trait

* node-template: fix compilation

* fix test compilation

* bump finality-grandpa to v0.10.2

* rpc: fix runtime version test

* CHERRY-PICK #4200: Add documentation to SubmitSignedTransaction and actually make it work

Squashed commit of the following:

commit 4f2cb0b1c588a06f2f3b478bb4b28b5cb29d54b9
Author: Tomasz Drwięga <tomasz@parity.io>
Date:   Tue Dec 3 16:29:33 2019 +0100

    Split the method to avoid confusing type error message.

commit c5bf24eeaaf902add89ed1b046b22c4a4aaeb2cd
Author: Tomasz Drwięga <tomasz@parity.io>
Date:   Tue Dec 3 16:19:55 2019 +0100

    Make accounts optional, fix logic.

commit 97db1ef556e023cf6847e5ffdb036c0e3ea6fb0a
Author: Tomasz Drwięga <tomasz@parity.io>
Date:   Tue Dec 3 10:06:20 2019 +0100

    Remove warning.

commit 535f5c116d1a2e826eaf90c3f7e6798e443d61d8
Merge: 516257217 0f1a5f651
Author: Tomasz Drwięga <tomasz@parity.io>
Date:   Tue Dec 3 07:08:05 2019 +0100

    Merge branch 'master' into td-signed-transactions

commit 516257217bac89fcebd083712f4ea68b7b23b55a
Merge: ac98248c6 2e68c80c2
Author: Tomasz Drwięga <tomasz@parity.io>
Date:   Mon Dec 2 13:57:25 2019 +0100

    Merge branch 'master' into td-signed-transactions

commit ac98248c6c56cff381130645a82a13d29933cf83
Author: Tomasz Drwięga <tomasz@parity.io>
Date:   Mon Nov 25 17:34:52 2019 +0100

    Forgotten import.

commit 67a3c19031506c28e31c6bc4a90fff62d467dd58
Author: Tomasz Drwięga <tomasz@parity.io>
Date:   Mon Nov 25 17:32:10 2019 +0100

    Fix naming and bounds.

commit 93e768ea9df97a4629fca1f9bc4b108fdb33f876
Author: Tomasz Drwięga <tomasz@parity.io>
Date:   Mon Nov 25 17:01:05 2019 +0100

    Add documentation to signed transactions and actually make them work.

* grandpa: skip block initialization on report submission method

* primitives: allow transaction pool access by default for offchain calls

* grandpa: unused parameters

* grandpa: remove unused method

* grandpa: enable equivocation reporting

* grandpa: add workaround for parameter encoding

* grandpa: fix localized_payload calls in tests

* fix submit_report_equivocation_extrinsic in runtimes

* node: fix submit transaction test compilation

* node: bump spec_version

* rpc: fix api version test

* grandpa: allow custom equivocation offence type

* grandpa: add test for authorities::next_change_height

* grandpa: cleanup report_equivocation function

* node: move reporting app crypto to node-primitives

* grandpa: move equivocation traits to own module

* grandpa: rename app-crypto crate import

* grandpa: export equivocation types

* node: bump spec_version

* grandpa: rename EquivocationReport to EquivocationProof

* grandpa: add missing docs to primitives

* grandpa: add missing docs to equivocation

* node: fix compilation

* grandpa: add missing docs to pallet

* node: bump spec_version

* fix whitespace

* grandpa: return error on offence reporting

* grandpa: expose session and validator count in proofs through traits

* grandpa: use strong key in module KeyOwnerProofSystem

* grandpa: move key ownership proof to grandpa runtime api

* grandpa: remove unnecessary cloning when checking equivocation proof

* grandpa: make report_equivocation a method in Environment

* support: implement KeyOwnerProofSystem for ()

* grandpa: move KeyOwnerProofSystem to module trait

* test-utils: fix runtime compilation

* grandpa: fix test compilation

* grandpa: fix test compilation after merge

* grandpa: simplify transaction submission types

* grandpa: validate equivocation report in signed extension

* client: fix test

* node: use ValidateEquivocationReport signed extension

* grandpa: expose key ownership proof under opaque type

* grandpa: better docs on key ownership proofs

* grandpa: add note about signed extension

* grandpa: add ValidateEquivocationReport::new

* grandpa: remove skip_initialize_block from runtime api

* grandpa: use new offchain transaction submission API

* grandpa: take set_id in generate_key_ownership_proof

* grandpa: update to finality-grandpa v0.12.2

* grandpa: cleanup usages of AuthoritySet::current

* grandpa: fix test

* grandpa: add mocking utilities for equivocation reporting

* grandpa: add test for equivocation reporting

* grandpa: move SetIdSession initialization

* grandpa: add more tests

* node: enable historical session manager

* node: bump spec_version

* node: use strong key types in KeyOwnerProofSystem definitions

* grandpa: export GrandpaEquivocationOffence type
2020-05-06 17:25:51 +01:00
Shawn Tabrizi 8df33e50af Refactor weight constants, Update to remove redundant overhead (#5884)
* Move weight values to `frame_support`

* more accurate comment

* update balances

* vesting

* update util

* Add weight to time constants

* use weight constants in weights

* update tests
2020-05-04 19:52:53 +02:00
Wei Tang a00a4ca551 Correct BABE randomness by calculating InOut bytes directly in pallet (#5876)
* vrf: remove Raw* types

* babe: remove Raw* types

* pallet-babe: switch representation of RawVRFOutput to Randomness

* pallet-babe: calculate inout within the pallet

* Remove make_transcript duplication

* Bump spec version

* Fix frame tests

* and_then -> map

* Always enable u64_backend

* Fix nostd compile

* fix import: should not use std

* Remove unused definition of RawVRFOutput

* Remove unused import of RuntimeDebug

Co-authored-by: Gavin Wood <gavin@parity.io>
2020-05-04 19:51:47 +02:00
ddorgan 8549cf5899 Update chain spec for flaming fir 7 (#5882)
* Update chain spec for flaming fir 7

* Update sudo key

* Use fir7 for protocol

* Bump spec version

* Revert sudo change

* Rebuilt spec after all the changes. Flaming fir has been reset with this.
2020-05-04 16:03:11 +01:00
Shawn Tabrizi f37927d37d node-bench no-op block import (#5869)
* start to try and implement noop

* txs as input

* better comment

* Add transfer reaping

* rename to avoid filter matching

* Update base weights based on results

* fix priority

* fix logic on reaping transfer

* Update bin/node/bench/src/import.rs

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* Update bin/node/bench/src/main.rs

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* add back size type (in-progress)

* bring back size type with custom

* update comment

* nit

* block type then size

* Use `transfer_keep_alive`

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
2020-05-03 15:33:11 +02:00