1. Aug 17, 2019
  2. Aug 16, 2019
    • Tomasz Drwięga's avatar
      Offences reporting and slashing (#3322) · 5d992d80
      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.
      5d992d80
    • André Silva's avatar
      babe: Introduce secondary slots (Aurababeous) (#3380) · 7eb937e8
      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
      7eb937e8
    • Tomasz Drwięga's avatar
      Verify signature and session index during apply phase of im-online. (#3418) · 755a6c44
      Tomasz Drwięga authored
      * Verify signature and session index during apply phase of im-online.
      
      * Bump impl_version.
      
      * Add docs to SignedExtension
      755a6c44
    • Svyatoslav Nikolsky's avatar
      Fix light client synchronization on master (#3301) · 20ae4875
      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 ce451c32.
      
      * Revert "value ranges in consensus cache"
      
      This reverts commit 9062f943
      
      .
      
      * 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
      20ae4875
    • André Silva's avatar
      session: add handler for genesis session (#3413) · 8258647a
      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
      8258647a
    • André Silva's avatar
      im-online: use new session keys (not upcoming session) (#3414) · e9ef9609
      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
      e9ef9609
  3. Aug 15, 2019
  4. Aug 13, 2019
  5. Aug 12, 2019
    • Gavin Wood's avatar
      Era change can be forced on and forced off (#3374) · c6834327
      Gavin Wood authored
      * Forcing can be on or off.
      
      * Add a testcase.
      c6834327
    • Gav Wood's avatar
      Revert "Forcing can be on or off." · 677aeca0
      Gav Wood authored
      This reverts commit dc35cabd.
      677aeca0
    • Gav Wood's avatar
      Forcing can be on or off. · dc35cabd
      Gav Wood authored
      dc35cabd
    • Jim Posen's avatar
      srml-contracts: Contract calls/instantiations to return exit statuses (#3320) · 215f6cc7
      Jim Posen authored
      * srml-contracts: Rename ext_scratch_copy to ext_scratch_read.
      
      This is to disambiguate from the next ext_scratch_write function.
      
      * Remove unnecessary OutputBuf and EmptyOutputBuf.
      
      * Replace VmExecError with a result type of custom structs.
      
      * Do not drop the scratch buffer on traps and regular returns.
      
      This just reduces the number of allocations required during nested
      contract calls and instantiations.
      
      * Semantics for returning a status code and data from contract calls.
      
      * Remove CallReceipt and InstantiateReceipt.
      
      With forthcoming changes to return data from instantiate calls, the two
      types of receipts become very similar to each other and to
      ExecReturnValue. Instead, replace them with ExecReturnValue and
      a regular 2-tuple in the case of instantiation.
      
      * Modify contract function signatures to allow returning status codes.
      
      * Introduce ext_sandbox_write runtime function.
      
      * Test all the things.
      
      * Bump node runtime spec version.
      
      * Style fixes.
      215f6cc7
  6. Aug 11, 2019
  7. Aug 09, 2019
    • Bastian Köcher's avatar
      Adds `--no-validator` CLI flag (#3348) · 14a70910
      Bastian Köcher authored
      * Implement `is_validator` for offchain-workers
      
      * Introduce `--no-validator` flag
      
      * Don't run babe/grandpa/im-online when `--no-validator` is given
      
      * Fixes compilation
      
      * Bump spec version
      
      * Improve error handling in executor
      
      * Add missing extern function
      
      * Revert making error public
      
      * Remove `--no-validator` CLI
      14a70910
  8. Aug 08, 2019
    • cheme's avatar
      Child storage tests and genesis fix. (#3185) · c36d2477
      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
      c36d2477
    • Jim Posen's avatar
      srml-contracts: Refactor away some duplication in runtime functions. (#3257) · 225c1b52
      Jim Posen authored
      * srml-contracts: Storage access micro-optimization.
      
      * srml-contracts: Refactor runtime functions to reduce duplication.
      
      * Bump node runtime impl version.
      225c1b52
    • Xiliang Chen's avatar
      add post_dispatch (#3229) · e4a92a91
      Xiliang Chen authored
      * add post_dispatch
      
      * Update traits.rs
      
      * Update checked_extrinsic.rs
      
      * Update traits.rs
      
      * Update traits.rs
      
      * fix build issue
      
      * update runtime version
      
      * fix test build issue
      e4a92a91
  9. Aug 07, 2019
    • Arkadiy Paronyan's avatar
      Set uncles inherent (#3317) · d6eb5dd8
      Arkadiy Paronyan authored
      * Include uncles
      
      * Filter missing uncles
      
      * Moved inherent registration to a new crate
      
      * Ignore invalid inherent encoding
      d6eb5dd8
    • Bastian Köcher's avatar
      Make `DefaultByte` implement `Send + Sync` (#3333) · 872173f0
      Bastian Köcher authored
      * Make `DefaultByte` implement `Send + Sync`
      
      * Update runtime version.
      872173f0
    • Andrew Jones's avatar
      Derive CompactAs for Perbill/mill/U128 (#3327) · 4f92dfaa
      Andrew Jones authored
      * Derive CompactAs for Perbill/mill/U128
      
      * Increment impl_version
      4f92dfaa
    • Gavin Wood's avatar
      Refactor key management (#3296) · ed61b1fd
      Gavin Wood authored
      * Add Call type to extensible transactions.
      
      Cleanup some naming
      
      * Merge Resource and BlockExhausted into just Exhausted
      
      * Fix
      
      * Another fix
      
      * Call
      
      * Some fixes
      
      * Fix srml tests.
      
      * Fix all tests.
      
      * Refactor crypto so each application of it has its own type.
      
      * Introduce new AuthorityProvider API into Aura
      
      This will eventually allow for dynamic determination of authority
      keys and avoid having to set them directly on CLI.
      
      * Introduce authority determinator for Babe.
      
      Experiment with modular consensus API.
      
      * Work in progress to introduce KeyTypeId and avoid polluting API
      with validator IDs
      
      * Finish up drafting imonline
      
      * Rework offchain workers API.
      
      * Rework API implementation.
      
      * Make it compile for wasm, simplify app_crypto.
      
      * Fix compilation of im-online.
      
      * Fix compilation of im-online.
      
      * Fix more compilation errors.
      
      * Make it compile.
      
      * Fixing tests.
      
      * Rewrite `keystore`
      
      * Fix session tests
      
      * Bring...
      ed61b1fd
    • Bastian Köcher's avatar
      Update to schnorrkel `0.8.0` (#3267) · e2d9619d
      Bastian Köcher authored
      
      
      * Update to schnorrkel `0.8.0`
      
      * Increase `spec_version`
      
      * Bump schnorrkel to 0.8.3 (#3283)
      
      * Schnorrkel 0.8.1 (builds on bkchr upgrade branch)
      
      * Add tests for known hard/soft derivation values
      
      * Bump all schnorrkel versions
      
      * Flatten for easier inspection
      
      * 0.8.2
      
      * 0.8.3
      
      * Update subkey/Cargo.toml
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update `Cargo.lock`
      
      * 0.8.4
      
      * Fix cargo lock file.
      
      * Adding an error message for `NotMarkedSchnorrkel` as that was missing.
      Also fixing a typo, strage -> stage.
      e2d9619d
  10. Aug 06, 2019
  11. Aug 02, 2019
    • Sergey Pepyakin's avatar
      srml-contracts: Minor fixes to docs. (#3262) · 805cd6b0
      Sergey Pepyakin authored
      
      
      * Adjust documentation.
      
      * Bump impl_version.
      
      * Update srml/contracts/src/wasm/runtime.rs
      
      Co-Authored-By: default avatarHero Bird <[email protected]>
      
      * Remove incorrect doc.
      805cd6b0
    • André Silva's avatar
      node: use BABE predigest data to find authorship (#3293) · 3181e0cb
      André Silva authored
      * node: use BABE predigest data to find authorship
      
      * node: bump spec_version
      
      * babe: use u32 for authority index
      3181e0cb
    • cheme's avatar
      Trie simplification. (#2815) · ba281ecc
      cheme authored
      * switch to simple codec, trie broken for now
      
      * Actualy use trie_root_noext
      
      * align some hash, failing test on EMCH comment
      
      * Fix trie code over layout instead of hash, revert legacy code for legacy
      mainnet ??
      
      * stub behind LayOut
      
      * fix no_std
      
      * temp solution for legacy trie behind feature legacy-key in various crate
      
      * use remote project
      
      * rc client db need prefix
      
      * update trie deps
      
      * bum spec runtime version
      
      * Removing legacy as default.
      
      * Switch mode to non legacy.
      
      * bump runtime version
      
      * Remove legacy trie compatibility features.
      
      * fix warning
      
      * bump version
      
      * change hash on new test.
      
      * Move dependency (#11 trie PR) patched to a parity repo.
      Bench reverted to correct hasher.
      Some renaming and doc improvments.
      
      * ChildBitmap renaming to BitMap.
      
      * Renaming of LayOut to Layout.
      
      * formatting.
      
      * Removing abreviation such as _ix nb_ or bm.
      
      * Update deps and apply renaming 'Buff' -> 'Buffer'.
      
      * Align to latest trie crates naming changes.
      
      * Update trie dependency.
      
      * Update trie dependency.
      
      * change block_import test hash
      
      * update trie deps (trie use new scale codec but it does not seems to be
      an issue).
      
      * update to use latest trie version (no mgmt of multiple radix).
      
      * tabify
      
      * Restoring test to 10 000.
      
      * Use published crate, trie bench is currently down until publishing
      (require another pr to update version).
      
      * Update trie-bench.
      ba281ecc
    • Gavin Wood's avatar
      Check the genesis hash in transactions regardless of era. (#3286) · 22359681
      Gavin Wood authored
      * Check the genesis hash in transactions regardless of era.
      
      * Fix check-fees, too.
      
      * Undo.
      
      * Subkey supports new signing.
      
      * Remove unneeded type param.
      
      * Bump tx version
      
      * Build.
      
      * Another build fix
      
      * Build again
      
      * Cleanup
      
      * Another fix.
      
      * Fix
      
      * Fixes
      
      * 6 second blocks.
      
      * Fixes
      
      * Build fix
      
      * Fix
      
      * Fix.
      22359681
  12. Aug 01, 2019
  13. Jul 30, 2019
  14. Jul 29, 2019
    • Kian Paimani's avatar
      Refactor sr_primitives. (#3214) · 1fcd1286
      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
      1fcd1286
    • Max Inden's avatar
      core/consensus,node/runtime: Declare and implement authorities endpoint (#3207) · 444bf719
      Max Inden authored
      The goal of the commit is to be able to retrieve the current set of
      authorities without needing to know the concrete consensus mechanism in
      place.
      
      In order to achieve the above this commit introduces the
      `core/consensus/common/primitives` crate, declaring the `ConsensusApi`
      runtime API. In addition it implements the above mentioned trait
      definition in `node/runtime` by returning the current authorities of the
      BABE consensus mechanism.
      444bf719
    • Jim Posen's avatar
      srml-contracts: Refactor to remove duplication between call and create code paths (#3209) · 8958f410
      Jim Posen authored and Sergey Pepyakin's avatar Sergey Pepyakin committed
      * srml-contracts: Change Ext interface to pass-by-value.
      
      * srml-contracts: Refactor ExecutionContext to reduce duplication.
      
      * srml-contracts: Refactor contracts Module to reduce duplication.
      
      * Bump node runtime impl version.
      8958f410