1. Nov 30, 2020
  2. Nov 25, 2020
  3. Nov 20, 2020
  4. Oct 29, 2020
    • Bastian Köcher's avatar
      Make sure pallet versions are set at genesis (#7451) · e1b56f8d
      Bastian Köcher authored
      
      
      * Make sure pallet versions are set at genesis
      
      This pr ensures that pallet versions are also set at genesis. It does
      this by hooking into the runtime `GenesisConfig` which means that it
      will only work when the storage is setup using this genesis config. So,
      the version will not be set in pallet local tests. However, I think this
      isn't such a problem. The genesis config will call `on_genesis` on all
      pallets. This function comes from the new trait `OnGenesis`. Currently
      the user is not able to provide any custom implementation of this trait.
      
      Besides that it also implements `Clone` and `Copy` for the pallet
      version struct.
      
      This pr also moves the macro for generating the runtime genesis config
      to `frame-support` as most of the other FRAME related macros.
      
      * Reduce line width
      
      * Update frame/support/src/traits.rs
      
      Co-authored-by: default avatarAlexander Popiak <[email protected]>
      
      Co-authored-by: default avatarAlexander Popiak <[email protected]>
      e1b56f8d
    • Qinxuan Chen's avatar
      Replace bitmask with bitflags (#7159) · bd450c24
      Qinxuan Chen authored
      
      
      Signed-off-by: default avatarkoushiro <[email protected]>
      bd450c24
  5. Oct 21, 2020
  6. Oct 19, 2020
  7. Oct 12, 2020
  8. Aug 12, 2020
  9. Aug 04, 2020
  10. Jul 21, 2020
  11. Jul 04, 2020
    • André Silva's avatar
      babe: report equivocations (#6362) · a9c21b8b
      André Silva authored
      * 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
      a9c21b8b
  12. Jun 15, 2020
    • thiolliere's avatar
      Introduce in-origin filtering (#6318) · c2ad2727
      thiolliere authored
      
      
      * 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: default avatarKian Paimani <[email protected]>
      
      * 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: default avatarKian Paimani <[email protected]>
      c2ad2727
  13. Jun 11, 2020
  14. May 27, 2020
  15. May 23, 2020
  16. May 15, 2020
  17. May 06, 2020
    • André Silva's avatar
      grandpa: report equivocations (#3868) · fbd2ac8f
      André Silva authored
      * 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 <[email protected]>
      Date:   Tue Dec 3 16:29:33 2019 +0100
      
          Split the method to avoid confusing type error message.
      
      commit c5bf24eeaaf902add89ed1b046b22c4a4aaeb2cd
      Author: Tomasz Drwięga <[email protected]>
      Date:   Tue Dec 3 16:19:55 2019 +0100
      
          Make accounts optional, fix logic.
      
      commit 97db1ef556e023cf6847e5ffdb036c0e3ea6fb0a
      Author: Tomasz Drwięga <[email protected]>
      Date:   Tue Dec 3 10:06:20 2019 +0100
      
          Remove warning.
      
      commit 535f5c116d1a2e826eaf90c3f7e6798e443d61d8
      Merge: 516257217 0f1a5f65
      Author: Tomasz Drwięga <[email protected]>
      Date:   Tue Dec 3 07:08:05 2019 +0100
      
          Merge branch 'master' into td-signed-transactions
      
      commit 516257217bac89fcebd083712f4ea68b7b23b55a
      Merge: ac98248c6 2e68c80c
      Author: Tomasz Drwięga <[email protected]>
      Date:   Mon Dec 2 13:57:25 2019 +0100
      
          Merge branch 'master' into td-signed-transactions
      
      commit ac98248c6c56cff381130645a82a13d29933cf83
      Author: Tomasz Drwięga <[email protected]>
      Date:   Mon Nov 25 17:34:52 2019 +0100
      
          Forgotten import.
      
      commit 67a3c19031506c28e31c6bc4a90fff62d467dd58
      Author: Tomasz Drwięga <[email protected]>
      Date:   Mon Nov 25 17:32:10 2019 +0100
      
          Fix naming and bounds.
      
      commit 93e768ea9df97a4629fca1f9bc4b108fdb33f876
      Author: Tomasz Drwięga <[email protected]>
      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
      fbd2ac8f
  18. May 05, 2020
  19. Apr 24, 2020
  20. Apr 21, 2020
    • Bastian Köcher's avatar
      Require `fn` token in `decl_storage` `get` (#5717) · 20f211a6
      Bastian Köcher authored
      * Require `fn` token in `decl_storage` `get`
      
      The `fn` token was already for quite some time as an optional parameter.
      It was introduced to make these functions better findable. This pr makes
      the `fn` token required.
      
      * Remove `GetterNoFnkeyword`
      20f211a6
  21. Apr 20, 2020
  22. Apr 17, 2020
  23. Apr 15, 2020
  24. Apr 07, 2020
    • Shawn Tabrizi's avatar
      Generate Unit Tests for Benchmarks (#5527) · d3cc0514
      Shawn Tabrizi authored
      * Update to latest staking
      
      * generate tests for benchmarking
      
      * add tests, fix warnings
      
      * starting on democracy
      
      * impl_benchmark_tests
      
      * Way more readable
      
      * add test feature flag (does this work?)
      
      * Fix `successful_origin` impl
      
      * democracry benchmark tests
      
      * Fix example benchmarks, add tests
      
      * identity benchmark tests
      
      * Update im-online benchmark tests
      
      * try to add session benchmarking tests (problem with mock)
      
      * staking and timestamp
      
      * add test for treasury, issue with dynamic contains
      
      * utility
      
      * Vesting
      
      * test instead of check
      
      * hide until we figure out what is wrong
      
      * add docs
      
      * close code
      
      * Create custom mock for session-pallet-benchmarking
      
      * Use refcell pattern
      
      * make un-pub
      
      * test-linux-stable includes `runtime-benchmarks` feature
      
      * Revert "test-linux-stable includes `runtime-benchmarks` feature"
      
      This reverts commit a2dab38abd18ac3eb8a6220e4a00e687740bd38c.
      
      * run tests in `--release`
      
      * undo balance change
      
      * build wasm
      d3cc0514
  25. Apr 03, 2020
  26. Mar 21, 2020
    • Gavin Wood's avatar
      Redesign Democracy pallet (#5294) · 22f88bf9
      Gavin Wood authored
      * Repot a bit of democracy code
      
      * Basic logic is drafted
      
      * Lazy democracy builds.
      
      * Add non-locked split-voting and instant-scheduling.
      
      * Introduce delegation that works.
      
      * Builds again.
      
      * Indentation
      
      * Building.
      
      * Docs and migration
      
      * Fix half of the tests
      
      * Fix up & repot tests
      
      * Fix runtime build
      
      * Update docs
      
      * Docs
      
      * Nits.
      
      * Turnout counts full capital
      
      * Delegations could towards capital
      
      * proxy delegation & proxy unvoting
      
      * Fix
      
      * Tests for split-voting
      
      * Add missing file
      
      * Persistent locking.
      22f88bf9
  27. Mar 16, 2020
    • Gavin Wood's avatar
      Refactor away from opaque hashes (#5226) · af9083f5
      Gavin Wood authored
      
      
      * System.BlockHash
      
      * Fix hash
      
      * Introduce K/V iteration in all _concat maps
      
      Also move across:
      - System.Account (blake2_128_concat)
      - Balances.Locks (twox_64_concat)
      - ElectionsPhragmen.VotesOf (twox_64_concat)
      - ElectionsPhragmen.StakeOf (twox_64_concat)
      - Identity.IdentityOf (twox_64_concat)
      - Identity.SubsOf (twox_64_concat)
      - Society.Payouts (twox_64_concat)
      - Session.NextKeys (twox_64_concat)
      - Identity.SuperOf (blake2_128_concat)
      - Session.KeyOwner (blake2_128_concat)
      - Society.SuspendedCandidates (twox_64_concat)
      - Society.SuspendedMembers (twox_64_concat)
      - Society.Vouching (twox_64_concat)
      - Society.Strikes (twox_64_concat)
      - System.EventTopics
      - Balances.Account
      
      * Build fixes
      
      * Ensure migration happens in correct order
      
      * Staking.*
      
      * Vesting.* Offences.*
      
      * Democracy.*
      
      * Babe.* Collective.*
      
      * Grandpa.*
      
      * Assets.* Benchmark.* Contracts.* Elections.* Asset.* Nicks.*
      
      Also introduce real account list
      
      * ImOnline.*
      
      * Treasury.*
      
      * Recovery.*
      
      * Final bits.
      
      * Docs
      
      * Fix one test
      
      * Fix test
      
      * All passing except the UI tests
      
      * Remove linked_map part 1
      
      * Remove linked_map
      
      * Some iterator utils for double maps.
      
      * Remove old migrations
      
      * Introduce tombstone for LinkedMap type
      
      * Migration for genesis hash
      
      * Fix build
      
      * Fix hash
      
      * Rename Map is_linked -> unused, keeping backwards compat (#5256)
      
      * Update frame/balances/src/lib.rs
      
      Co-Authored-By: default avatarShawn Tabrizi <[email protected]>
      
      * Update frame/elections/src/lib.rs
      
      Co-Authored-By: default avatarShawn Tabrizi <[email protected]>
      
      * Remove old migration code.
      
      * Update frame/system/src/lib.rs
      
      Co-Authored-By: default avatarShawn Tabrizi <[email protected]>
      
      * Update bin/node/runtime/src/lib.rs
      
      Co-Authored-By: default avatarShawn Tabrizi <[email protected]>
      
      * Fix hash
      
      * fix session migration
      
      * Fix watning
      
      Co-authored-by: default avatarJaco Greeff <[email protected]>
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      Co-authored-by: default avatarRobert Habermeier <[email protected]>
      af9083f5
  28. Mar 14, 2020
    • Shawn Tabrizi's avatar
      Assign unique storage names to pallets. (#5010) · 74f8db5d
      Shawn Tabrizi authored
      
      
      * Assign unique storage names to pallets.
      
      * Bump spec
      
      * Upgrade logic for finality tracker (untested)
      
      * Logic for migrating Identity (untested)
      
      * Logic for migrating transaction-payment
      
      * Fix tests
      
      * Fix `decl_storage` build
      
      * Contract -> Contracts
      
      * Update Cargo.lock
      
      * bump spec
      
      * update migration
      
      * Fix merge error
      
      * Migration for contracts
      
      * Remove serde
      
      * Remove some illegal spaces and Options
      
      * Fix types in identity.
      
      * Minor variable rename
      
      Co-authored-by: default avatarGavin Wood <[email protected]>
      74f8db5d
  29. Feb 01, 2020
    • Gavin Wood's avatar
      Refactor the balances module (#4649) · d52d8692
      Gavin Wood authored
      
      
      * Initially scoping out of the problem
      
      * Remove need for exiry in balance locks.
      
      * Remove expiry from locks.
      
      * Remove supefluous balance test
      
      * Amalgamate pieces of balance module
      
      * Split out vesting
      
      * Fix tests
      
      * Fixes for vesting.
      
      * Docs.
      
      * Weight docs.
      
      * Refactor things in terms of set_balances.
      
      * Switch out ED to be free + reserved.
      
      * Remove on_free_balance_zero and some docs.
      
      * Build fixes
      
      * Update frame/vesting/src/lib.rs
      
      Co-Authored-By: default avatarXiliang Chen <[email protected]>
      
      * Update frame/vesting/src/lib.rs
      
      Co-Authored-By: default avatarXiliang Chen <[email protected]>
      
      * Migration
      
      * Remove superfluous code.
      
      * Test fixes
      
      * Fix some tests
      
      * Fix repatriate reserve
      
      * Fixes
      
      * Add test for migration
      
      * Final cleanups
      
      * Fix
      
      * Indentation.
      
      * Undo unneeded referencing
      
      * Bump runtime version
      
      * Fixes
      
      Co-authored-by: default avatarXiliang Chen <[email protected]>
      d52d8692
  30. Jan 27, 2020
  31. Jan 10, 2020
  32. Jan 09, 2020
  33. Jan 05, 2020
  34. Dec 22, 2019
  35. Dec 19, 2019
    • Bastian Köcher's avatar
      Make `decl_error!` errors usable (#4449) · 8e393aa5
      Bastian Köcher authored
      * Make `decl_error!` errors usable
      
      This pr implements support for returning errors of different pallets in
      a pallet. These errors need to be declared with `decl_error!`.
      
      The pr changes the following:
      
      - Each dispatchable function now returns a `DispatchResult` which is an
      alias for `Result<(), DispatchError>`.
      - `DispatchError` is an enum that has 4 variants:
        - `Other`: For storing string error messages
        - `CannotLookup`: Variant that is returned when something returns a
        `sp_runtime::LookupError`
        - `BadOrigin`: Variant that is returned for any kind of bad origin
        - `Module`: The error of a specific module. Contains the `index`,
        `error` and the `message`. The index is the index of the module in
        `construct_runtime!`. `error` is the index of the error in the error
        enum declared by `decl_error!`. `message` is the message to the error
        variant (this will not be encoded).
      - `construct_runtime!` now creates a new struct `ModuleToIndex`. This
      struct implements the trait `ModuleToIndex`.
      - `frame_system::Trait` has a new associated type: `ModuleToIndex` that
      expects the `ModuleToIndex` generated by `construct_runtime!`.
      - All error strings returned in any module are being converted now to `DispatchError`.
      - `BadOrigin` is the default error returned by any type that implements `EnsureOrigin`.
      
      * Fix frame system benchmarks
      8e393aa5
  36. Dec 16, 2019
    • Tomasz Drwięga's avatar
      [big refactor] Remove crate aliasing. (#4395) · 8778ca7d
      Tomasz Drwięga authored
      * Rename: Phase 1.
      
      * Unify codec.
      
      * Fixing: Phase 2
      
      * Fixing: Phase 3.
      
      * Fixing: Phase 4.
      
      * Fixing: Phase 5.
      
      * Fixing: Phase 6.
      
      * Fixing: Phase 7.
      
      * Fixing: Phase 8. Tests
      
      * Fixing: Phase 9. Tests!!!
      
      * Fixing: Phase 10. Moar tests!
      
      * Finally done!
      
      * More fixes.
      
      * Rename primitives:: to sp_core::
      
      * Apply renames in finality-grandpa.
      
      * Fix benches.
      
      * Fix benches 2.
      
      * Revert node-template.
      
      * Fix frame-system in our modules.
      8778ca7d