Skip to content
  1. Aug 15, 2022
  2. Aug 14, 2022
  3. Aug 13, 2022
    • Shawn Tabrizi's avatar
      Add Benchmarking Instance to Pallets (#12026) · e5ed764d
      Shawn Tabrizi authored
      * benchmark instance
      
      * add benchmark instance to conviction voting
      
      * instance on bags list
      
      * fmt
      e5ed764d
    • Shawn Tabrizi's avatar
      Fix Gov V2 Benchmarks (#12022) · 2950340e
      Shawn Tabrizi authored
      * better benchmark log
      
      * Update lib.rs
      
      * fix gov2 benchmarks
      
      * saturating math + fmt
      
      * add comment
      2950340e
    • Tsvetomir Dimitrov's avatar
      Runtime API versioning (#11779) · 2bff2f84
      Tsvetomir Dimitrov authored
      
      
      * Runtime API versioning
      
      Related to issue #11577
      
      Add support for multiple versions of a Runtime API. The purpose is to
      have one main version of the API, which is considered stable and
      multiple unstable (aka staging) ones.
      
      How it works
      ===========
      Some methods of the API trait can be tagged with `#[api_version(N)]`
      attribute where N is version number bigger than the main one. Let's call
      them **staging methods** for brevity.
      
      The implementor of the API decides which version to implement.
      
      Example (from https://github.com/paritytech/substrate/issues/11577#issuecomment-1145347025):
      
      ```
      decl_runtime_apis! {
          #{api_version(10)]
          trait Test {
               fn something() -> Vec<u8>;
               #[api_version(11)]
               fn new_cool_function() -> u32;
          }
      }
      ```
      
      ```
      impl_runtime_apis! {
          #[api_version(11)]
          impl Test for Runtime {
               fn something() -> Vec<u8> { vec![1, 2, 3] }
      
               fn new_cool_function() -> u32 {
                   10
               }
          }
      }
      ```
      
      Version safety checks (currently not implemented)
      =================================================
      By default in the API trait all staging methods has got default
      implementation calling `unimplemented!()`. This is a problem because if
      the developer wants to implement version 11 in the example above and
      forgets to add `fn new_cool_function()` in `impl_runtime_apis!` the
      runtime will crash when the function is executed.
      
      Ideally a compilation error should be generated in such cases.
      
      TODOs
      =====
      
      Things not working well at the moment:
      [ ] Version safety check
      [ ] Integration tests of `primitives/api` are messed up a bit. More
      specifically `primitives/api/test/tests/decl_and_impl.rs`
      [ ] Integration test covering the new functionality.
      [ ] Some duplicated code
      
      * Update primitives/api/proc-macro/src/impl_runtime_apis.rs
      
      Code review feedback and formatting
      
      Co-authored-by: default avatarasynchronous rob <[email protected]>
      
      * Code review feedback
      
      Applying suggestions from @bkchr
      
      
      
      * fmt
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Code review feedback
      
      * dummy trait -> versioned trait
      
      * Implement only versioned traits (not compiling)
      
      * Remove native API calls (still not compiling)
      
      * fmt
      
      * Fix compilation
      
      * Comments
      
      * Remove unused code
      
      * Remove native runtime tests
      
      * Remove unused code
      
      * Fix UI tests
      
      * Code review feedback
      
      * Code review feedback
      
      * attribute_names -> common
      
      * Rework `append_api_version`
      
      * Code review feedback
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Code review feedback
      
      * Code review feedback
      
      * Code review feedback
      
      * Use type alias for the default trait - doesn't compile
      
      * Fixes
      
      * Better error for `method_api_ver < trait_api_version`
      
      * fmt
      
      * Rework how we call runtime functions
      
      * Update UI tests
      
      * Fix warnings
      
      * Fix doctests
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Fix formatting and small compilation errors
      
      * Update primitives/api/proc-macro/src/impl_runtime_apis.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      Co-authored-by: default avatarasynchronous rob <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      2bff2f84
  4. Aug 12, 2022
  5. Aug 11, 2022
  6. Aug 10, 2022
  7. Aug 09, 2022
    • Nazar Mokrynskyi's avatar
      Network sync refactoring (part 6) (#11940) · a685582b
      Nazar Mokrynskyi authored
      * Extract `NetworkKVProvider` trait in `sc-authority-discovery` and remove unnecessary dependency
      
      * Extract `NetworkSyncForkRequest` trait in `sc-finality-grandpa`
      
      * Relax requirements on `SyncOracle` trait, remove extra native methods from `NetworkService` that are already provided by trait impls
      
      * Move `NetworkSigner` trait from `sc-authority-discovery` into `sc-network-common` and de-duplicate methods on `NetworkService`
      
      * Move `NetworkKVProvider` trait from `sc-authority-discovery` into `sc-network-common` and de-duplicate methods on `NetworkService`
      
      * Minimize `sc-authority-discovery` dependency on `sc-network`
      
      * Move `NetworkSyncForkRequest` trait from `sc-finality-grandpa` to `sc-network-common` and de-duplicate methods in `NetworkService`
      
      * Extract `NetworkStatusProvider` trait and de-duplicate methods on `NetworkService`
      
      * Extract `NetworkPeers` trait and de-duplicate methods on `NetworkService`
      
      * Extract `NetworkEventStream` trait and de-duplicate methods on `NetworkService`
      
      * Move more methods from `NetworkService` into `NetworkPeers` trait
      
      * Move `NetworkStateInfo` trait into `sc-network-common`
      
      * Extract `NetworkNotification` trait and de-duplicate methods on `NetworkService`
      
      * Extract `NetworkRequest` trait and de-duplicate methods on `NetworkService`
      
      * Remove `NetworkService::local_peer_id()`, it is already provided by `NetworkStateInfo` impl
      
      * Extract `NetworkTransaction` trait and de-duplicate methods on `NetworkService`
      
      * Extract `NetworkBlock` trait and de-duplicate methods on `NetworkService`
      
      * Remove dependencies on `NetworkService` from most of the methods of `sc-service`
      
      * Address simple review comments
      a685582b
    • Koute's avatar
      Restore `wasmtime`'s default stack size limit to 1MB (#11993) · 9c56e79c
      Koute authored
      * Restore `wasmtime`'s default stack size limit to 1MB
      
      * Add extra comments
      
      * Enforce different maximum call depth in release mode
      
      * Split the call depth limit in two
      9c56e79c
  8. Aug 08, 2022
  9. Aug 05, 2022
    • Bastian Köcher's avatar
      system_syncState: Always return highest block (#11979) · a3144848
      Bastian Köcher authored
      Before `highestBlock` was an optional that was omitted when it was `None`. We recently changed the
      way the `highestBlock` is determined, this resulted in having this value in 99.99% of the time being
      `None` when the node is syncing blocks at the tip. Now we always return a block for `highestBlock`.
      If sync doesn't return us any best seen block, we return our own local best block as `highestBlock`.
      This should mainly reflect the same behavior to before we changed the way the best seen block is determined.
      a3144848
    • Dmitry Markin's avatar
    • Dmitry Markin's avatar
      Change on-the-wire protocol names to include genesis hash & fork id (#11938) · 6eda842c
      Dmitry Markin authored
      * Rename transactions protocol to include genesis hash
      
      * Add protocol name generation to sc_network::utils
      
      * Use utils functions for transactions protocol name generation
      
      * Extract protocol name generation into public module
      
      * Use sc_network::protocol_name::standard_protocol_name() for BEEFY and GRANDPA
      
      * minor: add missing newline at EOF
      
      * Change block-announces protocol name to include genesis_hash & fork_id
      
      * Change protocol names to include genesis hash and fork id
      
      Protocols changed:
          - sync
          - state
          - light
          - sync/warp
      
      * Revert "Use sc_network::protocol_name::standard_protocol_name() for BEEFY and GRANDPA"
      
      This reverts commit cd60a95a3face397e1b67f4bc95dd0f2b581bfae.
      
      * Get rid of `protocol_name` module
      6eda842c
  10. Aug 04, 2022
  11. Aug 03, 2022
  12. Aug 02, 2022