Skip to content
  1. Apr 26, 2024
    • Tsvetomir Dimitrov's avatar
      Implementation of the new validator disabling strategy (#2226) · 988e30f1
      Tsvetomir Dimitrov authored
      Closes https://github.com/paritytech/polkadot-sdk/issues/1966,
      https://github.com/paritytech/polkadot-sdk/issues/1963 and
      https://github.com/paritytech/polkadot-sdk/issues/1962.
      
      Disabling strategy specification
      [here](https://github.com/paritytech/polkadot-sdk/pull/2955). (Updated
      13/02/2024)
      
      Implements:
      * validator disabling for a whole era instead of just a session
      * no more than 1/3 of the validators in the active set are disabled
      Removes:
      * `DisableStrategy` enum - now each validator committing an offence is
      disabled.
      * New era is not forced if too many validators are disabled.
      
      Before this PR not all offenders were disabled. A decision was made
      based on [`enum
      DisableStrategy`](https://github.com/paritytech/polkadot-sdk/blob/bbb66316/substrate/primitives/staking/src/offence.rs#L54).
      Some offenders were disabled for a whole era, some just for a session,
      some were not disabled at all.
      
      This PR changes the disabling behaviour. Now a validator committing an
      offense is disabled immediately till the end of the current era.
      
      Some implementation notes:
      * `OffendingValidators` in pallet session keeps all offenders (this is
      not changed). However its type is changed from `Vec<(u32, bool)>` to
      `Vec<u32>`. The reason is simple - each offender is getting disabled so
      the bool doesn't make sense anymore.
      * When a validator is disabled it is first added to
      `OffendingValidators` and then to `DisabledValidators`. This is done in
      [`add_offending_validator`](https://github.com/paritytech/polkadot-sdk/blob/bbb66316/substrate/frame/staking/src/slashing.rs#L325)
      from staking pallet.
      * In
      [`rotate_session`](https://github.com/paritytech/polkadot-sdk/blob/bdbe9829/substrate/frame/session/src/lib.rs#L623)
      the `end_session` also calls
      [`end_era`](https://github.com/paritytech/polkadot-sdk/blob/bbb66316/substrate/frame/staking/src/pallet/impls.rs#L490)
      when an era ends. In this case `OffendingValidators` are cleared
      **(1)**.
      * Then in
      [`rotate_session`](https://github.com/paritytech/polkadot-sdk/blob/bdbe9829/substrate/frame/session/src/lib.rs#L623)
      `DisabledValidators` are cleared **(2)**
      * And finally (still in `rotate_session`) a call to
      [`start_session`](https://github.com/paritytech/polkadot-sdk/blob/bbb66316
      
      /substrate/frame/staking/src/pallet/impls.rs#L430)
      repopulates the disabled validators **(3)**.
      * The reason for this complication is that session pallet knows nothing
      abut eras. To overcome this on each new session the disabled list is
      repopulated (points 2 and 3). Staking pallet knows when a new era starts
      so with point 1 it ensures that the offenders list is cleared.
      
      ---------
      
      Co-authored-by: default avatarordian <[email protected]>
      Co-authored-by: default avatarordian <[email protected]>
      Co-authored-by: default avatarMaciej <[email protected]>
      Co-authored-by: default avatarGonçalo Pestana <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarAnkan <[email protected]>
      988e30f1
    • thiolliere's avatar
      Try state: log errors instead of loggin the number of error and discarding them (#4265) · 97f74253
      thiolliere authored
      
      
      Currently we discard errors content
      We should at least log it.
      
      Code now is more similar to what is written in try_on_runtime_upgrade.
      
      label should be R0
      
      ---------
      
      Co-authored-by: default avatarOliver Tale-Yazdi <[email protected]>
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      Co-authored-by: default avatarJavier Bullrich <[email protected]>
      97f74253
    • Svyatoslav Nikolsky's avatar
      Bridges: added helper function to relay single GRANDPA proof + header (#4307) · 9a48cd70
      Svyatoslav Nikolsky authored
      
      
      related to
      https://github.com/paritytech/parity-bridges-common/issues/2962
      silent, because the actual code for subcommand is added in the
      `parity-bridges-common` repo, where binary lives
      
      ---------
      
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      9a48cd70
    • Javyer's avatar
      review-bot: reverted #4271 and added `workflow_dispatch` (#4293) · d212fc7a
      Javyer authored
      This PR includes two changes:
      - added `workflow_dispatch` to review bot
      - reverted #4271
      
      ### Added `workflow_dispatch` to review bot
      This allows us, in the case that review-bot fails for some fork reasons,
      to trigger it manually ensuring that we can overcame the problem with
      the multiple actions while we look for a solution.
      
      <img width="342" alt="image"
      src="https://github.com/paritytech/polkadot-sdk/assets/8524599/f432f91b-829a-4da4-b4ca-54cc4fe280c8">
      
      ### Reverted #4271
      Unfortunately, the changes added in #4271 do not work in forks.
      
      Here is a lengthy discussion of many individuals facing the same problem
      as me:
      - [GitHub Action `pull_request` attribute empty in `workflow_run` event
      object for PR from forked repo
      #25220](https://github.com/orgs/community/discussions/25220)
      
      So I had to revert it (but I updated the dependencies to latest).
      
      #### Miscellaneous changes
      
      I added a debug log at the end of review bot in case it fails so we can
      easily debug it without having to make a lot of boilerplate and forks to
      duplicate the environment.
      d212fc7a
    • Svyatoslav Nikolsky's avatar
      Bump bridges relay version + uncomment bridges zombeinet tests (#4289) · c66d8a84
      Svyatoslav Nikolsky authored
      TODOs:
      - [x] wait and see if test `1` works;
      - [x] ~think of whether we need remaining tests.~ I think we should keep
      it - will try to revive and update it
      c66d8a84
    • Oliver Tale-Yazdi's avatar
      [balances] Safeguard against consumer ref underflow (#3865) · e8f7c81d
      Oliver Tale-Yazdi authored
      
      
      There are some accounts that do not have a consumer ref while having a
      reserve.
      This adds a fail-safe mechanism to trigger in the case that
      `does_consume` is true, but the assumption of `consumer>0` is not.
      
      This should prevent those accounts from loosing balance and the TI from
      getting messed up even more, but is not an "ideal" fix. TBH an ideal fix
      is not possible, since on-chain data is in an invalid state.
      
      ---------
      
      Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
      e8f7c81d
    • Noah Jelich's avatar
      Fix bad links (#4231) · 8f8c49de
      Noah Jelich authored
      The solochain template links to parachain template instead of solochain.
      8f8c49de
  2. Apr 25, 2024
  3. Apr 24, 2024
    • Francisco Aguirre's avatar
      Revert `execute_blob` and `send_blob` (#4266) · 4f3d43a0
      Francisco Aguirre authored
      Revert "pallet-xcm: Deprecate `execute` and `send` in favor of
      `execute_blob` and `send_blob` (#3749)"
      
      This reverts commit feee773d
      
      .
      
      ---------
      
      Co-authored-by: default avatarAdrian Catangiu <[email protected]>
      Co-authored-by: default avatarJavier Bullrich <[email protected]>
      4f3d43a0
    • Javyer's avatar
      Updated review-bot to obtain number from event (#4271) · d29c3636
      Javyer authored
      It seems that `review-trigger` is not uploading the artifact that is
      used by `review-bot`, so I changed the PR-Number to be obtained by the
      previous event that triggered this action.
      
      I also took the liberty to replace `tibdex/github-app-token` for
      `actions/create-github-app-token` which is GitHub's official app.
      d29c3636
    • Branislav Kontur's avatar
      `AllowHrmpNotificationsFromRelayChain` barrier for HRMP notifications from the relaychain (#4156) · ac473cfa
      Branislav Kontur authored
      This PR:
      - introduces `AllowHrmpNotificationsFromRelayChain` barrier for allowing
      HRMP notifications just from the relay chain (to fulfill safety
      assumptions -
      [see](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/src/v4/mod.rs#L532))
      - sets it up for all testnet SP parachains
      
      Continuation of: https://github.com/paritytech/polkadot-sdk/pull/3696
      ac473cfa
    • Serban Iorga's avatar
      [BEEFY] Return valid signatures when verifying commitment (#4259) · 8dc0b337
      Serban Iorga authored
      Trying to split parts of the
      https://github.com/paritytech/polkadot-sdk/pull/1903 into smaller PRs
      
      For https://github.com/paritytech/polkadot-sdk/pull/1903 it would help
      if `verify_with_validator_set()` returned the list of valid
      authority-signatures pairs, since after the verification we need to send
      them in the equivocation proof.
      8dc0b337
    • Alexander Kalankhodzhaev's avatar
      Remove unnecessary cloning (#4263) · c594b10a
      Alexander Kalankhodzhaev authored
      Seems like Externalities already [return a
      vector](https://github.com/paritytech/polkadot-sdk/blob/ffbce2a8
      
      /substrate/primitives/externalities/src/lib.rs#L86),
      so calling `to_vec` on a vector just results in an unneeded copying.
      
      Co-authored-by: default avatarLiam Aharon <[email protected]>
      c594b10a
    • Adrian Catangiu's avatar
      pallet-xcm::transfer_assets_using_type() supports custom actions on destination (#4260) · e0584a15
      Adrian Catangiu authored
      
      
      Change `transfer_assets_using_type()` to not assume `DepositAssets` as
      the intended use of the assets on the destination.
      
      Instead provides the caller with the ability to specify custom XCM that
      be executed on `dest` chain as the last step of the transfer, thus
      allowing custom usecases for the transferred assets. E.g. some are
      used/swapped/etc there, while some are sent further to yet another
      chain.
      
      Note: this is a follow-up on
      https://github.com/paritytech/polkadot-sdk/pull/3695, bringing in an API
      change for `transfer_assets_using_type()`. This is ok as the previous
      version has not been yet released. Thus, its first release will include
      the new API proposed by this PR.
      
      This allows usecases such as:
      https://forum.polkadot.network/t/managing-sas-on-multiple-reserve-chains-for-same-asset/7538/4
      
      BTW: all this pallet-xcm asset transfers code will be massively reduced
      once we have https://github.com/paritytech/xcm-format/pull/54
      
      ---------
      
      Signed-off-by: default avatarAdrian Catangiu <[email protected]>
      e0584a15
    • Alexandru Gheorghe's avatar
      Plumbing to increase pvf workers configuration based on chain id (#4252) · 9a0049d0
      Alexandru Gheorghe authored
      
      
      Part of https://github.com/paritytech/polkadot-sdk/issues/4126 we want
      to safely increase the execute_workers_max_num gradually from chain to
      chain and assess if there are any negative impacts.
      
      This PR performs the necessary plumbing to be able to increase it based
      on the chain id, it increase the number of execution workers from 2 to 4
      on test network but lives kusama and polkadot unchanged until we gather
      more data.
      
      ---------
      
      Signed-off-by: default avatarAlexandru Gheorghe <[email protected]>
      9a0049d0
    • gupnik's avatar
      Adds ability to trigger tasks via unsigned transactions (#4075) · 0a56d071
      gupnik authored
      
      
      This PR updates the `validate_unsigned` hook for `frame_system` to allow
      valid tasks to be submitted as unsigned transactions. It also updates
      the task example to be able to submit such transactions via an off-chain
      worker.
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      0a56d071
  4. Apr 23, 2024
  5. Apr 22, 2024