1. Sep 04, 2019
    • Bastian Köcher's avatar
      Implement `TryInto` for outer events (#3549) · 5e4bc7c9
      Bastian Köcher authored
      * Implement `TryInto` for outer events
      
      * Remove invalid comment
      
      * Fix compilation
      5e4bc7c9
    • 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
  2. Sep 02, 2019
  3. Sep 01, 2019
  4. Aug 29, 2019
    • thiolliere's avatar
      rename (#3516) · 26202c66
      thiolliere authored
      26202c66
    • 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
  5. Aug 28, 2019
    • Tomasz Drwięga's avatar
      CheckEra affects longevity of transactions (#3507) · 4bc9b6f5
      Tomasz Drwięga authored
      * Add test.
      
      * Bump version.
      4bc9b6f5
    • André Silva's avatar
      im-online: use generic crypto (#3500) · 574f68fd
      André Silva authored
      * im-online: support using ed25519 and sr25519 crypto
      
      * app-crypto: add trait bounds to RuntimePublic::Signature
      
      * im-online: add missing type annotations
      
      * authority-discovery: depend on im-online module and use its crypto
      
      * node: set i'm online crypto to sr25519
      
      * node: bump spec_version
      
      * rpc: don't generate i'm online pubkey in insert_key method
      
      * im-online: fix docs
      
      * im-online: move app crypto packages
      
      * aura: move app crypto packages
      574f68fd
  6. Aug 27, 2019
  7. Aug 25, 2019
  8. Aug 24, 2019
  9. Aug 23, 2019
  10. Aug 22, 2019
  11. Aug 21, 2019
  12. Aug 20, 2019
    • Bryant Eisenbach's avatar
    • thiolliere's avatar
      Fix srml-balance burn implementation (#3443) · 71cee78d
      thiolliere authored
      * tests
      
      * fix
      
      * bump version
      71cee78d
    • Max Inden's avatar
      srml/authority-discovery: Introduce srml module to sign and verify (#3385) · 2c0e73b7
      Max Inden authored
      In order to have authorities (validators) discover each other, they need
      to publish their public addresses by their ip address on the Kademlia
      Dht indexed by their public key. This payload needs to be signed by a
      key identifying them as a valid authority.
      
      Code inside `/core` does not know the current set of authorities nor
      can it assume what kind of cryptography primitives are currently in use.
      Instead it can retrieve its public key and the current set of
      authorities from the runtime and have it sign and verify Dht payloads.
      
      This commit enables code in `/core` to do so by introducing a srml
      module and runtime api to:
      
      1. Retrieve own public key.
      
      2. Retrieve public keys of current authority set.
      
      3. Sign a Dht payload.
      
      4. Verify a Dht payload.
      
      This commit makes the logic from the previous commit
      (`core/consensus/common/primitives.ConsensusApi`)
      cf80af92 obsolete and thus removes it.
      2c0e73b7
  13. Aug 19, 2019
    • Michael Müller's avatar
      Introduce srml/scored-pool (#3381) · 017752df
      Michael Müller authored
      
      
      * Introduce srml/scored-pool
      
      * Bump impl_version
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Remove unnecessary pub use
      
      * Remove unnecessary import
      
      * Adapt to InitializeMembers
      
      * Bump impl_version
      
      * Implement remarks (shortens code)
      
      * Improve complexity of score()
      
      Search and remove and search again for the
      new spot and insert then => O(2LogN).
      
      * Get rid of a clone()
      
      * Reduce complexity of issue_candidacy()
      
      * Add CandidateScored event + Improve comments
      
      * Fix naming
      
      * Use Lookup instead of AccountId as param
      
      * Use set_members_sorted instead of computing diff
      
      * Remove function which is only used during genesis
      
      * Get rid of rev() by changing sort order of Pool
      
      * Rename issue_candidacy to submit_candidacy
      
      * Shorten code
      
      * Remove find_in_pool() and have transactor submit index
      
      * Remove unnecessary dependency
      
      * Improve error messages
      
      * Improve naming
      
      * Improve comments
      
      * Make code clearer wrt which receiver to invoke
      
      * Adapt to new system trait
      
      * Refactor to request CandidateDeposit only once
      
      * Refactor to request Pool only once
      
      * Improve structure and comments
      017752df
  14. Aug 18, 2019
  15. Aug 17, 2019
  16. Aug 16, 2019
    • Bastian Köcher's avatar
      Move checks for renamed functions to `__check_reserved_function_names` (#3425) · a0f2e9b3
      Bastian Köcher authored
      * Move checks for renamed functions to `__check_reserved_function_names`
      
      * Fix trybuild test
      a0f2e9b3
    • 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
    • André Silva's avatar
      babe: Introduce secondary slots (Aurababeous) (#3380) · cb7527d2
      André Silva authored
      
      
      * babe: initial implementation of secondary slots
      
      * babe: validate secondary slot author
      
      * babe: implement weight based fork choice
      
      * babe: remove unused
      
      * aura: cleanup unused imports
      
      * babe: pass in parent weight when authoring and verifying
      
      * babe: use epoch randomness for picking secondary slot authors
      
      * babe: fix tests
      
      * babe: fix wasm build
      
      * babe: node-side code for disabling secondary slots
      
      * babe: allow enabling/disabling secondary slots from runtime
      
      * babe: fix test
      
      * babe: use blake2_256 for secondary slot assignment
      
      * babe: run block initialization in should_end_session
      
      * node: increase slot duration to 6s
      
      * babe: add docs
      
      * node: bump spec_version
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarjoe petrowski <[email protected]>
      
      * babe: simplify secondary slot assignment calculation
      
      * babe: remove unnecessary comment
      
      * node: bump spec_version
      
      * babe: fix bad merge
      cb7527d2
    • Tomasz Drwięga's avatar
      Verify signature and session index during apply phase of im-online. (#3418) · 42fb0c7c
      Tomasz Drwięga authored
      * Verify signature and session index during apply phase of im-online.
      
      * Bump impl_version.
      
      * Add docs to SignedExtension
      42fb0c7c
    • Svyatoslav Nikolsky's avatar
      Fix light client synchronization on master (#3301) · 3825a21b
      Svyatoslav Nikolsky authored
      
      
      * value ranges in consensus cache
      
      * skip values in cache
      
      * read epoch0 + epoch1 data from genesis in babe
      
      * sync authorities + session validators at genesis
      
      * removed some debug printlns
      
      * fixed cache encoding
      
      * Revert "skip values in cache"
      
      This reverts commit ce451c32823aaa4b67d99ca5b58f1bf3984df4db.
      
      * Revert "value ranges in consensus cache"
      
      This reverts commit 9062f9434cddd14a01275ddbfcd904b04282e63b.
      
      * get rid of cache::AUTHORITIES in Babe
      
      * cleaning up
      
      * cleaning up
      
      * update spec version
      
      * lost changes
      
      * fixed tests
      
      * Update node/runtime/src/lib.rs
      
      Co-Authored-By: default avatarDemiMarie-parity <[email protected]>
      
      * fix once-per-block condition
      
      * fix standalone babe + temp_storage in BuildGenesis
      
      * fix benhes compilation
      
      * fixed comment
      
      * re-added light nodes to integration tests
      
      * finalize_with_ancestors from extra_requests
      
      * post-merge fix
      
      * aaand removed debug code
      
      * (another one)
      
      * fix warn in logs (do not call ForkTree::finalize twice for the same block)
      
      * sync digest.next_authorities with actual next authorities
      
      * more docs
      
      * reverting all commits affecting storage
      
      * also remove keys from babe trait
      
      * fixed warnings
      
      * post-merge fixes
      
      * reverted some redundant changes
      
      * reverted more changes
      3825a21b
    • André Silva's avatar
      session: add handler for genesis session (#3413) · d1dde7e0
      André Silva authored and Svyatoslav Nikolsky's avatar Svyatoslav Nikolsky committed
      * session: add handler for genesis session
      
      * node: bump spec version
      
      * aura: handle on_genesis_session
      
      * srml: make sure we don't re-initialize genesis authorities
      
      * session: fix mock
      
      * node: remove genesis authorities from chain spec
      
      * staking: fix mock
      
      * srml: don't initialize genesis authorities twice
      
      * aura: don't reinitialize genesis authorities
      
      * aura: fix runtime_io dependency
      
      * Bump runtime
      d1dde7e0
    • André Silva's avatar
      im-online: use new session keys (not upcoming session) (#3414) · 3590c9c3
      André Silva authored
      * im-online: use new session keys (not upcoming session)
      
      * node: bump spec_version
      
      * im-online: rename on_new_session queued validator set parameter
      3590c9c3