1. Mar 27, 2020
  2. Mar 26, 2020
    • Kian Paimani's avatar
      Offchain Phragmén BREAKING. (#4517) · 970c5f94
      Kian Paimani authored
      * 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: default avatarJoshy Orndorff <[email protected]>
      
      * Some formatting nits
      
      * Review comments.
      
      * Fix cargo file
      
      * Almost all tests work again
      
      * Update frame/staking/src/tests.rs
      
      Co-Authored-By: default avatarthiolliere <[email protected]>
      
      * Fix review comments
      
      * More review stuff
      
      * Some nits
      
      * Fix new staking / session / babe relation
      
      * Update primitives/phragmen/src/lib.rs
      
      Co-Authored-By: default avatarthiolliere <[email protected]>
      
      * Update primitives/phragmen/src/lib.rs
      
      Co-Authored-By: default avatarthiolliere <[email protected]>
      
      * Update primitives/phragmen/compact/src/lib.rs
      
      Co-Authored-By: default avatarthiolliere <[email protected]>
      
      * 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: default avatarGavin Wood <[email protected]>
      
      * Update frame/staking/src/slashing.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Update frame/staking/src/offchain_election.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * 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: default avatarGavin Wood <[email protected]>
      
      Co-authored-by: default avatarJoshy Orndorff <[email protected]>
      Co-authored-by: default avatarthiolliere <[email protected]>
      Co-authored-by: default avatarGavin Wood <[email protected]>
      970c5f94
    • Marcio Diaz's avatar
      Benchmark Democracy Pallet (#5257) · 5a48cade
      Marcio Diaz authored
      
      
      * Add origin bounds to benchmark macro.
      
      * Add democracy benchmark.
      
      * Fix tests
      
      * Remove collective from frame/benchmarking, partially use EnsureOrigin.
      
      * Remove collective stuff.
      
      * Make previous benches compile again.
      
      * Remove comments.
      
      * Make prev bench to work again.
      
      * Add remove votes.
      
      * Add new proxy calls.
      
      * Add runtime-benchmarks guard to EnsureOrigin and implementations.
      
      * Refactor.
      
      * Add missing import.
      
      * Remove duplicated import
      
      * Fix features.
      
      * Add some missing features.
      
      * Update frame/collective/Cargo.toml
      
      Co-Authored-By: default avatarKian Paimani <[email protected]>
      
      * Update frame/democracy/src/benchmarking.rs
      
      Co-Authored-By: default avatarKian Paimani <[email protected]>
      
      * Update frame/democracy/src/benchmarking.rs
      
      Co-Authored-By: default avatarKian Paimani <[email protected]>
      
      * Add referendums to state.
      
      * populate vecs before call
      
      * Update weight docs
      
      * More fixes and weight docs
      
      * More updates
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      5a48cade
    • Kian Paimani's avatar
      Mandate weight annotation (#5357) · a0772117
      Kian Paimani authored
      * Disallow default weight
      
      * Fix build and test
      
      * Fix tests
      
      * Fix another beloved ui test.
      
      * fix beloved trybuild tests
      
      * fix treasury?
      
      * Final test fix
      
      * Fix build
      
      * Fix another one
      
      * Fix
      
      * More doctest fix
      a0772117
    • Alexander Theißen's avatar
      contracts: Remove OnKilledAccount implementation (#5397) · 7cbadd73
      Alexander Theißen authored
      * contracts: Remove OnKilledAccount implementation
      
      Contracts now longer rely on this callback to tell them when they
      are removed. Instead, they can only self destruct  using `ext_terminate`.
      
      * Fix account removal test
      
      * Fix account storage removal
      7cbadd73
    • thiolliere's avatar
      Make Staking pallet using a proper Time module. (#4662) · b0d2f4b1
      thiolliere authored
      
      
      * add new trait, still migration to make
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarKian Paimani <[email protected]>
      
      * implement migration
      
      * better naming
      
      * fix test
      
      * no longer require DeprecatedTime
      
      * add test
      
      * fix version
      
      * upgrade only from kusama
      
      * add test
      
      * fix test
      
      * Update frame/timestamp/src/lib.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      b0d2f4b1
  3. Mar 25, 2020
  4. Mar 24, 2020
  5. Mar 23, 2020
  6. Mar 21, 2020
    • Stanislav Tkach's avatar
      41a8d431
    • 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
  7. Mar 20, 2020
    • Bastian Köcher's avatar
      Adds new event phase `Initialization` (#5302) · 7693bd5e
      Bastian Köcher authored
      * Adds new event phase `Initialization`
      
      Every event that was deposited inside of `on_initialize` was assigned to
      the `ApplyExtrinsic(0)` phase which wasn't correct. This pr introduces a
      new phase `Initialization`. This is the new phase while initializing
      a block. After initialization we switch to `ApplyExtrinsic(N)` and at
      the end to `Finalization` as before.
      
      * Set `ExecutionPhase` in `initialize`
      
      * Increment `spec_version`
      7693bd5e
    • Hero Bird's avatar
      Implement ext_ hashes for contracts (issue #5258) (#5326) · 017f2189
      Hero Bird authored
      * Implement ext_ hashes for contracts (issue #5258)
      
      * load cryto hash .wat from raw string literal instead of file
      
      * update .wat contents for testing crypto hashes
      
      * remove unnecessary 'static
      
      * fix bug in input (call_indirect required 1+ at least it seems)
      
      * no longer use scratch buffer for crypto hash functions
      
      * improve doc comments of ext_ hash functions
      
      * remove unnecessary comment in .wat test file
      
      * add return value (const 0) to contract test to hopefully enable result buffer
      
      * fix bug in contract assertion
      
      * implement proper output_len in contract
      
      * implement proper test for crypto hashes
      
      * bump spec_version 238 -> 239
      
      * fix COMPLEXITY description
      
      * remove final invalid instances of scratch buffer from docs
      017f2189
    • Bastian Köcher's avatar
      Make sure frame examples compile for wasm (#5332) · 46458f40
      Bastian Köcher authored
      
      
      * Make sure frame examples compile for wasm
      
      This makes sure that `frame-example` and `frame-example-offchain-worker`
      compile for wasm.
      
      This also fixes compilation for these crates. The offchain worker
      example doesn't use serde-json anymore as that is too heavy and breaks
      `no_std` compilation.
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarNikolay Volf <[email protected]>
      
      Co-authored-by: default avatarNikolay Volf <[email protected]>
      46458f40
    • Shawn Tabrizi's avatar
      Benchmark Treasury Pallet (#5287) · ca3cbbfc
      Shawn Tabrizi authored
      
      
      * Start benchmarks
      
      * try_origin or root
      
      * More benches
      
      * stuck
      
      * Custom trait functions for benchmarks
      
      * finish benchmarks
      
      * Bump impl
      
      * More comments
      
      * Bump spec
      
      * Remove import
      
      * Update frame/elections-phragmen/src/lib.rs
      
      Co-Authored-By: default avatarthiolliere <[email protected]>
      
      * Update frame/support/src/traits.rs
      
      Co-Authored-By: default avatarthiolliere <[email protected]>
      
      * Fix merge
      
      Co-authored-by: default avatarthiolliere <[email protected]>
      ca3cbbfc
    • Peter Goodspeed-Niklaus's avatar
      Factor out can_set_code (#5317) · a9b9ca5f
      Peter Goodspeed-Niklaus authored
      * Factor out can_set_code
      
      The motivation for this feature is parachain runtime upgrades, which
      happen in two different moments: the initial call, when the checks
      should be performed, and at the actual upgrade block. It's much
      better and more maintainable to just call `can_set_code` in the
      function than to manually copy those checks.
      
      I'm not entirely thrilled with the interface, which requires
      cloning the entire code vector in `set_code`. However, it looks
      like something in `decl_module!` does not play nicely with
      references in its function arguments. If `code` has a lifetime,
      it _must_ be named, which gives us this signature.
      
      ```rust
      pub fn can_set_code<'a>(origin, code: &'a [u8]) {
      ```
      
      Unfortunately, attempting to compile with that signature generates
      a very large and baffling collection of build errors, so I decided
      to abandon that path for now.
      
      * make can_set_code non-dispatchable per PR revew
      
      Not only can we now borrow the `code` slice, but we also no longer
      need to worry about people sending a `can_set_code` transaction because
      of some misunderstanding.
      
      * move into existing impl block
      a9b9ca5f
    • Shawn Tabrizi's avatar
      Benchmark Im Online Pallet (#5318) · 400a6268
      Shawn Tabrizi authored
      
      
      * Initial benchmarking setup
      
      * Add keystore
      
      * validate unsigned
      
      * Update frame/im-online/src/benchmarking.rs
      
      Co-Authored-By: default avatarMarcio Diaz <[email protected]>
      
      * Fix verify_unsigned benchmark
      
      * add variable for teting the external addresss length
      
      * Update frame/im-online/src/benchmarking.rs
      
      Co-Authored-By: default avatarKian Paimani <[email protected]>
      
      * Update utils/frame/benchmarking-cli/src/lib.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      Co-authored-by: default avatarMarcio Diaz <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarBenjamin Kampmann <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      400a6268
  8. Mar 19, 2020
    • Gavin Wood's avatar
      Remove migration code. (#5291) · 7947cbf9
      Gavin Wood authored
      * Remove migration code.
      
      * Fix cargo
      
      * Bump spec version
      7947cbf9
    • Benjamin Kampmann's avatar
      Update dependencies (#5316) · 0cc54008
      Benjamin Kampmann authored
      * 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
      0cc54008
  9. Mar 18, 2020
    • Benjamin Kampmann's avatar
      alpha.4 release fixes (#5303) · becbe0a3
      Benjamin Kampmann authored
      * Adding missing metadata for benchmark-pallet
      
      * Missed to bump a few
      
      * release on roling tag
      
      * Wasm executors were missed
      becbe0a3
    • Benjamin Kampmann's avatar
      Releasing 2.0.0-alpha.4 (#5279) · 25e25a83
      Benjamin Kampmann authored
      
      
      * 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: default avatarMartin Pugh <[email protected]>
      25e25a83
  10. Mar 17, 2020
    • nahuseyoum's avatar
      bug fix - if statement logic (#5283) · 96108260
      nahuseyoum authored
      if statement logic for recently sent block was inverted.
      96108260
    • Marcio Diaz's avatar
      Fix vesting benchmark (#5269) · bbf5bc6a
      Marcio Diaz authored
      * Fix vesting bench starting block.
      
      * Set subs s+1 to hit worst path.
      
      * Remove unused origin.
      
      * Apply review suggestions.
      bbf5bc6a
    • Shawn Tabrizi's avatar
      Benchmark Staking and Session Pallet (#5183) · 9c06d8c6
      Shawn Tabrizi authored
      
      
      * starting bench
      
      * More
      
      * more
      
      * Payout Validator
      
      * Give each validator exactly n nominators
      
      * Update with test
      
      * Try to add accounts to chain spec
      
      * Undo changes to chainspec
      
      * Payout nominator
      
      * Rebond and Reap Stash
      
      * Set history depth
      
      * fix smelly code
      
      * cancel deferred slash
      
      * new_era bench
      
      * do_slash benchmark
      
      * Add features
      
      * undo extrinsic move
      
      * lower
      
      * Update new era
      
      * Update benchmarking.rs
      
      * whitespace
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarKian Paimani <[email protected]>
      
      * fixes
      
      * nit
      
      * Refactor tests, initial code
      
      * Move session benchmarks to avoid cyclic deps
      
      * Update lib.rs
      
      * Fix warnings
      
      * Move impl
      
      * Update to do random nominator allocation
      
      * add feature to benchmark pallet
      
      * Remove extra stuff
      
      * Update based on feedback
      
      * Less intrusive
      
      * Remove `transfer_idle_users`
      
      * remove again
      
      * unused dep
      
      * test feature flag
      
      * Update to latest substrate
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      9c06d8c6
    • Alexander Theißen's avatar
      Add `ext_terminate` (#5234) · 601f2538
      Alexander Theißen authored
      With this patch forward this will be the only way for
      a contract to destroy itself. This patch therefore changes
      the semantics of all other contract initiated balance
      transfers to fail if they would bring the caller below the
      existential deposit.
      601f2538
  11. 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
  12. Mar 15, 2020
    • Bastian Köcher's avatar
      Move runtime upgrade to `frame-executive` (#5197) · 26fa6e3c
      Bastian Köcher authored
      * Move runtime upgrade to `frame-executive`
      
      Instead of storing the runtime upgraded in the space of `frame-system`,
      this moves it to `frame-executive`. We also start storing the
      `spec_version` and `impl_version` the last runtime upgrade was applied.
      
      This scheme has multiple advantages:
      - We don't need to make sure that runtime upgrade was set.
      - This will work in the future when we want to test a runtime upgrade,
      because the `on_runtime_upgrade` will be executed automatically when the
      runtime changes.
      
      * Move `LAST_RUNTIME_UPGRADE` key to `frame-executive`
      
      * Add some more documentation
      
      * Make sure `spec_version` always increases between runtime upgrades
      
      * Fix test
      
      * Upgrade `parity-multiaddr` to fix compilation
      
      * Also check if the `spec_name` changed
      
      * Remove `RuntimeUpgraded` storage entry
      
      * Don't run on genesis
      26fa6e3c
  13. Mar 14, 2020