1. Jan 13, 2021
    • Bernhard Schuster's avatar
      display errors with their sources (#2264) · 2fd345b8
      Bernhard Schuster authored
      * update futures to 0.3.9
      
      * companion changes for generic error types
      
      * improve errors, keep error sources
      
      * command compile fix
      
      * use the correct Error type, add annotation
      
      * avoid async { fut.await.map_err(E::Variant) } with TryFuture
      
      * fix cargo lock, bump futures to 0.3.10
      
      futures 0.3.9 got yanked
      
      * chore cargo update -p sp-io
      
      * minor quirk
      
      * make rustc 1.48 happy by bouning the error more tightly
      
      * be more explicit
      
      * cargo lock futures
      2fd345b8
    • Sergey Pepyakin's avatar
      4fbfe934
    • ordian's avatar
      Companion for substrate#7892 (#2262) · e5ee5748
      ordian authored
      * session_info: use correct authorities set
      
      * bump rococo spec_version to 19
      
      * "Update Substrate"
      
      Co-authored-by: parity-processbot <>
      e5ee5748
    • Bernhard Schuster's avatar
      metered mpsc channels (#2235) · e3676fdc
      Bernhard Schuster authored
      e3676fdc
    • Sergey Pepyakin's avatar
      HRMP channel deposits (#2225) · 4489b528
      Sergey Pepyakin authored
      * Drive by fixes
      
      The visibility modifiers are remnants of the previous structure where
      HRMP wasn't a standalone module, by rather a submodule of the router
      module.
      
      * Add Currency assoc type to Config
      
      This would allow us to reserve balance for deposits. This commit also
      integrates the HRMP module in rococo, test-runtime and mocks to use the
      balances pallet.
      
      * Fix a bug that doesn't increment the age
      
      In case the request is not confirmed, the age would be incremented but
      not persisted.
      
      * Fix cleaning the indexes
      
      Before that change, the cleaning of the channel indexes was wrong, because it
      naively removed entire rows that was pertaining to the para we delete.
      This approach is flawed because it doesn't account for the rows that are
      pertaining to other paras that contain the outgoing one.
      
      This clearly violates the invariant imposed on the indexes, that all
      the index rows must contain alive paras, but apart from that it also
      lead to the situation where ingress index would contain the a different
      set of channels that an egress have.
      
      * Reserve currency for opening the channels
      
      Note the ugly `unique_saturated_into` calls. The reason for them is the
      currency trait accepts and defines the `Balance` associated type and the
      deposit values are coming from the `HostConfiguration` where they are
      defined using the `Balance`.
      
      I figured that parameterising `HostConfiguration` would be annoying. On
      the other hand, I don't expect these `unique_saturated_into` calls to
      give us problems since it seems to be a reasonable assumption that this
      module will be instantiated within a runtime where the Currency provided
      will have a Balance that matches the one used in the configuration.
      
      * Tests: Adapt `run_to_block` so that it submits a proper config
      
      * Tests: exercise the deposit logic
      4489b528
    • Sergey Pepyakin's avatar
      Avoid inlining `update_config_member` (#2246) · d0703258
      Sergey Pepyakin authored
      Closes #2241
      d0703258
  2. Jan 12, 2021
  3. Jan 11, 2021
  4. Jan 08, 2021
  5. Jan 07, 2021
  6. Jan 06, 2021
  7. Jan 05, 2021
    • Bastian Köcher's avatar
      Improve the `unbacked-span` (#2206) · 4f41fb74
      Bastian Köcher authored
      This ensures that we also record the first `import_statement` that will
      lead to the creation of the `unbacked-span`.
      4f41fb74
    • Peter Goodspeed-Niklaus's avatar
      Reduce the inclusion inherent's actual weight if the block is already heavy (#2060) · 0508b6f2
      Peter Goodspeed-Niklaus authored
      * don't modify inherent data on heavy block
      
      * write up current thinking on block weight detection
      
      * extract inherent inclusion check into its own function
      
      * put heavy block check into runtime
      
      * the `inclusion` inherent call is Operational, not Mandatory
      
      This resolves a lot of the trickiness about this issue, because
      we no longer need to override or supplant any existing proposer
      logic; the existing logic should exhibit these behaviors:
      
      - the `inclusion` inherent is prioritized over standard transactions
      - but if it's too heavy, i.e. in case of runtime upgrade, it'll be
        dropped in favor of that.
      
      It is my belief that allowing the proposer to just not include
      this data won't have any adverse effects: it's equivalent to replacing
      them with empty versions of themselves, which the `ProvideInherent`
      impl already does.
      
      * Revert "the `inclusion` inherent call is Operational, not Mandatory"
      
      This reverts commit e58858d1.
      
      * Revert "write up current thinking on block weight detection"
      
      This reverts commit fd587b80.
      
      * Revert "don't modify inherent data on heavy block"
      
      This reverts commit 38299d3c
      
      .
      
      * add backed candidate block weight assumption to configuration
      
      * Limit backed candidates according to a candidate weight heuristic.
      
      This approach replaces making the inclusion inherent non-mandatory.
      It's still not ideal in that we have to configure a heuristic for
      how much each backed candidate 'weighs', instead of directly
      measuring it somehow.
      
      This approach also never truncates the signed bitfields. The
      rationale for that depends on some assumptions:
      
      - processing the signed bitfields is cheap compared to the
        backed candidates
      - it is beneficial to the progress of the relay chain
        to update the signed bitfields even if not all backed candidates
        are updated
      
      * simplify limit_backed_candidates and weight assumption
      
      * don't trust the provisioner to fairly distribute candidates
      
      * use saturating subtraction
      
      * empty commit to restart ci
      
      * use new mechanism for getting max block weight
      
      * apply weight refunds to the inclusion inherent
      
      This makes some assumptions about fundamental weights, which are
      encapsulated as constants. From there, it lets Substrate know
      what the actual computed weight of the inherent is.
      
      * use a correct fixed weight for the inclusion inherent
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * use dynamic inclusion weight so we reduce calculated weight when excluding candidates
      
      * don't double-count this intrinsic's weight in the block weight
      
      * add unit tests of fn limit_backed_candidates
      
      * add tests that the inclusion inherent's weight correctly updates
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      0508b6f2