1. Sep 24, 2019
  2. Sep 21, 2019
  3. Sep 19, 2019
    • Tomasz Drwięga's avatar
      Force new era only if 1/3 validators is disabled. (#3533) · 668acca9
      Tomasz Drwięga authored
      
      
      * Force new era only when over third validators is disabled.
      
      * Update srml/session/src/lib.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update srml/staking/src/lib.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Parametrize the threshold.
      
      * Bump runtime version.
      
      * Update node/runtime/src/lib.rs
      
      * Fix build.
      
      * Fix im-online test.
      668acca9
    • Kian Paimani's avatar
      srml-module: Phragmen election (#3364) · bfe240d1
      Kian Paimani authored
      
      
      * phragmen election module.
      
      * Add new files.
      
      * Some doc update
      
      * Update weights.
      
      * bump and a few nits.
      
      * Performance improvement.
      
      * Master.into()
      
      * Update srml/elections-phragmen/src/lib.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Fix build
      
      * Some fixes.
      
      * Fix build.
      
      * Proper outgoing and runner-up managment.
      
      * Bit more sensical weight values.
      
      * Update srml/elections-phragmen/src/lib.rs
      
      * Update srml/elections-phragmen/src/lib.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Update srml/elections-phragmen/src/lib.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Update srml/elections-phragmen/src/lib.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * fix lock file
      
      * Fix build.
      
      * Remove runner-ups
      
      * Some refactors.
      
      * Add support for reporting voters.
      
      * Fix member check.
      
      * Remove equlize.rs
      
      * Update srml/elections-phragmen/src/lib.rs
      
      * Update srml/elections-phragmen/src/lib.rs
      
      * Update srml/elections-phragmen/src/lib.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Update srml/elections-phragmen/src/lib.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Bring back runner ups.
      
      * use decode_len
      
      * Better weight values.
      
      * Update bogus doc
      
      * Bump.
      
      * Update srml/elections-phragmen/src/lib.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Review comments.
      
      * One more test
      
      * Fix tests
      
      * Fix build
      
      * .. and fix benchmarks.
      
      * Update srml/elections-phragmen/src/lib.rs
      
      * Version bump
      bfe240d1
  4. Sep 13, 2019
    • Tomasz Drwięga's avatar
      Fix tracking validator set in ImOnline (#3596) · b7c6bc1e
      Tomasz Drwięga authored
      
      
      * Use session::validators instead of staking::current_elected
      
      * Basic test framework.
      
      * Initialize validators, attempt to heartbeat.
      
      * Use dummy crypto for im-online testing.
      
      * Remove printlns.
      
      * Finish test, make it invalid.
      
      * Add reporting test.
      
      * Finalize the test.
      
      * Remove dumbness.
      
      * Updates.
      
      * Update AuRa
      
      * Update srml/im-online/src/tests.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Derive Ord
      
      * Add some more tests.
      
      * Remove stray todo.
      
      * Bump runtime version.
      
      * Bump impl-trait-for-tuples.
      
      * Enforce new version of trait-for-tuples.
      b7c6bc1e
    • Kian Paimani's avatar
      Fix Staking and Democracy locking (#3606) · a7f35680
      Kian Paimani authored
      * Fix locking.
      
      * Some reformattings.
      
      * Fix build.
      
      * Fix doc comment.
      
      * Bump.
      a7f35680
    • Kian Paimani's avatar
      Move phragmen benchmarks out of Staking (#3588) · a6b5d1d1
      Kian Paimani authored
      * Move phragmen benches to.. phragmen.
      
      * Move some basic phragmen tests to.. phragmen.
      
      * Line-width
      
      * Add phragmen equ implementation as flot
      
      * Add phragmen equ implementation as flot
      
      * Add mock and test file.
      a6b5d1d1
  5. Sep 11, 2019
  6. Sep 06, 2019
  7. Sep 04, 2019
    • Bastian Köcher's avatar
      Custom runtime module errors (#3433) · c6f37980
      Bastian Köcher authored
      
      
      * srml-system checks
      
      * wip
      
      * more modules compiles
      
      * node-runtime checks
      
      * build.sh passes
      
      * include dispatch error in failed event
      
      * revert some unnecessary changes
      
      * refactor based on comments
      
      * more compile error fixes
      
      * avoid unnecessary into
      
      * reorder code
      
      * fixes some tests
      
      * manually implement encode & decode to avoid i8 workaround
      
      * more test fixes
      
      * more fixes
      
      * more error fixes
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarTomasz Drwięga <[email protected]>
      
      * address comments
      
      * test for DispatchError encoding
      
      * tyep alias for democracy
      
      * make error printable
      
      * line width
      
      * fix balances tests
      
      * fix executive test
      
      * fix system tests
      
      * bump version
      
      * ensure consistent method signature
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * changes based on review
      
      * Add issue number for TODOs
      
      * fix
      
      * line width
      
      * fix test
      
      * Update core/sr-primitives/src/lib.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update core/sr-primitives/src/traits.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update srml/council/src/motions.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update srml/council/src/motions.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * update based on review
      
      * More concrete macro matching
      
      * fix test build issue
      
      * Update hex-literal dependency version. (#3141)
      
      * Update hex-literal dep version.
      
      * Update lock file.
      
      * Start to rework the new error handling
      
      * More work to get it back compiling
      
      * Start to fix after master merge
      
      * The great transaction error handling refactoring
      
      * Make `decl_error` errors convertible to `&'static str`
      
      * Make srml-executive build again
      
      * Fix `sr-primitives` tests
      
      * More fixes
      
      * Last round of fix ups
      
      * Fix build
      
      * Fix build
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarTomasz Drwięga <[email protected]>
      
      * Rename some stuff
      
      * Fixes after master merge
      
      * Adds `CheckBlockGasLimit` signed extension
      
      * Remove debug stuff
      
      * Fix srml-balances test
      
      * Rename `InvalidIndex` to `CannotLookup`
      
      * Remove weird generic parameters
      
      * Rename function again
      
      * Fix import
      
      * Document the signed extension
      
      * Change from `Into` to `From`
      
      * Update srml/contracts/src/lib.rs
      
      Co-Authored-By: default avatarSergei Pepyakin <[email protected]>
      
      * Fix compilation
      
      * Update srml/contracts/src/lib.rs
      
      Co-Authored-By: default avatarTomasz Drwięga <[email protected]>
      
      * Update core/sr-primitives/src/transaction_validity.rs
      
      Co-Authored-By: default avatarTomasz Drwięga <[email protected]>
      
      * Remove unused code
      
      * Fix compilation
      
      * Some cleanups
      
      * Fix compile errors
      
      * Make `TransactionValidity` a `Result`
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Beautify the code a little bit and fix test
      
      * Make `CannotLookup` an inherent error declared by `decl_error!`
      
      * Adds some documentation
      
      * Make `ApplyOutcome` a result
      
      * Up the spec_version
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      Co-Authored-By: default avatarDemiMarie-parity <[email protected]>
      c6f37980
    • Shawn Tabrizi's avatar
      Normalize Crate Names in SRML/Node Template (#3543) · c284ca21
      Shawn Tabrizi authored
      * Fix some instances of `runtime-io`
      
      * Patch a bunch
      
      * More patches for consistancy
      
      * more patch
      
      * Fix various build issues
      
      * Fix tests
      
      * Patch `srml-support-*` crates
      
      * Fix doc tests
      
      * Revert "Fix doc tests"
      
      This reverts commit ba2ec61da7acc36821a70e76a31a6a5bf13bbe95.
      
      * Revert "Patch `srml-support-*` crates"
      
      This reverts commit 9a6070450107dec17784ba34af4b871023f6dc81.
      
      * Missed one
      
      * Fix doc tests
      c284ca21
  8. Sep 02, 2019
  9. Aug 29, 2019
    • thiolliere's avatar
      `srml_support` storage reorganize (#3344) · 99005623
      thiolliere authored
      
      
      * impl
      
      * file split
      
      * old comment
      
      * better error message
      
      * WIP
      
      * basti test works
      
      * comment
      
      * remove old files
      
      * impl swap for storage map
      
      * fix
      
      * fix and comment
      
      * code refactor
      
      * code refactor
      
      * code format
      
      * code refactor
      
      * fix
      
      * fix
      
      * fix
      
      * document generators
      
      * license
      
      * doc
      
      * doc
      
      * fmt
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * some comment addressed
      
      * storage_items small refactor
      
      * fix storage_items
      
      * more precise returned type
      
      * fix
      
      * code fmt suggestion
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * remove box allocation
      
      * bump version
      
      * rename function as behavior has changed
      
      * fix doc
      99005623
    • thiolliere's avatar
      Simplify deposit_event declaration in decl_module (#3506) · b07fd450
      thiolliere authored
      * simplify module deposit_event declaration
      
      * fix
      
      * bump version
      
      * fix
      
      * fix test
      
      * fix doc
      b07fd450
    • Kian Paimani's avatar
      Decouple Phragmen from Staking. (#3498) · f830db96
      Kian Paimani authored
      * Move phragmen to primitives
      
      * Improved docs
      
      * New crate.
      
      * Update lock.
      
      * Fix dependency.
      
      * Fix build.
      
      * Add basic testing and truth-value implementation with float types
      
      * Update srml/staking/src/lib.rs
      
      * Nits.
      
      * Bump.
      
      * Fix benchmarks.
      f830db96
  10. Aug 25, 2019
  11. Aug 24, 2019
  12. Aug 16, 2019
    • Tomasz Drwięga's avatar
      Offences reporting and slashing (#3322) · 6cc44957
      Tomasz Drwięga authored
      
      
      * Remove offline slashing logic from staking.
      
      * Initial version of reworked offence module, can report offences
      
      * Clean up staking example.
      
      * Commit SlashingOffence
      
      * Force new era on slash.
      
      * Add offenders in the SlashingOffence trait.
      
      * Introduce the ReportOffence trait.
      
      * Rename `Offence`.
      
      * Add on_before_session_ending handler.
      
      * Move offence related stuff under sr-primitives.
      
      * Fix cargo check.
      
      * Import new im-online implementation.
      
      * Adding validator count to historical session storage as it's needed for slash calculations
      
      * Add a comment about offence.
      
      * Add BabeEquivocationOffence
      
      * GrandpaEquivocationOffence
      
      * slash_fraction and fix
      
      * current_era_start_session_index
      
      * UnresponsivnessOffence
      
      * Finalise OnOffenceHandler traits, and stub impl for staking.
      
      * slash_fraction doesn't really need &self
      
      * Note that offenders count is greater than 0
      
      * Add a test to ensure that I got the math right
      
      * Use FullIdentification in offences.
      
      * Use FullIndentification.
      
      * Hook up the offences module.
      
      * Report unresponsive validators
      
      * Make sure eras have the same length.
      
      * Slashing and rewards.
      
      * Fix compilation.
      
      * Distribute rewards.
      
      * Supply validators_count
      
      * Use identificationTuple in Unresponsivness report
      
      * Fix merge.
      
      * Make sure we don't slash if amount is zero.
      
      * We don't return an error from report_offence anymo
      
      * We actually can use vec!
      
      * Prevent division by zero if the reporters is empty
      
      * offence_forces_new_era/nominators_also_get_slashed
      
      * advance_session
      
      * Fix tests.
      
      * Update srml/staking/src/lib.rs
      
      Co-Authored-By: default avatarRobert Habermeier <[email protected]>
      
      * slashing_performed_according_exposure
      
      * Check that reporters receive their slice.
      
      * Small clean-up.
      
      * invulnerables_are_not_slashed
      
      * Minor clean ups.
      
      * Improve docs.
      
      * dont_slash_if_fraction_is_zero
      
      * Remove session dependency from offences.
      
      * Introduce sr-staking-primitives
      
      * Move offence under sr_staking_primitives
      
      * rename session_index
      
      * Resolves todos re using SessionIndex
      
      * Fix staking tests.
      
      * Properly scale denominator.
      
      * Fix UnresponsivnessOffence
      
      * Fix compilation.
      
      * Tests for offences.
      
      * Clean offences tests.
      
      * Fix staking doc test.
      
      * Bump spec version
      
      * Fix aura tests.
      
      * Fix node_executor
      
      * Deposit an event on offence.
      
      * Fix compilation of node-runtime
      
      * Remove aura slashing logic.
      
      * Remove HandleReport
      
      * Update docs for timeslot.
      
      * rename with_on_offence_fractions
      
      * Add should_properly_count_offences
      
      * Replace ValidatorIdByIndex with CurrentElectedSet
      
      ValidatorIdByIndex was querying the current_elected set in each call, doing loading (even though its from cache), deserializing and cloning of element.
      
      Instead of this it is more efficient to use `CurrentElectedSet`. As a small bonus, the invariant became a little bit easier: now we just rely on the fact that `keys` and `current_elected` set are of the same length rather than relying on the fact that `validator_id_by_index` would work similar to `<[T]>::get`.
      
      * Clarify babe equivocation
      
      * Fix offences.
      
      * Rename validators_count to validator_set_count
      
      * Fix squaring.
      
      * Update core/sr-staking-primitives/src/offence.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Docs for CurrentElectedSet.
      
      * Don't punish only invulnerables
      
      * Use `get/insert` instead of `mutate`.
      
      * Fix compilation
      
      * Update core/sr-staking-primitives/src/offence.rs
      
      Co-Authored-By: default avatarGavin Wood <[email protected]>
      
      * Update srml/offences/src/lib.rs
      
      Co-Authored-By: default avatarRobert Habermeier <[email protected]>
      
      * Update srml/im-online/src/lib.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update srml/im-online/src/lib.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update srml/im-online/src/lib.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update srml/babe/src/lib.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update core/sr-staking-primitives/src/offence.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update core/sr-staking-primitives/src/offence.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update core/sr-staking-primitives/src/offence.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update core/sr-staking-primitives/src/offence.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Update core/sr-staking-primitives/src/offence.rs
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * Add aura todo.
      
      * Allow multiple reports for single offence report.
      
      * Fix slash_fraction calculation.
      
      * Fix typos.
      
      * Fix compilation and tests.
      
      * Fix staking tests.
      
      * Update srml/im-online/src/lib.rs
      
      Co-Authored-By: default avatarLogan Saether <[email protected]>
      
      * Fix doc on time_slot
      
      * Allow slashing only on current era (#3411)
      
      * only slash in current era
      
      * prune journal for last era
      
      * comment own_slash
      
      * emit an event when old slashing events are discarded
      
      * Pave the way for pruning
      
      * Address issues.
      
      * Try to refactor collect_offence_reports
      
      * Other fixes.
      
      * More fixes.
      6cc44957
  13. Aug 14, 2019
  14. Aug 12, 2019
  15. Aug 08, 2019
    • Logan Saether's avatar
      Fix documentation set_controller (#3340) · fe18b405
      Logan Saether authored
      The documentation for the `set_controller` function was copied from the function above it, however it does not do the same thing. Fixed the documentation to fit the correct description of what `set_controller` does.
      fe18b405
    • cheme's avatar
      Child storage tests and genesis fix. (#3185) · b0e1212d
      cheme authored
      * Using child storage, (srml-support only), test failing .
      
      * fix simple tests.
      
      * Enumerable by requiring owned struct (previous form only allow
      &'static).
      Broken tests are from genesis init.
      
      * implement for_child_keys_with_prefix
      
      * indent
      
      * clear_child_prefix fix.
      
      * clear_child_prefix fix 2.
      
      * fix for storage_impl, if/when allowing child and not child this could be
      reverted.
      
      * Fix lot of urlinked child genesis, still need to look upon actual
      genesis srml module code.
      Probably still a lot of broken code needing debugging.
      
      * switch well_known_key to their associated module child trie.
      Fix a genesis init (balance).
      Complete some testing.
      Comment some tests before using.
      
      * fixing test runtime child keys
      
      * latest commit fix broken genesis init
      
      * fix system balances child name.
      
      * Important fix: storage_root from test externalities need children (it is
      already the case for ext).
      
      * executive root with child calculation
      
      * Avoid empty trie on test ext.
      
      * Symetric removal of key for system.
      
      * commenting changes related tests.
      
      * Remove child module specifics.
      
      * fix issues.
      
      * fix some formatting
      
      * fix bench and bump runtime
      
      * Remove extend_storage_overlays, assimilate_storage do the same as is
      proper considering srml macro.
      
      * Fix warning for assimilate.
      
      * Removing kill as they do not impact any test cases.
      
      * Use tuple of storage map instead of two parameters. This changes the
      behavior of decl_storage genesis build closure (breaking api).
      
      * Do not use build storage before assimilate.
      
      * fix error
      
      * Update core/state-machine/src/backend.rs
      b0e1212d
  16. Aug 07, 2019
  17. Aug 06, 2019
    • thiolliere's avatar
      Update to parity-scale-codec (#3232) · 4ed67e03
      thiolliere authored
      
      
      * WIP: update codec
      
      * WIP
      
      * compiling
      
      * WIP
      
      * rename parity-scale-codec to codec
      
      * WIP
      
      * fix
      
      * remove old comments
      
      * use published crates
      
      * fix expected error msg
      
      * bump version
      
      * fmt and fix
      
      * remove old comment
      
      * fix wrong decoding impl
      
      * implement encode like for structures
      
      * undo removal of old pending changes
      
      * trailingzeroinput
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      Co-Authored-By: default avatarDemiMarie-parity <[email protected]>
      
      * update codec
      
      * fmt
      
      * version is 1.0.0
      
      * show more error
      
      * fmt
      4ed67e03
  18. Aug 01, 2019
  19. Jul 29, 2019
    • Kian Paimani's avatar
      Refactor sr_primitives. (#3214) · 79feb23a
      Kian Paimani authored
      * refactor sr_primitives.
      
      * Fix try build error.
      
      * Line-width
      
      * Ui test.
      
      * Final fixes.
      
      * Fix build again.
      
      * bring back ui test.
      
      * Fix unsigned import.
      
      * Another ui fix.
      
      * Also refactor substrate-primitives
      
      * Fix benchmarks.
      
      * Fix doc test.
      
      * fix doc tests
      79feb23a
  20. Jul 25, 2019
    • André Silva's avatar
      srml: staking: track session index of current era start (#3203) · b633f93b
      André Silva authored
      * srml: staking: track session index of current era start
      
      * node: bump spec_version
      b633f93b
    • Kian Peymani's avatar
      Weight annotation. (#3157) · 002acb93
      Kian Peymani authored
      
      
      * Make extrinsics extensible.
      
      Also Remove old extrinsic types.
      
      * Rest of mockup. Add tips.
      
      * Fix some build issues
      
      * Runtiem builds :)
      
      * Substrate builds.
      
      * Fix a doc test
      
      * Compact encoding
      
      * Extract out the era logic into an extension
      
      * Weight Check signed extension. (#3115)
      
      * Weight signed extension.
      
      * Revert a bit + test for check era.
      
      * Update Cargo.toml
      
      * Update node/cli/src/factory_impl.rs
      
      * Update node/executor/src/lib.rs
      
      * Update node/executor/src/lib.rs
      
      * Don't use len for weight - use data.
      
      * Operational Transaction; second attempt (#3138)
      
      * working poc added.
      
      * some fixes.
      
      * Update doc.
      
      * Fix all tests + final logic.
      
      * more refactoring.
      
      * nits.
      
      * System block limit in bytes.
      
      * Silent the storage macro warnings.
      
      * More logic more tests.
      
      * Fix import.
      
      * Refactor names.
      
      * Fix build.
      
      * Update srml/balances/src/lib.rs
      
      * Final refactor.
      
      * Bump transaction version
      
      * Fix weight mult test.
      
      * Fix more tests and improve doc.
      
      * Bump.
      
      * Make some tests work again.
      
      * Fix subkey.
      
      * Remove todos + bump.
      
      * First draft of annotating weights.
      
      * Refactor weight to u64.
      
      * More refactoring and tests.
      
      * New convert for weight to fee
      
      * more tests.
      
      * remove merge redundancy.
      
      * Fix system test.
      
      * Bring back subkey stuff.
      
      * a few stress tests.
      
      * fix some of the grumbles.
      
      * Final nits.
      
      * Update srml/system/src/lib.rs
      
      Co-Authored-By: default avatarDemiMarie-parity <[email protected]>
      
      * Scale weights by 1000.
      
      * Bump.
      
      * Fix decl_storage test.
      002acb93
  21. Jul 24, 2019
    • André Silva's avatar
      Use BABE instead of AuRa in node (#3171) · 9f50c8fc
      André Silva authored
      * babe: add babe module trait
      
      * babe: track current slot and epoch start slot
      
      * babe: implement ShouldEndSession based on epochs
      
      * babe: rename weight type to avoid ambiguities
      
      * babe: expose epoch start slot in Epoch digest
      
      * babe: use epoch start for validating epoch transitions
      
      * babe: make the epoch duration a parameter type
      
      * babe: remove unused fields from config
      
      * node: update runtime to use babe instead of aura
      
      * node: use babe instead of aura
      
      * core: generate sr25519 keys from seed and add to keystore
      
      * core: remove AuthorityKeyring
      
      * node: remove unused primitive types related to babe crypto
      
      * uniform babe primitives crate import name
      
      * wrap long lines
      
      * babe: fix find_epoch_digest
      
      * fork-tree: fix find_node_where
      
      * node: set babe epoch duration to "10 minutes"
      
      * babe: cleanup import key cache if authorities don't change
      
      * node: make integration test compile (but fail)
      
      * node: bump spec_version
      
      * node: fix import
      
      * babe: don't use constants in storage fields array sizes
      
      * babe: account for first epoch slot way in the past
      
      * babe: signal next epoch change (not current)
      
      * babe: calculate next epoch randomness with next epoch index
      
      * babe: track next epoch in node
      
      * babe: cache current epoch and authorities separately
      
      * babe: generate valid babe vrf proofs in integration test
      
      * babe: cleanup claim_slot
      
      * babe: perform threshold calculation according to spec
      
      * babe: compute relative weight in threshold
      
      * babe: more precise threshold calculation
      
      * babe: use floats for threshold exponent calculation
      
      * babe: update constant c
      9f50c8fc
    • thiolliere's avatar
      Staking rate targeting and specific rewards. (#2882) · 2b6f664c
      thiolliere authored
      
      
      * PNPoS implementation
      
      * wip: change staking api
      
      * code readibility
      
      * fix overflow
      
      * comment
      
      * license
      
      * doc
      
      * reorganize a bit
      
      * rename to proper english + doc
      
      * address comments
      
      * refactor unused mock
      
      * fix add_point
      
      * update tests
      
      * add not equalize to ci
      
      * Revert "add not equalize to ci"
      
      This reverts commit 1c61c25874b04b1cdfadd7d353b75a189a59ad35.
      
      * bring test back
      
      * update locks
      
      * fix genesis config
      
      * add authorship event handler + test
      
      * uncouple timestamp from staking
      
      * use on finalize instead
      
      * remove todo
      
      * simplify mock
      
      * address comment
      
      * doc
      
      * merge test
      
      * fmt
      
      * remove todo todo
      
      * move add_reward_point to regular function
      
      * doc
      
      * doc
      
      * increase version
      
      * doc and fmt
      
      * Update srml/staking/src/inflation.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Fix some doc typos
      2b6f664c
  22. Jul 23, 2019
    • DemiMarie-parity's avatar
      BABE Epochs (#3028) · f78a7807
      DemiMarie-parity authored and asynchronous rob's avatar asynchronous rob committed
      
      
      * Add `epoch` field to `SlotInfo`
      
      * Add slot calculations
      
      * More work on epochs in BABE
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Typo: `/` not `%` for division
      
      * Delete useless `LastSlotInEpoch::put(false)`
      
      * Bump `spec_version`
      
      * Make test suite pass again
      
      * Implement BABE epoch randomness signing
      
      * Try to fix compilation
      
      Currently causes a stack overflow in the compiler
      
      * Fix rustc stack overflow
      
      * Add missing `PartialEq` and `Eq` implementations
      
      * Fix compile errors in test suite
      
      * Another silly compile error
      
      * Clone `epoch`
      
      * Fix compile error in benchmarks
      
      * Implement `clone` for `Epoch`
      
      * Merge master
      
      * AUTHORING TEST PASSES!!!
      
      * Fix compilation
      
      * Bump `spec_version`
      
      * Fix compilation
      
      * Fix compilation (again)
      
      * Remove an outdated FIXME
      
      * Fix run.sh and move it to scripts/
      
      * Delete commented-out code
      
      * Fix documentation
      
      Co-Authored-By: default avatarAndré Silva <[email protected]>
      
      * Fix BABE initialization and refactor
      
      * Respond to review
      
      * typo
      
      * Remove useless data in `CheckedHeader::Deferred`
      
      * Remove `slot_number` from Epoch
      
      It is not needed, and only served to waste space and cause confusion.
      
      * Remove epoch from BABE digests
      
      * Move digest.rs to primitives
      
      * Fix incorrect warning names
      
      * Fix compile error
      
      * Consistent field naming for BABE digests
      
      * More compiler error fixex
      
      * Unbound variable
      
      * more compile errors
      
      * another compile error
      
      * Fix compile errors in runtime
      
      * another compile error
      
      * Another compile error
      
      * Fix wasm build
      
      * missing import
      
      * Fix more compile errors
      
      * yet another compile error
      
      * compile fix in test runtime
      
      * Fix and simplify the BABE runtime
      
      The BABE runtime was massively overcomplicated and also wrong.  It
      assumed it needed to:
      
      1. delay new authorities taking effect until the next epoch
      2. not delay emitting `Consensus` digests to mark epoch changes
      
      However, the first is handled by the `srml_session` crate, and the
      second is flat-out incorrect: `Consensus` digests take effect
      immediately.  Furthermore, `srml_babe` tried to duplicate the
      functionality of `srml_session::PeriodicSession`, but did it both
      clumsily and incorrectly.  Fortunately, the new code is simpler and far
      more likely to be correct.
      
      * Use `system` to get the test authorities
      
      The genesis block used by tests defines no authorities.  Only the test
      suite is affected.
      
      * Fix test runtime impl for BabeApi::epoch() with std
      
      * Fix compilation
      
      * Cached authorities are in the form of an epoch
      
      not a `Vec<AuthorityId>`.
      
      * `slots_per_epoch` is not fixed in general
      
      The BABE code previously assumed `slots_per_epoch` to be a constant,
      but that assumption is false in general.  Furthermore, removing this
      assumption also allows a lot of code to go away.
      
      * fix compile error
      
      * Implement epoch checker
      
      * Fix runtime compilation
      
      * fork-tree: add method for finding a node in the tree
      
      * babe: register epoch transitions in fork tree and validate them
      
      * fork-tree: add method for arbitrary pruning
      
      * Expose the queued validator set to SRML modules
      
      BABE needs to know not only what the current validator set is, but also
      what the next validator set will be.  Expose this to clients of the
      session module.
      
      * Bump hex-literal
      
      Hopefully this will fix the panic
      
      * babe: prune epoch change fork tree on finality
      
      * babe: validate epoch index on transition
      
      * babe: persist epoch changes tree
      
      * Fix compile error in tests
      
      * Fix compile error in tests
      
      * Another compile error in tests
      
      * Fix compilation of tests
      
      * core: move grandpa::is_descendent_of to client utils
      
      * babe: use is_descendent_of from client utils
      
      * babe: extract slot_number from pre_digest in import_block
      
      * Move BABE testsuite to its own file
      
      * Initial part of test code
      
      * Missing `WeightMultiplierUpdate` in test-runtime
      
      * bump `spec_version`
      
      * Add a test that a very bogus is rejected
      
      * Run the tests again
      
      * Fix compiler diagnostics
      
      * Bump `spec_version`
      
      * Initial infrastructure for mutation testing
      
      * Mutation testing of block import
      
      * babe: revert epoch changes in case of block import error
      
      * babe: fix logging target
      
      * babe: BabeBlockImport doesn't box inner BlockImport
      
      * babe: fix epoch check in block import
      
      * babe: populate authorities cache on block authorship
      
      * babe: remove unused functions
      
      * babe: use RANDOMNESS_LENGTH const
      
      * babe: remove unneeded config parameters
      
      * core: revert change to hex dependency version
      
      * cleanup gitignore
      
      * babe: add docs to aux_schema
      
      * babe: remove useless drops in tests
      
      * babe: remove annoying macos smart quotes
      
      * fork-tree: docs
      
      * fork-tree: add tests
      
      * babe: style
      
      * babe: rename randomness config variable
      
      * babe: remove randomness helper function
      
      * babe: style fixes
      
      * babe: add docs
      
      * babe: fix tests
      
      * node: bump spec_version
      
      * babe: fix tests
      f78a7807
  23. Jul 21, 2019
  24. Jul 10, 2019