Skip to content
  1. Sep 13, 2019
    • Bastian Köcher's avatar
      Clean up sr-io (#3609) · 45d64a71
      Bastian Köcher authored
      * Move trait `Printable` into `sr-primitives`
      
      * Cleanup runtime io trie_root interfaces
      
      * Remove last generic bits from sr-io interface
      
      * Fix srml-sudo after master merge
      
      * Fix benchmarks
      
      * Runtime bump
      45d64a71
    • Michael Müller's avatar
      Fixes for allocator + factory + misc improvements (#3534) · 5cb8c0dc
      Michael Müller authored
      
      
      * Clear up import/export misunderstandings
      
      * Fetch minimum period from runtime
      
      * Remove unnecessary comment
      
      This variable is already fetched from the runtime
      in the line below.
      
      * Fix bug in factory
      
      The `best_block_id` stayed the same, it was always the
      genesis hash. This resulted in the factory failing after
      4096 blocks, since `client/db` discards hashes (in this
      case the genesis hash) after 4096 blocks from the database.
      
      * Fix tense in error message
      
      * Improve allocator documentation
      
      * Fix bug in allocator
      
      Under certain circumstances an invalid pointer was
      returned: when the `ptr` was calculated as equal
      to the `max_heap_size`. This is an invalid pointer
      since there is no access allowed after the heap limit.
      
      The way to provoke this was to repeatedly allocate
      with sizes which were previously not allocated and
      immediately deallocate right afterwards. What this
      did was to increment the `bumper` with each allocation,
      whilst keeping the `total_size` of the heap `0`.
      If this repeated allocation/deallocation scheme resulted
      in `max_heap_size == ptr` the `ptr` was still returned.
      
      The allocator only checked if the `total_size` was
      still within the `max_heap_size` limits, and not
      if the resulting `ptr` was still within the valid
      heap region.
      
      This commit introduces a check to validate if the
      calculated `ptr` is within the heap.
      
      * Add test for zero byte allocation and document behavior
      
      * Improve code readability by introducing a const
      
      * Fix error message in test
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Fix code review suggestions
      
      * Replace early return with assertion
      
      * Remove test for zero size allocations
      
      * Shorten test code
      
      * Shorten comment
      
      * Make bump() return Result
      
      * Add comment for bump()
      
      * Remove ambiguous comment
      
      * Replace value with const
      
      * Use proof for panic message
      
      * Fix merge
      
      * Add comment regarding minimum allocation size
      5cb8c0dc
    • 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
  2. Sep 12, 2019
  3. Sep 11, 2019
  4. Sep 10, 2019
  5. Sep 09, 2019
  6. Sep 07, 2019
  7. Sep 06, 2019
    • Sergey Pepyakin's avatar
      Update docs for the wasm executor crate (#3569) · 4f7e36e0
      Sergey Pepyakin authored
      
      
      * Grammar.
      
      * Update docs for wasm executor.
      
      * Update core/executor/src/lib.rs
      
      Co-Authored-By: default avatarAndré Silva <[email protected]>
      4f7e36e0
    • Caio's avatar
      Implement `Maybe*` marker traits using a declarative macro (#3557) · 0fff0d28
      Caio authored
      Although simple, the current `Maybe*` trait implementations are based on
      a manual approach that uses some code duplication. Now this duplication
      is removed using a declarative macro.
      Tested locally, the modification don't seem to affect building times.
      0fff0d28
    • Arkadiy Paronyan's avatar
      Add transactions from retracted blocks back to the pool (#3562) · 0df2be57
      Arkadiy Paronyan authored
      * Add transactions from retracted blocks back to the pool
      
      * Line width
      
      * Reverse retracted
      0df2be57
    • Kian Paimani's avatar
      Better testing for lock types in staking/democracy. (#3565) · a381f033
      Kian Paimani authored
      
      
      * Better testing for lock types in staking/democracy.
      
      * Update docs.
      
      * Update srml/executive/src/lib.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Update srml/executive/src/lib.rs
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Fix test
      a381f033
    • Max Inden's avatar
      core/authority-discovery: Enable authorities to discover each other (#3452) · 027d8879
      Max Inden authored
      With the *authority-discovery* module an authoritative node makes itself
      discoverable and is able to discover other authorities. Once discovered, a node
      can directly connect to other authorities instead of multi-hop gossiping
      information.
      
      1. **Making itself discoverable**
      
          1. Retrieve its external addresses
      
          2. Adds its network peer id to the addresses
      
          3. Sign the above
      
          4. Put the signature and the addresses on the libp2p Kademlia DHT
      
      2. **Discovering other authorities**
      
          1. Retrieve the current set of authorities
      
          2. Start DHT queries for the ids of the authorities
      
          3. Validate the signatures of the retrieved key value pairs
      
          4. Add the retrieved external addresses as ~reserved~ priority nodes to the
             peerset
      
      
      * node/runtime: Add authority-discovery as session handler
      
      The srml/authority-discovery module implements the OneSessionHandler in
      order to keep its authority set in sync. This commit adds the module to
      the set of session handlers.
      
      * core/network: Make network worker return Dht events on poll
      
      Instead of network worker implement the Future trait, have it implement
      the Stream interface returning Dht events.
      
      For now these events are ignored in build_network_future but will be
      used by the core/authority-discovery module in subsequent commits.
      
      * *: Add scaffolding and integration for core/authority-discovery module
      
      * core/authority-discovery: Implement module logic itself
      027d8879
    • Wei Tang's avatar
      Consensus: Proof of Work (#3473) · ece0b57d
      Wei Tang authored
      
      
      * consensus-pow: init primtives and verifier
      
      * consensus-pow: add total difficulty auxiliary
      
      * consensus-pow: implement total difficulty chain selection
      
      * consensus-pow: implement pow import queue
      
      * consensus-pow-primitives: add mine into PowApi
      
      * consensus-pow: implement mining
      
      * Update lock file
      
      * Style fixes
      
      No run-on expressions allowed.
      
      * consensus-pow: refactor register_pow_inherent_data_provider
      
      * consensus-pow: make PowApi::mine yieldable
      
      * consensus-pow: better mining loop
      
      * Add missing license header
      
      * consensus-pow-primitives: clarify the meaning of None for PowApi::verify
      
      * consensus-pow: changing total difficulty addition to use saturating add
      
      * consensus-pow: change mine-loop error to log on error! level
      
      * consensus-pow: allow inserting arbitrary preruntime digest for pow
      
      The preruntime digest can be intepreted by the runtime as the block author/coinbase.
      
      * Fix line width
      
      * More line width fixes
      
      * consensus-pow: separate difficulty, verify API
      
      This makes it more apparent that currently in PoW engine, `difficulty` should
      be input, not output.
      
      * srml-pow: implementation of average_span difficulty adjustment
      
      * srml-pow: basic blake2 algo example
      
      * srml-pow-average-span: make it not require genesis config
      
      * srml-pow: add support for authorship
      
      * Missing license headers
      
      * consensus-pow: PowAlgorithm trait generalization
      
      * Missing docs for consensus-pow
      
      * More docs
      
      * node-runtime: bump impl_version
      
      * Add rationale for difficulty type
      
      * consensus-pow: refactor aux_key
      
      * Update lock file
      
      * Update core/consensus/pow/src/lib.rs
      
      Co-Authored-By: default avatarSergei Pepyakin <[email protected]>
      
      * Update core/consensus/pow/src/lib.rs
      
      Co-Authored-By: default avatarSergei Pepyakin <[email protected]>
      
      * Update core/consensus/pow/src/lib.rs
      
      Co-Authored-By: default avatarSergei Pepyakin <[email protected]>
      
      * Update core/consensus/pow/src/lib.rs
      
      Co-Authored-By: default avatarSergei Pepyakin <[email protected]>
      
      * Update core/consensus/pow/src/lib.rs
      
      Co-Authored-By: default avatarSergei Pepyakin <[email protected]>
      
      * Update core/consensus/pow/src/lib.rs
      
      Co-Authored-By: default avatarSergei Pepyakin <[email protected]>
      
      * Update core/consensus/pow/src/lib.rs
      
      Co-Authored-By: default avatarSergei Pepyakin <[email protected]>
      
      * Update core/consensus/pow/primitives/src/lib.rs
      
      Co-Authored-By: default avatarSergei Pepyakin <[email protected]>
      
      * Update core/consensus/pow/primitives/src/lib.rs
      
      Co-Authored-By: default avatarSergei Pepyakin <[email protected]>
      
      * Remove PowRuntimeAlgorithm
      
      * block_id -> parent_block_id
      
      * Auxiliary data -> auxiliary storage data
      
      * Fix error message
      
      * Fix compile
      
      * Update core/consensus/pow/primitives/src/lib.rs
      
      Co-Authored-By: default avatarDemiMarie-parity <[email protected]>
      
      * Update core/consensus/pow/src/lib.rs
      
      Co-Authored-By: default avatarDemiMarie-parity <[email protected]>
      
      * Update core/consensus/pow/primitives/src/lib.rs
      
      Co-Authored-By: default avatarDemiMarie-parity <[email protected]>
      
      * Update core/consensus/pow/src/lib.rs
      
      Co-Authored-By: default avatarDemiMarie-parity <[email protected]>
      
      * Fix crate description
      
      * More docs
      
      * Address grumbles
      
      1. Make preruntime Optional.
      2. Add more docs on what is `preruntie` and `round`.
      3. Replace `Default::default` with the approriate type.
      ece0b57d
    • Kian Paimani's avatar
      Remove dead code in Staking (#3559) · 202271d0
      Kian Paimani authored
      * Remove some dead code from staking
      
      * Fix var name.
      202271d0
  8. Sep 05, 2019
    • Svyatoslav Nikolsky's avatar
      Changes tries build cache (#2933) · 551a9e6b
      Svyatoslav Nikolsky authored
      * changes tries build cache
      
      added CT build cache test
      
      * fix lines width
      
      * fixed some grumbles
      
      * clear cache when: digests disabled, top-level or skewed digest is built
      
      * cached_changed_keys -> with_cached_changed_keys
      551a9e6b
  9. Sep 04, 2019
    • Sergey Pepyakin's avatar
      srml-contracts: Fix values used for state rent (#3550) · 932e51ff
      Sergey Pepyakin authored
      * Fix units for srml-contracts
      
      * Bump node runtime version.
      932e51ff
    • André Silva's avatar
      client: only report block import to telemetry if new best (#3548) · 397855c6
      André Silva authored
      * client: only report block import to telemetry if new best
      
      * grandpa: fix tests
      
      * consensus: derive Default for ImportedAux
      
      * network: fix test
      397855c6
    • 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
    • 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