1. Feb 26, 2024
  2. Feb 24, 2024
    • tmpolaczyk's avatar
      Use generic hash for runtime wasm in resolve_state_version_from_wasm (#3447) · de6d0259
      tmpolaczyk authored
      
      
      Changes the runtime hash algorithm used in
      `resolve_state_version_from_wasm` from `DefaultHasher` to a
      caller-provided one (usually `HashingFor<Block>`), to match the one used
      elsewhere.
      
      This fixes an issue where the runtime wasm is compiled 3 times when
      starting the `tanssi-node` with `--dev`. With this fix, the runtime wasm
      is only compiled 2 times. The other redundant compilation is caused by
      the `GenesisConfigBuilderRuntimeCaller` struct, which ignores the
      runtime cache.
      
      ---------
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      de6d0259
  3. Feb 23, 2024
  4. Feb 22, 2024
  5. Feb 21, 2024
  6. Feb 20, 2024
  7. Feb 19, 2024
    • PG Herveou's avatar
      Contracts: xcm host fn fixes (#3086) · ca382f32
      PG Herveou authored
      ## Xcm changes:
      - Fix `pallet_xcm::execute`, move the logic into The `ExecuteController`
      so it can be shared with anything that implement that trait.
      - Make `ExecuteController::execute` retursn `DispatchErrorWithPostInfo`
      instead of `DispatchError`, so that we don't charge the full
      `max_weight` provided if the execution is incomplete (useful for
      force_batch or contracts calls)
      - Fix docstring for `pallet_xcm::execute`, to reflect the changes from
      #2405
      - Update the signature for `ExecuteController::execute`, we don't need
      to return the `Outcome` anymore since we only care about
      `Outcome::Complete`
      
      ## Contracts changes:
      
      - Update host fn `xcm_exexute`, we don't need to write the `Outcome` to
      the sandbox memory anymore. This was also not charged as well before so
      it if fixes this too.
      - One of the issue was that the dry_run of a contract that call
      `xcm_execute` would exhaust the `gas_limit`.
      
      This is because `XcmExecuteController::execute` takes a `max_weight`
      argument, and since we don't want the user to specify it manually we
      were passing everything left by pre-charghing
      `ctx.ext.gas_meter().gas_left()`
      
      - To fix it I added a `fn influence_lowest_limit` on the `Token` trait
      and make it return false for `RuntimeCost::XcmExecute`.
      - Got rid of the `RuntimeToken` indirection, we can just use
      `RuntimeCost` directly.
      
      ---------
      
      Co-authored-by: command-bot <>
      ca382f32
    • Anton Vilhelm Ásgeirsson's avatar
      Add Coretime to Westend (#3319) · 320863a8
      Anton Vilhelm Ásgeirsson authored
      Adds the coretime and on demand pallets to enable Coretime on Westend. 
      In order for the migration to run successfully, we need the
      Broker/Coretime parachain to be live.
      
      TODO:
      - [ ] Broker parachain is live
      https://github.com/paritytech/polkadot-sdk/pull/3272
      
      
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      320863a8
    • Matteo Muraca's avatar
      435e3392
    • Alexandru Gheorghe's avatar
      gossip-support: add unittests for update authorities (#3258) · 197c6cf9
      Alexandru Gheorghe authored
      
      
      ~The previous fix was actually incomplete because we update the
      authorties only on the situation where we decided to reconnect because
      we had a low connectivity issue. Now the problem is that
      update_authority_ids use the list of connected peers, so on restart that
      does contain anything, so calling immediately after
      issue_connection_request won't detect all authorities, so we need to
      also check every block as the comment said, but that did not match the
      code.~
      
      Actually the fix was correct the flow is follow if more than 1/3 of the
      authorities can not be resolved we set last_failure and call
      `ConnectToResolvedValidators`.
      
      We will call UpdateAuthorities for all the authorities already connected
      and for which we already know the address and for the ones that will
      connect later on `PeerConnected` will have the AuthorityId field set,
      because it is already known, so approval-distribution will update its
      cache topology.
      
      ---------
      
      Signed-off-by: default avatarAlexandru Gheorghe <[email protected]>
      Co-authored-by: default avatarAlexander Samusev <[email protected]>
      197c6cf9
    • Gilt0's avatar
      [FRAME Core] remove unnecessary overrides while using derive_impl for frame_system (#3317) · b78c72cf
      Gilt0 authored
      
      
      # Description
      
      This PR removes redundant type definition from test definition config
      implementations like
      ```
      #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
      impl frame_system::Config for Test {
          type A = A;
          ...
      }
      ```
      
      This changes avoid redundancies in the code as the macro `derive_impl`
      defines the relevant types. To implement the changes, it was a simple
      fact of running tests and making sure that the tests would still run
      while the definition would be removed.
      
      Closes #3237
      
      As a note, here is a brief account of things done from the Issue's
      description statement
      ```
      alliance migrate alliance, fast-unstake and bags list to use derive-impl #1636
      asset-conversion                                                                                            DONE
      asset-rate                                                                                                  DONE
      assets                                                                                                      DONE
      atomic-swap                                                                                                 DONE
      aura                                                                                                        DONE
      authority-discovery                                                                                         DONE                                                                     
      authorship  migrate babe and authorship to use derive-impl #1790
      babe  migrate babe and authorship to use derive-impl #1790
      bags-list migrate alliance, fast-unstake and bags list to use derive-impl #1636
      balances                                                                                                    DONE
      beefy                                                                                                       NOTHING TO DO --- also noted this error without failing tests Feb 13 13:49:08.941 ERROR runtime::timestamp: `pallet_timestamp::UnixTime::now` is called at genesis, invalid value returned: 0
      beefy-mmr                                                                                                   NOTHING TO DO
      bounties                                                                                                    DONE
      child-bounties                                                                                              DONE
      collective                                                                                                  DONE
      contracts                                                                                                   DONE
      conviction-voting                                                                                           DONE
      core-fellowship                                                                                             NOTHING TO DO
      democracy                                                                                                   DONE
      election-provider-multi-phase                                                                               NOTHING TO DO
      elections-phragmen                                                                                          DONE
      executive                                                                                                   NOTHING TO DO
      fast-unstake migrate alliance, fast-unstake and bags list to use derive-impl #1636
      glutton                                                                                                     DONE
      grandpa                                                                                                     DONE
      identity                                                                                                    DONE
      im-online                                                                                                   NOTHING TO DO
      indices Refactor indices pallet #1789
      insecure-randomness-collective-flip                                                                         DONE
      lottery                                                                                                     DONE
      membership                                                                                                  DONE
      merkle-mountain-range                                                                                       NOTHING TO DO
      message-queue                                                                                               DONE
      multisig add frame_system::DefaultConfig to individual pallet DefaultConfigs substrate#14453
      nft-fractionalization                                                                                       DONE
      nfts                                                                                                        DONE
      nicks Refactor pallet-state-trie-migration to fungible::* traits #1801                                      NOT IN REPO
      nis                                                                                                         DONE
      node-authorization                                                                                          DONE
      nomination-pools                                                                                            NOTHING TO DO -- ONLY impl for Runtime
      offences                                                                                                    DELETED EVERYTHING -- IS THAT CORRECT??
      preimage                                                                                                    DONE
      proxy add frame_system::DefaultConfig to individual pallet DefaultConfigs substrate#14453
      ranked-collective                                                                                           NOTHING TO DO
      recovery                                                                                                    DONE
      referenda                                                                                                   DONE
      remark                                                                                                      DONE
      root-offences                                                                                               DONE
      root-testing                                                                                                NOTHING TO DO
      salary                                                                                                      NOTHING TO DO
      scheduler                                                                                                   DONE
      scored-pool                                                                                                 DONE
      session                                                                                                     DONE -- substrate/frame/session/benchmarking/src/mock.rs untouched
      society                                                                                                     NOTHING TO DO
      staking                                                                                                     DONE
      staking-bags-benchmarks                                                                                     NOT IN REPO
      state-trie-migration                                                                                        NOTHING TO DO
      statement                                                                                                   DONE
      sudo                                                                                                        DONE
      system                                                                                                      DONE
      timestamp                                                                                                   DONE
      tips                                                                                                        DONE
      transaction-payment                                                                                         NOTHING TO DO
      transaction-storage                                                                                         NOTHING TO DO
      treasury                                                                                                    DONE
      try-runtime                                                                                                 NOTHING TO DO -- no specific mention of 'for Test'
      uniques                                                                                                     DONE
      utility                                                                                                     DONE
      vesting                                                                                                     DONE
      whitelist                                                                                                   DONE
      ```
      
      ---------
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatargupnik <[email protected]>
      b78c72cf