1. Sep 18, 2023
    • Gonçalo Pestana's avatar
      Implements a variable deposit base calculation for EPM signed submissions (#1547) · 614aa31b
      Gonçalo Pestana authored
      **Note**: This is a lift-and-shift PR from the old substrate and
      polkadot repos, both PRs have been reviewed and audited
      (https://github.com/paritytech/substrate/pull/13983,
      https://github.com/paritytech/polkadot/pull/7140)
      
      ---
      
      This PR implements a generic `BaseDeposit` calculation for signed
      submissions, based on the size of the submission queue.
      
      It adds a new associated type to EPM's config, `type SignedDepositBase`,
      that implements `Convert<usize, BalanceOf<T>>`, which is used to
      calculate the base deposit for signed submissions based on the size of
      the signed submissions queue.
      
      `struct GeometricDepositBase<Balance, Fixed, Inc>` implements the
      convert trait so that the deposit value increases as a geometric
      progression. The deposit base is calculated by `deposit_base =
      fixed_deposit_base * (1 + increase_factor)^n`, where `n` is the term of
      the progression (i.e. the number of signed submissions in the queue).
      `Fixed` and `Inc` generic params are getters for `Balance` and
      `IncreaseFactor` to compute the geometric progression. If
      `IncreaseFactor = 0`, then the signed deposit is constant and equal to
      `Fixed` regardless of the size of the queue.
      
      ### Runtime configs
      
      In Kusama, the progression with 10% increase without changing the
      current signed fixed deposit is: (term == size of the queue)
      
      Term 1: `1,333,333,332,000`
      Term 2: `1,333,333,332,000 * 1.10 = 1,466,666,665,200`
      Term 3: `1,333,333,332,000 * 1.10^2 = 1,613,333,331,200`
      Term 4: `1,333,333,332,000 * 1.10^3 = 1,774,666,664,320`
      Term 5: `1,333,333,332,000 * 1.10^4 = 1,952,133,330,752`
      Term 6: `1,333,333,332,000 * 1.10^5 = 2,147,346,663,827.20`
      Term 7: `1,333,333,332,000 * 1.10^6 = 2,362,081,330,210.92`
      Term 8: `1,333,333,332,000 * 1.10^7 = 2,598,289,463,231.01`
      Term 9: `1,333,333,332,000 * 1.10^8 = 2,858,118,409,554.11`
      Term 10: `1,333,333,332,000 * 1.10^9 = 3,143,930,250,509.52`
      
      Westend:
      
      Term 1: `2,000,000,000,000`
      Term 2: `2,000,000,000,000 * 1.10 = 2,200,000,000,000`
      Term 3: `2,000,000,000,000 * 1.10^2 = 2,420,000,000,000`
      Term 4: `2,000,000,000,000 * 1.10^3 = 2,662,000,000,000`
      Term 5: `2,000,000,000,000 * 1.10^4 = 2,928,200,000,000`
      Term 6: `2,000,000,000,000 * 1.10^5 = 3,221,020,000,000`
      Term 7: `2,000,000,000,000 * 1.10^6 = 3,543,122,000,000`
      Term 8: `2,000,000,000,000 * 1.10^7 = 3,897,434,200,000`
      Term 9: `2,000,000,000,000 * 1.10^8 = 4,287,177,620,000`
      Term 10: `2,000,000,000,000 * 1.10^9 = 4,715,895,382,000`
      
      and in Polkadot, the deposit increase is disabled in the current state
      of the PR, as the increase factor is 0% -- so nothing changes from the
      current behaviour.
      
      Closes https://github.com/paritytech-secops/srlabs_findings/issues/189
      614aa31b
    • Sacha Lansky's avatar
      [improve docs]: Timestamp pallet (#1435) · f6072e8b
      Sacha Lansky authored
      This PR improves the docs for the Timestamp pallet by following our
      [Documentation
      Guidelines](https://github.com/paritytech/polkadot-sdk/blob/master/docs/DOCUMENTATION_GUIDELINE.md
      
      )
      more closely.
      
      ---------
      
      Co-authored-by: default avatarJuan <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      f6072e8b
    • Sacha Lansky's avatar
      [improve docs] Example pallet crate and Basic Example pallet (#1546) · 1d5a9d25
      Sacha Lansky authored
      This fixes the broken links in the crate level documentation of the
      Examples crate. It also updates the documentation for the Basic Example
      pallet by removing the template for documenting a pallet (we now have
      [this](https://github.com/paritytech/polkadot-sdk/blob/master/docs/DOCUMENTATION_GUIDELINE.md)
      to refer to instead).
      
      Note: I found it unnecessary to provide a link to the doc guidelines as
      I don't think this would be where someone should discover them. I also
      want to flag some ideas that came while making these minor improvements
      in [this
      issue](https://github.com/paritytech/polkadot-sdk-docs/issues/27) (for a
      subsequent PR) as part of ongoing docs work.
      1d5a9d25
    • yjh's avatar
      Executor: Remove `LegacyInstanceReuse` strategy (#1486) · e3899880
      yjh authored
      
      
      It seems the old strategy have been depracted more than one year. 
      So maybe it's time to clean up old strategy for wasm executor.
      
      
      ---
      polkadot address: 15ouFh2SHpGbHtDPsJ6cXQfes9Cx1gEFnJJsJVqPGzBSTudr
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarKoute <[email protected]>
      e3899880
  2. Sep 17, 2023
  3. Sep 16, 2023
    • joe petrowski's avatar
      Include `bitvec` in `std` for Broker Pallet (#1558) · 11d1a395
      joe petrowski authored
      When adding this pallet to the [Coretime
      Chain](https://github.com/paritytech/polkadot-sdk/pull/1479), this
      dependency results in conflicting implementations (rustc error below).
      This toml change fixes it.
      
      ```
      error: failed to run custom build command for `coretime-rococo-runtime v1.0.0 (/home/joe/parity/polkadot-sdk/cumulus/parachains/runtimes/coretime/coretime-rococo)`
      
      Caused by:
        process didn't exit successfully: `/home/joe/parity/polkadot-sdk/target/debug/build/coretime-rococo-runtime-7943703d2770a119/build-script-build` (exit status: 1)
        --- stdout
        Information that should be included in a bug report.
        Executing build command: RUSTFLAGS="-C target-cpu=mvp -C target-feature=-sign-ext -C link-arg=--export-table -Clink-arg=--export=__heap_base -C link-arg=--import-memory  " SKIP_WASM_BUILD="" "/home/joe/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=/home/joe/parity/polkadot-sdk/target/debug/wbuild/coretime-rococo-runtime/Cargo.toml" "--color=always" "--profile" "release"
        Using rustc version: rustc 1.71.1 (eb26296b5 2023-08-03)
      
      
        --- stderr
           Compiling sp-io v23.0.0 (/home/joe/parity/polkadot-sdk/substrate/primitives/io)
           Compiling coretime-rococo-runtime v1.0.0 (/home/joe/parity/polkadot-sdk/cumulus/parachains/runtimes/coretime/coretime-rococo)
        error[E0152]: found duplicate lang item `panic_impl`
            --> /home/joe/parity/polkadot-sdk/substrate/primitives/io/src/lib.rs:1749:1
             |
        1749 | pub fn panic(info: &core::panic::PanicInfo) -> ! {
             | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             |
             = note: the lang item is first defined in crate `std` (which `bitvec` depends on)
             = note: first definition in `std` loaded from /home/joe/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libstd-67dfbacfb4b441ef.rlib
             = note: second definition in the local crate (`sp_io`)
      
        For more information about this error, try `rustc --explain E0152`.
      ```
      11d1a395
  4. Sep 15, 2023
  5. Sep 14, 2023
  6. Sep 13, 2023
  7. Sep 12, 2023
  8. Sep 11, 2023
  9. Sep 08, 2023
  10. Sep 07, 2023
  11. Sep 06, 2023