Skip to content
  1. May 24, 2024
    • Oliver Tale-Yazdi's avatar
      Remove litep2p git dependency (#4560) · 49bd6a6e
      Oliver Tale-Yazdi authored
      @serban300
      
       could you please do the same for the MMR crate? Am not sure
      what commit was released since there are no release tags in the repo.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      49bd6a6e
    • Branislav Kontur's avatar
      Attempt to avoid specifying `BlockHashCount` for different... · ef144b1a
      Branislav Kontur authored
      Attempt to avoid specifying `BlockHashCount` for different `mocking::{MockBlock, MockBlockU32, MockBlockU128}` (#4543)
      
      While doing some migration/rebase I came in to the situation, where I
      needed to change `mocking::MockBlock` to `mocking::MockBlockU32`:
      ```
      #[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
      impl frame_system::Config for TestRuntime {
      	type Block = frame_system::mocking::MockBlockU32<TestRuntime>;
      	type AccountData = pallet_balances::AccountData<ThisChainBalance>;
      }
      ```
      But actual `TestDefaultConfig` for `frame_system` is using `ConstU64`
      for `type BlockHashCount = frame_support::traits::ConstU64<10>;`
      [here](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/system/src/lib.rs#L303).
      Because of this, it force me to specify and add override for `type
      BlockHashCount = ConstU32<10>`.
      
      This PR tries to fix this with `TestBlockHashCount` implementation for
      `TestDefaultConfig` which supports `u32`, `u64` and `u128` as a
      `BlockNumber`.
      
      ### How to simulate error
      Just by removing `type BlockHashCount = ConstU32<250>;`
      [here](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/multisig/src/tests.rs#L44)
      ```
      :~/parity/olkadot-sdk$ cargo test -p pallet-multisig
         Compiling pallet-multisig v28.0.0 (/home/bparity/parity/aaa/polkadot-sdk/substrate/frame/multisig)
      error[E0277]: the trait bound `ConstU64<10>: frame_support::traits::Get<u32>` is not satisfied
         --> substrate/frame/multisig/src/tests.rs:41:1
          |
      41  | #[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
          | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `frame_support::traits::Get<u32>` is not implemented for `ConstU64<10>`
          |
          = help: the following other types implement trait `frame_support::traits::Get<T>`:
                    <ConstU64<T> as frame_support::traits::Get<u64>>
                    <ConstU64<T> as frame_support::traits::Get<std::option::Option<u64>>>
      note: required by a bound in `frame_system::Config::BlockHashCount`
         --> /home/bparity/parity/aaa/polkadot-sdk/substrate/frame/system/src/lib.rs:535:24
          |
      535 |         type BlockHashCount: Get<BlockNumberFor<Self>>;
          |                              ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Config::BlockHashCount`
          = note: this error originates in the attribute macro `derive_impl` which comes from the expansion of the macro `frame_support::macro_magic::forward_tokens_verbatim` (in Nightly builds, run with -Z macro-backtrace for more info)
      
      For more information about this error, try `rustc --explain E0277`.
      error: could not compile `pallet-multisig` (lib test) due to 1 previous error 
      ```
      
      
      
      
      ## For reviewers:
      
      (If there is a better solution, please let me know!)
      
      The first commit contains actual attempt to fix the problem:
      https://github.com/paritytech/polkadot-sdk/commit/3c5499e539f2218503fbd6ce9be085b03c31ee13.
      The second commit is just removal of `BlockHashCount` from all other
      places where not needed by default.
      
      Closes: https://github.com/paritytech/polkadot-sdk/issues/1657
      
      
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      ef144b1a
    • Serban Iorga's avatar
      Use polkadot-ckb-merkle-mountain-range dependency (#4562) · 700d5910
      Serban Iorga authored
      We need to use the `polkadot-ckb-merkle-mountain-range` dependency
      published on `crates.io` in order to unblock the release of the
      `sp-mmr-primitives` crate
      700d5910
  2. May 23, 2024
  3. May 22, 2024
  4. May 21, 2024
  5. May 20, 2024
  6. May 19, 2024
  7. May 17, 2024
  8. May 16, 2024
    • Jesse Chejieh's avatar
      Adds `MaxRank` Config in `pallet-core-fellowship` (#3393) · d5fe478e
      Jesse Chejieh authored
      
      
      resolves #3315
      
      ---------
      
      Co-authored-by: default avatardoordashcon <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      d5fe478e
    • Clara van Staden's avatar
      Snowbridge - Ethereum Client - Reject finalized updates without a sync... · 943eb46e
      Clara van Staden authored
      Snowbridge - Ethereum Client - Reject finalized updates without a sync committee in next store period (#4478)
      
      While syncing Ethereum consensus updates to the Snowbridge Ethereum
      light client, the syncing process stalled due to error
      `InvalidSyncCommitteeUpdate` when importing the next sync committee for
      period `1087`.
      
      This bug manifested specifically because our light client checkpoint is
      a few weeks old (submitted to governance weeks ago) and had to catchup
      until a recent block. Since then, we have done thorough testing of the
      catchup sync process.
      
      ### Symptoms
      - Import next sync committee for period `1086` (essentially period
      `1087`). Light client store period = `1086`.
      - Import header in period `1087`. Light client store period = `1087`.
      The current and next sync committee is not updated, and is now in an
      outdated state. (current sync committee = `1086` and current sync
      committee = `1087`, where it should be current sync committee = `1087`
      and current sync committee = `None`)
      - Import next sync committee for period `1087` (essentially period
      `1088`) fails because the expected next sync committee's roots don't
      match.
      
      ### Bug
      The bug here is that the current and next sync committee's didn't
      handover when an update in the next period was received.
      
      ### Fix
      There are two possible fixes here:
      1. Correctly handover sync committees when a header in the next period
      is received.
      2. Reject updates in the next period until the next sync committee
      period is known.
      
      We opted for solution 2, which is more conservative and requires less
      changes.
      
      ### Polkadot-sdk versions
      This fix should be backported in polkadot-sdk versions 1.7 and up.
      
      Snowfork PR: https://github.com/Snowfork/polkadot-sdk/pull/145
      
      
      
      ---------
      
      Co-authored-by: default avatarVincent Geddes <[email protected]>
      943eb46e
    • polka.dom's avatar
      Remove pallet::getter usage from the democracy pallet (#4472) · 04f88f5b
      polka.dom authored
      As per #3326, removes usage of the pallet::getter macro from the
      democracy pallet. The syntax `StorageItem::<T, I>::get()` should be used
      instead.
      
      cc @muraca
      04f88f5b
    • Dmitry Markin's avatar
      Demote per-peer validation slots warning to debug (#4480) · 8d293970
      Dmitry Markin authored
      Demote `Ignored block announcement because all validation slots for this
      peer are occupied.` message to debug level.
      
      This is mostly an indicator of somebody spamming the node or (more
      likely) some node actively keeping up with the network but not
      recognizing it's in a major sync mode, so sending zillions of block
      announcements (have seen this on Versi).
      
      This warning shouldn't be considered an error by the end user, so let's
      make it debug.
      
      Ref. https://github.com/paritytech/polkadot-sdk/issues/1929.
      8d293970
    • Svyatoslav Nikolsky's avatar
      Bridge: drop subscriptions when they are no longer required (#4481) · 453bb18c
      Svyatoslav Nikolsky authored
      The bridge relay is **not** using `tokio`, while `jsonrpsee` does. To
      make it work together, we are spawning a separate tokio task for every
      jsonrpsee subscription, which holds a subscription reference. It looks
      like we are not stopping those tasks when we no longer need it and when
      there are more than `1024` active subscriptions, `jsonrpsee` stops
      opening new subscriptions. This PR adds an `cancel` signal that is sent
      to the background task when we no longer need a subscription.
      453bb18c
    • Alexandru Vasile's avatar
      network/discovery: Add to DHT only peers that support genesis-based protocol (#3833) · 3399bc09
      Alexandru Vasile authored
      This PR adds to the DHT only the peers that support the genesis/fork/kad
      protocol.
      Before this PR, any peer that supported the legacy `/kad/[id]` protocol
      was added to the DHT.
      
      This is the first step in removing the support for the legacy kad
      protocols.
      
      While I have adjusted unit tests to validate the appropriate behavior,
      this still needs proper testing in our stack.
      
      Part of https://github.com/paritytech/polkadot-sdk/issues/504
      
      .
      
      cc @paritytech/networking
      
      ---------
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      3399bc09
    • Oliver Tale-Yazdi's avatar
      [Runtime] Bound XCMP queue (#3952) · 4adfa37d
      Oliver Tale-Yazdi authored
      Re-applying #2302 after increasing the `MaxPageSize`.  
      
      Remove `without_storage_info` from the XCMP queue pallet. Part of
      https://github.com/paritytech/polkadot-sdk/issues/323
      
      Changes:
      - Limit the number of messages and signals a HRMP channel can have at
      most.
      - Limit the number of HRML channels.
      
      A No-OP migration is put in place to ensure that all `BoundedVec`s still
      decode and not truncate after upgrade. The storage version is thereby
      bumped to 5 to have our tooling remind us to deploy that migration.
      
      ## Integration
      
      If you see this error in your try-runtime-cli:  
      ```pre
      Max message size for channel is too large. This means that the V5 migration can be front-run and an
      attacker could place a large message just right before the migration to make other messages un-decodable.
      Please either increase `MaxPageSize` or decrease the `max_message_size` for this channel. Channel max:
      102400, MaxPageSize: 65535
      ```
      
      Then increase the `MaxPageSize` of the `cumulus_pallet_xcmp_queue` to
      something like this:
      ```rust
      type MaxPageSize = ConstU32<{ 103 * 1024 }>;
      ```
      
      There is currently no easy way for on-chain governance to adjust the
      HRMP max message size of all channels, but it could be done:
      https://github.com/paritytech/polkadot-sdk/issues/3145
      
      .
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarFrancisco Aguirre <[email protected]>
      4adfa37d
    • polka.dom's avatar
      Remove pallet::getter usage from the bounties and child-bounties pallets (#4392) · 6487ac1e
      polka.dom authored
      
      
      As per #3326, removes pallet::getter usage from the bounties and
      child-bounties pallets. The syntax `StorageItem::<T, I>::get()` should
      be used instead.
      
      Changes to one pallet involved changes in the other, so I figured it'd
      be best to combine these two.
      
      cc @muraca
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      6487ac1e