1. Feb 13, 2020
    • Kian Paimani's avatar
      Per-things trait. (#4904) · c871eaac
      Kian Paimani authored
      * Give perthigns the trait it always deserved.
      
      * Make staking and phragmen work with the new generic per_thing
      
      * Make everything work together 🔨
      
      * a bit of cleanup
      
      * Clean usage
      
      * Bump.
      
      * Fix name
      
      * fix grumbles
      
      * hopefully fix the ui test
      
      * Some grumbles
      
      * revamp traits again
      
      * Better naming again.
      c871eaac
  2. Feb 08, 2020
  3. Feb 07, 2020
    • Nikolay Volf's avatar
      Subsystems memory tracking: 1. Transaction pool (#4822) · 41967186
      Nikolay Volf authored
      
      
      * update sp-runtime
      
      * total update
      
      * usage informant
      
      * update to crates.io version
      
      * update Cargo.lock
      
      * update dummy update
      
      * fix todo
      
      * cleanup
      
      * avoid custom impl
      
      * Update client/transaction-pool/graph/src/future.rs
      
      Co-Authored-By: default avatarTomasz Drwięga <[email protected]>
      
      * remove another custom impl
      
      * remove another custom impl
      
      * add kb in report
      
      * update Cargo.lock
      
      * review suggestions
      
      * --amend
      
      * --amend
      
      * bump parity-util-mem to 0.5.0
      
      * bumps
      
      * update macro and versions
      
      * add to grafana
      
      * naming
      
      Co-authored-by: default avatarTomasz Drwięga <[email protected]>
      41967186
  4. Jan 30, 2020
    • Bastian Köcher's avatar
      Expose information about the extrinsic in the metadata (#4774) · 45938d80
      Bastian Köcher authored
      * Expose information about the extrinsic in the metadata
      
      This pr exposes some information about the extrinsic used in the runtime
      via metadata. The following information are exposed:
      
      - Version of the extrinsic
      - List of all signed extensions used by the extrinsic.
      
      * Increment `spec_version`
      45938d80
  5. Jan 28, 2020
  6. Jan 27, 2020
  7. Jan 24, 2020
  8. Jan 16, 2020
    • Svyatoslav Nikolsky's avatar
      Allow updating configuration of changes tries (#3201) · febf2939
      Svyatoslav Nikolsky authored
      
      
      * DigestItem::ChangesTrieSignal
      
      * introduce changes_trie::State
      
      * introduce config activation block
      
      * ChangesTrieSignal::as_new_configuration
      
      * moved well_known_cache_keys to client
      
      * extracted DbChangesTrieStorage to separate file
      
      * change meaning of none in blockchain cache
      
      * changes trie config (FULL) cache draft
      
      * eliminating const ChangesTrieConfiguration
      
      * delay pruning
      
      * continue elimination
      
      * do not prune CT config from cache
      
      * removed redundant code
      
      * fix some TODOs
      
      * introduce ConfigurationRange
      
      * use Configuration range in build
      
      * build skewed digest
      
      * remove debug print
      
      * extracted surface iterator
      
      * key_changes works with skewed digests
      
      * fix client build
      
      * add test for NeverPrune
      
      * fix TODO
      
      * fixed some TODOs
      
      * more tests
      
      * fixing TODOs
      
      * fixed compilation
      
      * update runtime version
      
      * git rid of large tuple
      
      * too long lines
      
      * config_activation_block -> zero
      
      * obsolete TODO
      
      * removed unjustified expect
      
      * update TODOs with issue number
      
      * new CT pruning algorithm
      
      fixed cache + multiple blocks finalization
      
      track CT configuraiton on light clients
      
      support CT configuration change revert
      
      revert CT config test
      
      new CT pruning algorithm
      
      fixed cache + multiple blocks finalization
      
      track CT configuraiton on light clients
      
      support CT configuration change revert
      
      revert CT config test
      
      * BlockIdOrHeader isn't really required
      
      * removed debug leftovers + some docs
      
      * more docs
      
      * more post-merge fixes
      
      * more post-merge fixes
      
      * revertes some unnecessary changes
      
      * reverted unnecessary changes
      
      * fix compilation + unnecessary changes
      
      * (restart CI)
      
      * fix cache update when finalizing multiple blocks
      
      * fixed tests
      
      * collect_extrinsics -> set_collect_extrinsics
      
      * restore lost test
      
      * do not calculate block number twice
      
      * Update primitives/blockchain/src/error.rs
      
      Co-Authored-By: default avatarcheme <[email protected]>
      
      * map_err -> unwrap_or
      
      * document get_at Result
      
      * delete abandoned file
      
      * added weight for set_changes_trie_config
      
      * prefer_configs -> fail_if_disabled
      
      * Update client/api/src/backend.rs
      
      Co-Authored-By: default avatarcheme <[email protected]>
      
      * Update client/db/src/changes_tries_storage.rs
      
      Co-Authored-By: default avatarcheme <[email protected]>
      
      * CommitOperation+merge -> CommitOperations
      
      * fixed test compilation
      
      * merged two different CTRange structs
      
      * lost file
      
      * uggrade db from v0 to v1 (init CT cache + add column)
      
      * fix after merge
      
      Co-authored-by: default avatarcheme <[email protected]>
      Co-authored-by: default avatarGavin Wood <[email protected]>
      febf2939
    • Bastian Köcher's avatar
      Implement runtime version checks in `set_code` (#4548) · afc3318f
      Bastian Köcher authored
      * Implement runtime version checks in `set_code`
      
      Check that the new runtime code given to `set_code` fullfills some
      requirements:
      
      - `spec_name` matches
      - `spec_version` does not decreases
      - `impl_version` does not decreases
      - Either `spec_version` and `impl_version` increase
      
      * Make tests almost work
      
      * Some fixes after master merge
      
      * Fix tests
      
      * Add missed file
      
      * Make depedency check happy?
      
      * Remove leftover `sc-executor`
      
      * AHHHHH
      
      * Reset debug stuff
      
      * Remove some 'static
      
      * More 'static
      
      * Some docs
      
      * Update `Cargo.lock`
      afc3318f
  9. Jan 10, 2020
    • Bastian Köcher's avatar
      Remove requirement on `Hash = H256`, make `Proposer` return `StorageChanges` and `Proof` (#3860) · fd6b29dd
      Bastian Köcher authored
      
      
      * Extend `Proposer` to optionally generate a proof of the proposal
      
      * Something
      
      * Refactor sr-api to not depend on client anymore
      
      * Fix benches
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarTomasz Drwięga <[email protected]>
      
      * Apply suggestions from code review
      
      * Introduce new `into_storage_changes` function
      
      * Switch to runtime api for `execute_block` and don't require `H256`
      anywhere in the code
      
      * Put the `StorageChanges` into the `Proposal`
      
      * Move the runtime api error to its own trait
      
      * Adds `StorageTransactionCache` to the runtime api
      
      This requires that we add `type NodeBlock = ` to the
      `impl_runtime_apis!` macro to work around some bugs in rustc :(
      
      * Remove `type NodeBlock` and switch to a "better" hack
      
      * Start using the transaction cache from the runtime api
      
      * Make it compile
      
      * Move `InMemory` to its own file
      
      * Make all tests work again
      
      * Return block, storage_changes and proof from Blockbuilder::bake()
      
      * Make sure that we use/set `storage_changes` when possible
      
      * Add test
      
      * Fix deadlock
      
      * Remove accidentally added folders
      
      * Introduce `RecordProof` as argument type to be more explicit
      
      * Update client/src/client.rs
      
      Co-Authored-By: default avatarTomasz Drwięga <[email protected]>
      
      * Update primitives/state-machine/src/ext.rs
      
      Co-Authored-By: default avatarTomasz Drwięga <[email protected]>
      
      * Integrates review feedback
      
      * Remove `unsafe` usage
      
      * Update client/block-builder/src/lib.rs
      
      Co-Authored-By: default avatarBenjamin Kampmann <[email protected]>
      
      * Update client/src/call_executor.rs
      
      * Bump versions
      
      Co-authored-by: default avatarTomasz Drwięga <[email protected]>
      Co-authored-by: default avatarBenjamin Kampmann <[email protected]>
      fd6b29dd
    • Tomasz Drwięga's avatar
      Add documentation to SubmitSignedTransaction and actually make it work (#4200) · 74d6e660
      Tomasz Drwięga authored
      
      
      * Add documentation to signed transactions and actually make them work.
      
      * Fix naming and bounds.
      
      * Forgotten import.
      
      * Remove warning.
      
      * Make accounts optional, fix logic.
      
      * Split the method to avoid confusing type error message.
      
      * Move executor tests to integration.
      
      * Add submit transactions tests.
      
      * Make `submit_transaction` tests compile
      
      * Remove a file that was accidently committed
      
      * Add can_sign helper function.
      
      * Fix compilation.
      
      * Add a key to keystore.
      
      * Fix the tests.
      
      * Remove env_logger.
      
      * Fix sending multiple transactions.
      
      * Remove commented code.
      
      * Bring back criterion.
      
      * Remove stray debug log.
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarBastian Köcher <[email protected]>
      
      * Make sure to initialize block correctly.
      
      * Initialize block for offchain workers.
      
      * Add test for transaction validity.
      
      * Fix tests.
      
      * Review suggestions.
      
      * Remove redundant comment.
      
      * Make sure to use correct block number of authoring.
      
      * Change the runtime API.
      
      * Support both versions.
      
      * Bump spec version, fix RPC test.
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      Co-authored-by: default avatarGavin Wood <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      74d6e660
    • Shawn Tabrizi's avatar
      Introduce `OnReapAccount` (#4585) · a1e0076a
      Shawn Tabrizi authored
      * Initial run and gun at `OnReapAccount`
      
      * Fix some imports
      
      * More fixes
      
      * Whitespace
      
      * More wack-a-mole
      
      * Gotta catch em all
      
      * Update lib.rs
      
      * Small doc update
      
      * Whitespace
      a1e0076a
  10. Jan 09, 2020
  11. Jan 08, 2020
  12. Jan 05, 2020
  13. Dec 20, 2019
  14. Dec 19, 2019
    • Bastian Köcher's avatar
      Make `decl_error!` errors usable (#4449) · 8e393aa5
      Bastian Köcher authored
      * Make `decl_error!` errors usable
      
      This pr implements support for returning errors of different pallets in
      a pallet. These errors need to be declared with `decl_error!`.
      
      The pr changes the following:
      
      - Each dispatchable function now returns a `DispatchResult` which is an
      alias for `Result<(), DispatchError>`.
      - `DispatchError` is an enum that has 4 variants:
        - `Other`: For storing string error messages
        - `CannotLookup`: Variant that is returned when something returns a
        `sp_runtime::LookupError`
        - `BadOrigin`: Variant that is returned for any kind of bad origin
        - `Module`: The error of a specific module. Contains the `index`,
        `error` and the `message`. The index is the index of the module in
        `construct_runtime!`. `error` is the index of the error in the error
        enum declared by `decl_error!`. `message` is the message to the error
        variant (this will not be encoded).
      - `construct_runtime!` now creates a new struct `ModuleToIndex`. This
      struct implements the trait `ModuleToIndex`.
      - `frame_system::Trait` has a new associated type: `ModuleToIndex` that
      expects the `ModuleToIndex` generated by `construct_runtime!`.
      - All error strings returned in any module are being converted now to `DispatchError`.
      - `BadOrigin` is the default error returned by any type that implements `EnsureOrigin`.
      
      * Fix frame system benchmarks
      8e393aa5
  15. Dec 17, 2019
  16. Dec 16, 2019
    • Tomasz Drwięga's avatar
      [big refactor] Remove crate aliasing. (#4395) · 8778ca7d
      Tomasz Drwięga authored
      * Rename: Phase 1.
      
      * Unify codec.
      
      * Fixing: Phase 2
      
      * Fixing: Phase 3.
      
      * Fixing: Phase 4.
      
      * Fixing: Phase 5.
      
      * Fixing: Phase 6.
      
      * Fixing: Phase 7.
      
      * Fixing: Phase 8. Tests
      
      * Fixing: Phase 9. Tests!!!
      
      * Fixing: Phase 10. Moar tests!
      
      * Finally done!
      
      * More fixes.
      
      * Rename primitives:: to sp_core::
      
      * Apply renames in finality-grandpa.
      
      * Fix benches.
      
      * Fix benches 2.
      
      * Revert node-template.
      
      * Fix frame-system in our modules.
      8778ca7d
  17. Dec 14, 2019
    • cheme's avatar
      Fix key collision for child trie (#4162) · 0ece5d9e
      cheme authored
      * In progress, runtime io must switch to future proof root +
      child_specific (unique id) + u32 type.
      
      * Switch interface, sr-io seems ok, rpc could use similar interface to
      sr-io, genesis json broken if there is child trie in existing encoding
      genesis.
      
      * test from previous implementation.
      
      * fix proving test.
      
      * Restore Keyspacedb from other branch, only apply to child trie.
      
      * Removing unneeded child_info from child root (child info are stored
      if things changed, otherwhise the root does not change).
      
      * Switch rpc to use same format as ext: more future proof.
      
      * use root from child info for trie backend essence.
      
      * Breaking long lines.
      
      * Update doc and clean pr a bit.
      
      * fix error type
      
      * Restore removed doc on merge and update sr-io doc.
      
      * Switch child storage api to use directly unique id, if managed id
      where to be put in place, the api will change at this time.
      
      * Clean deprecated host interface from child.
      
      * Removing assertion on child info (can fail depending on root
      memoization).
      
      * merging child info in the overlay when possible.
      
      * child iteration by prefix using child_info.
      
      * Using ChainInfo in frame support. ChainInfo gets redesign to avoid
      buffers allocation on every calls.
      
      * Add length of root to the data of child info.
      
      * comments
      
      * Encode compact.
      
      * Remove child info with root.
      
      * Fix try_update condition.
      
      * Comment Ext child root caching.
      
      * Replace tuples by struct with field
      
      * remove StorageTuple alias.
      
      * Fix doc tests, and remove StorageOverlay and ChildStorageOverlay
      aliases.
      0ece5d9e
  18. Dec 10, 2019
  19. Dec 02, 2019
    • Benjamin Kampmann's avatar
      The crate rename (#4223) · 927e13c1
      Benjamin Kampmann authored
      * Adding script for rename, could be applicable for nodes on top of it, too
      
      * add stderr and gitlab ci features
      
      * apply script
      
      * fix now minor details in expected stderr
      
      * Update the Cargo.lock
      
      * fix name: sc-transaction -> sc-tracing
      
      * fix rename in script, too
      927e13c1
  20. Nov 28, 2019
  21. Nov 25, 2019
  22. Nov 22, 2019
  23. Nov 21, 2019
  24. Nov 14, 2019
    • Benjamin Kampmann's avatar
      Reorganising the repository - external renames and moves (#4074) · 60e5011c
      Benjamin Kampmann authored
      * Adding first rough ouline of the repository structure
      
      * Remove old CI stuff
      
      * add title
      
      * formatting fixes
      
      * move node-exits job's script to scripts dir
      
      * Move docs into subdir
      
      * move to bin
      
      * move maintainence scripts, configs and helpers into its own dir
      
      * add .local to ignore
      
      * move core->client
      
      * start up 'test' area
      
      * move test client
      
      * move test runtime
      
      * make test move compile
      
      * Add dependencies rule enforcement.
      
      * Fix indexing.
      
      * Update docs to reflect latest changes
      
      * Moving /srml->/paint
      
      * update docs
      
      * move client/sr-* -> primitives/
      
      * clean old readme
      
      * remove old broken code in rhd
      
      * update lock
      
      * Step 1.
      
      * starting to untangle client
      
      * Fix after merge.
      
      * start splitting out client interfaces
      
      * move children and blockchain interfaces
      
      * Move trie and state-machine to primitives.
      
      * Fix WASM builds.
      
      * fixing broken imports
      
      * more interface moves
      
      * move backend and light to interfaces
      
      * move CallExecutor
      
      * move cli off client
      
      * moving around more interfaces
      
      * re-add consensus crates into the mix
      
      * fix subkey path
      
      * relieve client from executor
      
      * starting to pull out client from grandpa
      
      * move is_decendent_of out of client
      
      * grandpa still depends on client directly
      
      * lemme tests pass
      
      * rename srml->paint
      
      * Make it compile.
      
      * rename interfaces->client-api
      
      * Move keyring to primitives.
      
      * fixup libp2p dep
      
      * fix broken use
      
      * allow dependency enforcement to fail
      
      * move fork-tree
      
      * Moving wasm-builder
      
      * make env
      
      * move build-script-utils
      
      * fixup broken crate depdencies and names
      
      * fix imports for authority discovery
      
      * fix typo
      
      * update cargo.lock
      
      * fixing imports
      
      * Fix paths and add missing crates
      
      * re-add missing crates
      60e5011c
  25. Nov 12, 2019
  26. Nov 10, 2019
    • Bastian Köcher's avatar
      Substrate runtime interface 2.0 (#4057) · b691cfe0
      Bastian Köcher authored
      * Adds first version of traits for generating the host functions
      
      * First steps of the procedural macro
      
      * Implements generation of the host extern functions
      
      * Prefix ext host function with snake case trait name
      
      * Implement host functions implementation on the host
      
      * Change `HostFunctions` interface
      
      * Implement `HostFunctions` for tuples
      
      * Make `WasmExecutor` generic over the host functions
      
      * Begin to add a test and make it compile
      
      * Make the test succeed
      
      * Add test to ensure that host functions are not found
      
      * It's alive! Make the `set_storage` test work
      
      * Add test for mutable references
      
      * Code cleanup and documentation etc
      
      * Add marker trait for types that should be passed as SCALE encoded
      
      * Inherit the visibility from the trait and more improvements
      
      * More impls and move them into their own file
      
      * Code simplification by dropping one trait
      
      * Give it a better name
      
      * Implement traits for arrays
      
      * Refactor code to support pass by codec/inner
      
      * Docs
      
      * Implement pass by inner for some crypto types and add a test
      
      * Implement exchangeable function support
      
      * Rewrite sr-io with as runtime interface
      
      * Start reworking after master merge
      
      * Adds `PassByCodec` derive
      
      * Adds `PassByInner` derive
      
      * Fix compilation errors
      
      * More implementations
      
      * Implement runtime interface traits for `str`
      
      * Make `sr-io` compile again
      
      * Fix more compilation errors
      
      * More progress on getting stuff back to compile
      
      * More compilation fixes
      
      * Fix warnings
      
      * Remove le conversions
      
      * Add support for `wasm_only` interfaces
      
      * Implement `Allocator` interface
      
      * Improve error message
      
      * Move `WasmAllocator` to `sr-io` and more clean ups
      
      * Use correct function signature for wasm functions
      
      * Store the host functions with the Wasm runtime
      
      * Docs update
      
      * Fix compilation after master merge
      
      * Remove `sr-io/without_std`
      
      * Make `srml-support` tests run again
      
      * More compilation error fixes
      
      * Use correct doc syntax
      
      * Fix test-runtime
      
      * Fix compilation
      
      * Catch native panics when executing the wasm runtime
      
      As with the native runtime, we now catch all native panics when we
      execute the wasm runtime. The panics inside the wasm runtime were
      already catched before by the wasm executor automatically, but any panic
      in the host functions could bring down the node. The recent switch to
      execute the native counterpart of the host function in `sr-io`, makes
      this change required. The native `sr-io` functions just `panic` when
      something is not provided or any other error occured.
      
      * Fix compilation
      
      * Don't panic in a panic
      
      * Move `sr-sandbox` to new runtime interface
      
      * Fixes tests after sandbox changes
      
      * Make sure we detect invalid utf8
      
      * Fixes after master merge
      
      * Adds pass by enum strategy
      
      * Fix wasmtime integration
      
      * Some macro structure clean up
      
      * Rework and test exchangebale host functions
      
      * PassBy derive macros documentation
      
      * Docs for `runtime_interface` macro
      
      * Support wild card argument names
      
      * Adds ui tests
      
      * Make sure that we are backwards compatible to the old runtime interfaces
      
      * Documentation
      
      * Fixes after latest master merge
      
      * Make `wasmtime` happy
      
      * Make `full_crypto` work
      
      * Make the new interface versionable
      
      * Rename `Sanboxing` to `Sandbox`
      
      * Don't finalize in test while importing
      
      * Fix Performance regression
      
      * Fix test
      b691cfe0
  27. Oct 28, 2019
  28. Oct 24, 2019
    • Kian Paimani's avatar
      Better Parameterisation for Fee system (#3823) · ecd1ed7b
      Kian Paimani authored
      * Better fee parameters
      
      * Fix build
      
      * Better runtime tests
      
      * Price to Weight ratio as type parameter (#3856)
      
      * Price to Weight ration as type parameter
      
      * Kian feedback
      
      * Some renames.
      
      * Fix executor tests
      
      * Getting Closer.
      
      * Phantom Data
      
      * Actually fix executor tests.
      
      * Fix tests.
      
      * Remove todo
      
      * Fix build
      ecd1ed7b
  29. Oct 22, 2019
    • Tomasz Drwięga's avatar
      Runtime logging. (#3821) · 20a39897
      Tomasz Drwięga authored
      * Implement Printable for tuples.
      
      * Add debugging function.
      
      * Add debug 1.
      
      * Implement  for everything.
      
      * RuntimeDebug derive.
      
      * Introduce RuntimeDebug.
      
      * Add some dummy logging.
      
      * Replace RuntimeDebug with Debug.
      
      * Revert "Replace RuntimeDebug with Debug."
      
      This reverts commit bc47070a8cb30241b2b590b2fa29fd195088162f.
      
      * Working on Debug for all.
      
      * Fix bounds.
      
      * Add debug utils.
      
      * Implement runtime logging.
      
      * Add some docs and clean up.
      
      * Clean up derives.
      
      * Fix custom derive impl.
      
      * Bump runtime.
      
      * Fix long lines.
      
      * Fix doc test.
      
      * Use CARGO_CFG_STD.
      
      * Revert "Use CARGO_CFG_STD."
      
      This reverts commit ea429566de18ed0fa052571b359eb9826a64a9f4.
      
      * Use parse_macro_input
      
      * Update lockfile.
      
      * Apply review suggestions.
      
      * Remove stray re-export.
      
      * Add no-std impl.
      
      * Update lockfile.
      20a39897
    • asynchronous rob's avatar
      Explicitly declare decl_storage! getters as functions (#3870) · 5d5e7102
      asynchronous rob authored
      * parse decl_storage getters with fn keyword
      
      * test for get in decl_storage
      
      * update all decl_storage! getters
      
      * bump version
      
      * adjust missed doc line
      5d5e7102
  30. Oct 19, 2019
  31. Oct 17, 2019
    • Kian Paimani's avatar
      refactor: Transaction-Payment module (#3816) · 183c1881
      Kian Paimani authored
      * Initial draft that compiles
      
      * Extract payment stuff from balances
      
      * Extract multiplier update stuff from system
      
      * Some fixes.
      
      * Update len-fee as well
      
      * some review comments.
      
      * Remove todo
      
      * bump
      183c1881