1. Apr 24, 2024
  2. Apr 08, 2024
    • Aaro Altonen's avatar
      Integrate litep2p into Polkadot SDK (#2944) · 80616f6d
      Aaro Altonen authored
      [litep2p](https://github.com/altonen/litep2p) is a libp2p-compatible P2P
      networking library. It supports all of the features of `rust-libp2p`
      that are currently being utilized by Polkadot SDK.
      
      Compared to `rust-libp2p`, `litep2p` has a quite different architecture
      which is why the new `litep2p` network backend is only able to use a
      little of the existing code in `sc-network`. The design has been mainly
      influenced by how we'd wish to structure our networking-related code in
      Polkadot SDK: independent higher-levels protocols directly communicating
      with the network over links that support bidirectional backpressure. A
      good example would be `NotificationHandle`/`RequestResponseHandle`
      abstractions which allow, e.g., `SyncingEngine` to directly communicate
      with peers to announce/request blocks.
      
      I've tried running `polkadot --network-backend litep2p` with a few
      different peer configurations and there is a noticeable reduction in
      networking CPU usage. For high load (`--out-peers 200`), networking CPU
      usage goes down from ~110% to ~30% (80 pp) and for normal load
      (`--out-peers 40`), the usage goes down from ~55% to ~18% (37 pp).
      
      These should not be taken as final numbers because:
      
      a) there are still some low-hanging optimization fruits, such as
      enabling [receive window
      auto-tuning](https://github.com/libp2p/rust-yamux/pull/176
      
      ), integrating
      `Peerset` more closely with `litep2p` or improving memory usage of the
      WebSocket transport
      b) fixing bugs/instabilities that incorrectly cause `litep2p` to do less
      work will increase the networking CPU usage
      c) verification in a more diverse set of tests/conditions is needed
      
      Nevertheless, these numbers should give an early estimate for CPU usage
      of the new networking backend.
      
      This PR consists of three separate changes:
      * introduce a generic `PeerId` (wrapper around `Multihash`) so that we
      don't have use `NetworkService::PeerId` in every part of the code that
      uses a `PeerId`
      * introduce `NetworkBackend` trait, implement it for the libp2p network
      stack and make Polkadot SDK generic over `NetworkBackend`
        * implement `NetworkBackend` for litep2p
      
      The new library should be considered experimental which is why
      `rust-libp2p` will remain as the default option for the time being. This
      PR currently depends on the master branch of `litep2p` but I'll cut a
      new release for the library once all review comments have been
      addresses.
      
      ---------
      
      Signed-off-by: default avatarAlexandru Vasile <[email protected]>
      Co-authored-by: default avatarDmitry Markin <[email protected]>
      Co-authored-by: default avatarAlexandru Vasile <[email protected]>
      Co-authored-by: default avatarAlexandru Vasile <[email protected]>
      80616f6d
    • Bastian Köcher's avatar
      sc-beefy-consensus: Remove unneeded stream. (#4015) · c1063a53
      Bastian Köcher authored
      The stream was just used to communicate from the validator the peer
      reports back to the gossip engine. Internally the gossip engine just
      forwards these reports to the networking engine. So, we can just do this
      directly.
      
      The reporting stream was also pumped [in the worker behind the
      engine](https://github.com/paritytech/polkadot-sdk/blob/9d6261892814fa27c97881c0321c008d7340b54b/substrate/client/consensus/beefy/src/worker.rs#L939).
      This means if there was a lot of data incoming over the engine, the
      reporting stream was almost never processed and thus, it could have
      started to grow and we have seen issues around this.
      
      Partly Closes: https://github.com/paritytech/polkadot-sdk/issues/3945
      c1063a53
  3. Apr 02, 2024
  4. Mar 26, 2024
    • Dcompoze's avatar
      Fix spelling mistakes across the whole repository (#3808) · 002d9260
      Dcompoze authored
      **Update:** Pushed additional changes based on the review comments.
      
      **This pull request fixes various spelling mistakes in this
      repository.**
      
      Most of the changes are contained in the first **3** commits:
      
      - `Fix spelling mistakes in comments and docs`
      
      - `Fix spelling mistakes in test names`
      
      - `Fix spelling mistakes in error messages, panic messages, logs and
      tracing`
      
      Other source code spelling mistakes are separated into individual
      commits for easier reviewing:
      
      - `Fix the spelling of 'authority'`
      
      - `Fix the spelling of 'REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY'`
      
      - `Fix the spelling of 'prev_enqueud_messages'`
      
      - `Fix the spelling of 'endpoint'`
      
      - `Fix the spelling of 'children'`
      
      - `Fix the spelling of 'PenpalSiblingSovereignAccount'`
      
      - `Fix the spelling of 'PenpalSudoAccount'`
      
      - `Fix the spelling of 'insufficient'`
      
      - `Fix the spelling of 'PalletXcmExtrinsicsBenchmark'`
      
      - `Fix the spelling of 'subtracted'`
      
      - `Fix the spelling of 'CandidatePendingAvailability'`
      
      - `Fix the spelling of 'exclusive'`
      
      - `Fix the spelling of 'until'`
      
      - `Fix the spelling of 'discriminator'`
      
      - `Fix the spelling of 'nonexistent'`
      
      - `Fix the spelling of 'subsystem'`
      
      - `Fix the spelling of 'indices'`
      
      - `Fix the spelling of 'committed'`
      
      - `Fix the spelling of 'topology'`
      
      - `Fix the spelling of 'response'`
      
      - `Fix the spelling of 'beneficiary'`
      
      - `Fix the spelling of 'formatted'`
      
      - `Fix the spelling of 'UNKNOWN_PROOF_REQUEST'`
      
      - `Fix the spelling of 'succeeded'`
      
      - `Fix the spelling of 'reopened'`
      
      - `Fix the spelling of 'proposer'`
      
      - `Fix the spelling of 'InstantiationNonce'`
      
      - `Fix the spelling of 'depositor'`
      
      - `Fix the spelling of 'expiration'`
      
      - `Fix the spelling of 'phantom'`
      
      - `Fix the spelling of 'AggregatedKeyValue'`
      
      - `Fix the spelling of 'randomness'`
      
      - `Fix the spelling of 'defendant'`
      
      - `Fix the spelling of 'AquaticMammal'`
      
      - `Fix the spelling of 'transactions'`
      
      - `Fix the spelling of 'PassingTracingSubscriber'`
      
      - `Fix the spelling of 'TxSignaturePayload'`
      
      - `Fix the spelling of 'versioning'`
      
      - `Fix the spelling of 'descendant'`
      
      - `Fix the spelling of 'overridden'`
      
      - `Fix the spelling of 'network'`
      
      Let me know if this structure is adequate.
      
      **Note:** The usage of the words `Merkle`, `Merkelize`, `Merklization`,
      `Merkelization`, `Merkleization`, is somewhat inconsistent but I left it
      as it is.
      
      ~~**Note:** In some places the term `Receival` is used to refer to
      message reception, IMO `Reception` is the correct word here, but I left
      it as it is.~~
      
      ~~**Note:** In some places the term `Overlayed` is used instead of the
      more acceptable version `Overlaid` but I also left it as it is.~~
      
      ~~**Note:** In some places the term `Applyable` is used instead of the
      correct version `Applicable` but I also left it as it is.~~
      
      **Note:** Some usage of British vs American english e.g. `judgement` vs
      `judgment`, `initialise` vs `initialize`, `optimise` vs `optimize` etc.
      are both present in different places, but I suppose that's
      understandable given the number of contributors.
      
      ~~**Note:** There is a spelling mistake in `.github/CODEOWNERS` but it
      triggers errors in CI when I make changes to it, so I left it as it
      is.~~
      002d9260
  5. Feb 22, 2024
    • Adrian Catangiu's avatar
      sc-consensus-beefy: pump gossip engine while waiting for initialization conditions (#3435) · 31546c8d
      Adrian Catangiu authored
      As part of BEEFY worker/voter initialization the task waits for certain
      chain and backend conditions to be fulfilled:
      - BEEFY consensus enabled on-chain & GRANDPA best finalized higher than
      on-chain BEEFY genesis block,
      - backend has synced headers for BEEFY mandatory blocks between best
      BEEFY and best GRANDPA.
      
      During this waiting time, any messages gossiped on the BEEFY topic for
      current chain get enqueued in the gossip engine, leading to RAM bloating
      and output warning/error messages when the wait time is non-negligible
      (like during a clean sync).
      
      This PR adds logic to pump the gossip engine while waiting for other
      things to make sure gossiped messages get consumed (practically
      discarded until worker is fully initialized).
      
      Also raises the warning threshold for enqueued messages from 10k to
      100k. This is in line with the other gossip protocols on the node.
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/3390
      
      
      
      ---------
      
      Signed-off-by: default avatarAdrian Catangiu <[email protected]>
      31546c8d
  6. Feb 21, 2024
  7. Feb 08, 2024
  8. Feb 01, 2024
  9. Jan 22, 2024
  10. Jan 10, 2024
    • Alin Dima's avatar
      add fallback request for req-response protocols (#2771) · f2a750ee
      Alin Dima authored
      Previously, it was only possible to retry the same request on a
      different protocol name that had the exact same binary payloads.
      
      Introduce a way of trying a different request on a different protocol if
      the first one fails with Unsupported protocol.
      
      This helps with adding new req-response versions in polkadot while
      preserving compatibility with unupgraded nodes.
      
      The way req-response protocols were bumped previously was that they were
      bundled with some other notifications protocol upgrade, like for async
      backing (but that is more complicated, especially if the feature does
      not require any changes to a notifications protocol). Will be needed for
      implementing https://github.com/polkadot-fellows/RFCs/pull/47
      
      TODO:
      - [x]  add tests
      - [x] add guidance docs in polkadot about req-response protocol
      versioning
      f2a750ee
  11. Jan 08, 2024
  12. Dec 27, 2023
  13. Dec 18, 2023
  14. Dec 15, 2023
  15. Dec 14, 2023
  16. Nov 28, 2023
    • Aaro Altonen's avatar
      Rework the event system of `sc-network` (#1370) · e71c484d
      Aaro Altonen authored
      This commit introduces a new concept called `NotificationService` which
      allows Polkadot protocols to communicate with the underlying
      notification protocol implementation directly, without routing events
      through `NetworkWorker`. This implies that each protocol has its own
      service which it uses to communicate with remote peers and that each
      `NotificationService` is unique with respect to the underlying
      notification protocol, meaning `NotificationService` for the transaction
      protocol can only be used to send and receive transaction-related
      notifications.
      
      The `NotificationService` concept introduces two additional benefits:
        * allow protocols to start using custom handshakes
        * allow protocols to accept/reject inbound peers
      
      Previously the validation of inbound connections was solely the
      responsibility of `ProtocolController`. This caused issues with light
      peers and `SyncingEngine` as `ProtocolController` would accept more
      peers than `SyncingEngine` could accept which caused peers to have
      differing views of their own states. `SyncingEngine` would reject excess
      peers but these rejections were not properly communicated to those peers
      causing them to assume that they were accepted.
      
      With `NotificationService`, the local handshake is not sent to remote
      peer if peer is rejected which allows it to detect that it was rejected.
      
      This commit also deprecates the use of `NetworkEventStream` for all
      notification-related events and going forward only DHT events are
      provided through `NetworkEventStream`. If protocols wish to follow each
      other's events, they must introduce additional abtractions, as is done
      for GRANDPA and transactions protocols by following the syncing protocol
      through `SyncEventStream`.
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/512
      Fixes https://github.com/paritytech/polkadot-sdk/issues/514
      Fixes https://github.com/paritytech/polkadot-sdk/issues/515
      Fixes https://github.com/paritytech/polkadot-sdk/issues/554
      Fixes https://github.com/paritytech/polkadot-sdk/issues/556
      
      ---
      These changes are transferred from
      https://github.com/paritytech/substrate/pull/14197
      
       but there are no
      functional changes compared to that PR
      
      ---------
      
      Co-authored-by: default avatarDmitry Markin <[email protected]>
      Co-authored-by: default avatarAlexandru Vasile <[email protected]>
      e71c484d
  17. Nov 23, 2023
  18. Nov 17, 2023
    • Serban Iorga's avatar
      Beefy: small fixes (#2378) · 3ab2bc9f
      Serban Iorga authored
      Related to #2285
      
      - save the state of the BEEFY gadget after processing a finality proof.
      We need this in order to avoid skipping blocks.
      - avoid reprocessing the old state when not necessary
      3ab2bc9f
  19. Nov 03, 2023
    • Bastian Köcher's avatar
      `sc-block-builder`: Remove `BlockBuilderProvider` (#2099) · ca5f1056
      Bastian Köcher authored
      The `BlockBuilderProvider` was a trait that was defined in
      `sc-block-builder`. The trait was implemented for `Client`. This
      basically meant that you needed to import `sc-block-builder` any way to
      have access to the block builder. So, this trait was not providing any
      real value. This pull request is removing the said trait. Instead of the
      trait it introduces a builder for creating a `BlockBuilder`. The builder
      currently has the quite fabulous name `BlockBuilderBuilder` (I'm open to
      any better name 😅
      
      ). The rest of the pull request is about
      replacing the old trait with the new builder.
      
      # Downstream code changes
      
      If you used `new_block` or `new_block_at` before you now need to switch
      it over to the new `BlockBuilderBuilder` pattern:
      
      ```rust
      // `new` requires a type that implements `CallApiAt`. 
      let mut block_builder = BlockBuilderBuilder::new(client)
                      // Then you need to specify the hash of the parent block the block will be build on top of
      		.on_parent_block(at)
                      // The block builder also needs the block number of the parent block. 
                      // Here it is fetched from the given `client` using the `HeaderBackend`
                      // However, there also exists `with_parent_block_number` for directly passing the number
      		.fetch_parent_block_number(client)
      		.unwrap()
                      // Enable proof recording if required. This call is optional.
      		.enable_proof_recording()
                      // Pass the digests. This call is optional.
                      .with_inherent_digests(digests)
      		.build()
      		.expect("Creates new block builder");
      ```
      
      ---------
      
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      Co-authored-by: command-bot <>
      ca5f1056
  20. Oct 16, 2023
    • Adrian Catangiu's avatar
      sc-consensus-beefy: fix initialization when state is unavailable (#1888) · 646ecd0e
      Adrian Catangiu authored
      Fix situation where BEEFY initial validator set could not be determined.
      
      If state is unavailable at BEEFY genesis block to get initial validator
      set, get the info from header digests. For this, we need to walk back
      the chain starting from BEEFY genesis looking for the BEEFY digest
      announcing the active validator set for that respective session.
      
      This commit fixes a silly bug where walking back the chain was stopped
      when reaching BEEFY genesis block, which is incorrect when BEEFY genesis
      is not session boundary block. When BEEFY genesis is set to some random
      block within a session, we need to walk back to the start of the session
      to see the validator set announcement.
      
      Added regression test for this fix.
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/1885
      
      
      
      Signed-off-by: default avatarAdrian Catangiu <[email protected]>
      646ecd0e
  21. Oct 13, 2023
    • Adrian Catangiu's avatar
      sc-consensus-beefy: improve gossip logic (#1852) · 83206000
      Adrian Catangiu authored
      - Remove cached messages used for deduplication in `GossipValidator`
      since they're already deduplicated in upper layer `NetworkGossip`.
      - Add cache for "justified rounds" to quickly discard any further (even
      if potentially different) justifications at the gossip level, once a
      valid one (for a respective round) is submitted to the worker.
      - Add short-circuit in worker `finalize()` method to not attempt to
      finalize same block multiple times (for example when we get
      justifications for same block from multiple components like
      block-import, gossip or on-demand).
      - Change a test which had A LOT of latency in syncing blocks for some
      weird reason and would only run after ~150seconds. It now runs
      instantly.
      
      Fixes https://github.com/paritytech/polkadot-sdk/issues/1728
      83206000
  22. Aug 30, 2023
  23. Aug 29, 2023
  24. Aug 25, 2023
  25. Aug 17, 2023
  26. Aug 11, 2023
    • Adrian Catangiu's avatar
      sc-consensus-beefy: fix initialization when BEEFY genesis state unavailable (#14752) · 570b2214
      Adrian Catangiu authored
      
      
      When BEEFY voter is initialized from scratch (no aux db persistent data present),
      it needs to find BEEFY genesis block and all subsequent Mandatory blocks and
      sync justifications for them.
      
      The initialization code was getting active validator sets for these older blocks
      from state, but in cases such as 'fast sync', state is unavailable.
      
      This commit adds a fallback initialization mechanism when state is unavailable:
      parse header Digests looking for validator set change log deposits.
      
      Signed-off-by: default avatarAdrian Catangiu <[email protected]>
      570b2214
  27. Aug 02, 2023
    • drskalman's avatar
      Support for multiple signature scheme for BEEFY primitves (#14373) · 3fef703e
      drskalman authored
      
      
      * Merged BEEFY primitives with generic signature and keyset commitment support from old pull to current code
      
      * - Add bls-experimental feature to application-crypto and beefy primitives
      - Fix remaining crypto -> ecdsa_crypto
      - code build but not tests
      
      * Make beefy primitive tests compile
      
      * move bls related beefy primitives code and test behind bls-experimental flag
      
      * Make BEEFY clients complies with BEEFY API depending on AuthorityId
      
      * - Rename `BeefyAuthoritySet.root` → `BeefyAuthoritySet.keyset_commitment`.
      - Remove apk proof keyset_commitment from `BeefyAuthoritySet`.
      - Fix failing signed commitment and signature to witness test.
      - Make client compatible with BeefyAPI generic on AuthorityId.
      - `crypto` → `ecdsa_crypto` in BEEFY client and frame.
      
      * Commit Cargo lock remove ark-serialize from BEEFY primitives
      
      * Use Codec instead of Encode + Decode in primitives/consensus/beefy/src/lib.rs
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * - Make `BeefyApi` generic over Signature type.
      - Make new `BeeyApi` functinos also generic over AuthorityId and Signature
      
      * Unmake BeefyAPI generic over Signature. Recover Signature type from AuthId.
      
      * - dont use hex or hex-literal use array-bytes instead in beefy primitives and bls crypto.
      - CamelCase ECDSA and BLS everywhere.
      
      * Move the definition of BEEFY key type from `primitives/beefy` to `crypto.rs` according to new convention.
      
      * - Add bls377_generate_new to `sp-io` and `application_crypto::bls`.
      - Add `bls-experimental` to `sp-io`
      
      Does not compile because PassByCodec can not derive PassBy using customly implemented PassByIner.
      
      * Implement PassBy for `bls::Public` manually
      
      * fix Beefy `KEY_TYPE` in `frame/beefy` tests to come from `sp-core::key_types` enum
      
      * specify both generic for `hex2array_unchecked` in `sp-core/bls.rs`
      
      * Rename `crypto`→`ecdsa_crypto` in `primitives/consensus/beefy/src/test_utils.rs` docs
      
      * remove commented-out code in `primitives/consensus/beefy/src/commitment.rs`
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * Fix inconsistency in panic message in  `primitives/io/src/lib.rs`
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * Remove redundant feature activation in `primitives/io/Cargo.toml`
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * - make `w3f-bls` a dev-dependancy only for beefy primitives.
      
      - clean up comments.
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * export BEEFY KEY_TYPE from primitives/consensus/beefy
      make `frame/consensus/beefy` in dependent of sp_crypto_app
      use consistent naming in the beefy primitive tests.
      
      * - implement `BeefyAuthorityId` for `bls_crypto::AuthorityId`.
      - implement `bls_verify_works` test for BEEFY `bls_crypto`.
      
      * Remove BEEFY `ecdsa_n_bls_crypto` for now for later re-introduction
      
      * Make commitment and witness BEEFY tests not use Keystore.
      
      * put `bls_beefy_verify_works` test under `bls-experimental` flag.
      
      * bump up Runtime `BeefyAPI` to version 3 due to introducing generic AuthorityId.
      
      * reuse code and encapsulate w3f-bls backend in sp-core as most as possible
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * Make comments in primities BEEFY `commitment.rs` and `witness.rs``tests convention conforming
      
      * Use master dep versions
      
      * Trivial change. Mostly to trigger CI
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAndré Silva <[email protected]>
      
      * Fix Cargo.toml
      
      * Trigger CI with cumulus companion
      
      * Trigger CI after polkadot companion change
      
      ---------
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: default avatarAndré Silva <[email protected]>
      3fef703e
  28. Jul 21, 2023
  29. Jul 06, 2023
  30. Jun 29, 2023
  31. Jun 16, 2023
  32. May 25, 2023
    • Adrian Catangiu's avatar
      sc-consensus-beefy: graceful support for pallet-beefy reset (#14217) · b907f520
      Adrian Catangiu authored
      
      
      BEEFY consensus can be restarted by resetting "genesisBlock" in
      pallet-beefy, but we don't want to also reset authority set IDs so
      that they are uniquely identified across the entire chain history
      regardless of how many times BEEFY consensus has been reset/restarted.
      
      This is why the client now also accepts initial authority_set_id != 0.
      
      BEEFY client now detects pallet-beefy reset/reinit and errors-out and
      asks for a restart.
      BEEFY client persisted state should be discarded on client restarts
      following pallet-beefy reset/reinit.
      
      End result is BEEFY client/voter can now completely reinitialize using
      "new" on-chain info following pallet-beefy reset/reinit, discarding old state.
      
      Fixes #14203
      Fixes #14204
      
      Signed-off-by: default avataracatangiu <[email protected]>
      b907f520
  33. May 24, 2023
  34. May 11, 2023
    • Aaro Altonen's avatar
      Prepare `sc-network` for `ProtocolController`/`NotificationService` (#14080) · f36749b9
      Aaro Altonen authored
      
      
      * Prepare `sc-network` for `ProtocolController`/`NotificationService`
      
      The upcoming notification protocol refactoring requires that protocols
      are able to communicate with `sc-network` over unique and direct links.
      This means that `sc-network` side of the link has to be created before
      `sc-network` is initialized and that it is allowed to consume the object
      as the receiver half of the link may not implement `Clone`.
      
      Remove request-response and notification protocols from `NetworkConfiguration`
      and create a new object that contains the configurations of these protocols
      and which is consumable by `sc-network`. This is needed needed because, e.g.,
      the receiver half of `NotificationService` is not clonable so `sc-network`
      must consume it when it's initializing the protocols in `Notifications`.
      
      Similar principe applies to `PeerStore`/`ProtocolController`: as per current
      design, protocols are created before the network so `Protocol` cannot be
      the one creating the `PeerStore` object. `FullNetworkConfiguration` will be
      used to store the objects that `sc-network` will use to communicate with
      protocols and it will also allow protocols to allocate handles so they
      can directly communicate with `sc-network`.
      
      * Fixes
      
      * Update client/service/src/builder.rs
      
      Co-authored-by: default avatarDmitry Markin <[email protected]>
      
      * Updates
      
      * Doc updates + cargo-fmt
      
      ---------
      
      Co-authored-by: default avatarDmitry Markin <[email protected]>
      f36749b9
  35. May 04, 2023
    • Michal Kucharczyk's avatar
      substrate-test-runtime migrated to "pure" frame runtime (#13737) · 6a295e7c
      Michal Kucharczyk authored
      * substrate-test-runtime migrated to pure-frame based
      
      * test block builder: helpers added
      
      * simple renaming
      
      * basic_authorship test adjusted
      
      * block_building storage_proof test adjusted
      
      * babe: tests: should_panic expected added
      
      * babe: tests adjusted
      
      ConsensusLog::NextEpochData is now added by pallet_babe as
      pallet_babe::SameAuthoritiesForever trigger is used in runtime config.
      
      * beefy: tests adjusted
      
      test-substrate-runtime is now using frame::executive to finalize the
      block. during finalization the digests stored during block execution are
      checked against header digests:
      https://github.com/paritytech/substrate/blob/91bb2d29ca905599098a5b35eaf24867c4fbd60a/frame/executive/src/lib.rs#L585-L591
      
      It makes impossible to directly manipulate header's digets, w/o
      depositing logs into system pallet storage `Digest<T: Config>`.
      
      Instead of this dedicated extrinsic allowing to store logs items
      (MmrRoot / AuthoritiesChange) is used.
      
      * grandpa: tests adjusted
      
      test-substrate-runtime is now using frame::executive to finalize the
      block. during finalization the digest logs stored during block execution are
      checked against header digest logs:
      https://github.com/paritytech/substrate/blob/91bb2d29ca905599098a5b35eaf24867c4fbd60a/frame/executive/src/lib.rs#L585-L591
      
      
      
      It makes impossible to directly manipulate header's digets, w/o
      depositing logs into system pallet storage `Digest<T: Config>`.
      
      Instead of this dedicated extrinsic allowing to store logs items
      (ScheduledChange / ForcedChange and DigestItem::Other) is used.
      
      * network:bitswap: test adjusted
      
      The size of unchecked extrinsic was increased. The pattern used in test will
      be placed at the end of scale-encoded buffer.
      
      * runtime apis versions adjusted
      
      * storage keys used in runtime adjusted
      
      * wasm vs native tests removed
      
      * rpc tests: adjusted
      
      Transfer transaction processing was slightly improved, test was
      adjusted.
      
      * tests: sizes adjusted
      
      Runtime extrinsic size was increased. Size of data read during block
      execution was also increased due to usage of new pallets in runtime.
      
      Sizes were adjusted in tests.
      
      * cargo.lock update
      
      cargo update -p substrate-test-runtime -p substrate-test-runtime-client
      
      * warnings fixed
      
      * builders cleanup: includes / std
      
      * extrinsic validation cleanup
      
      * txpool: benches performance fixed
      
      * fmt
      
      * spelling
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * Apply code review suggestions
      
      * Apply code review suggestions
      
      * get rid of 1063 const
      
      * renaming: UncheckedExtrinsic -> Extrinsic
      
      * test-utils-runtime: further step to pure-frame
      
      * basic-authorship: tests OK
      
      * CheckSubstrateCall added + tests fixes
      
      * test::Transfer call removed
      
      * priority / propagate / no sudo+root-testing
      
      * fixing warnings + format
      
      * cleanup: build2/nonce + format
      
      * final tests fixes
      
      all tests are passing
      
      * logs/comments removal
      
      * should_not_accept_old_signatures test removed
      
      * make txpool benches work again
      
      * Cargo.lock reset
      
      * format
      
      * sudo hack removed
      
      * txpool benches fix+cleanup
      
      * .gitignore reverted
      
      * rebase fixing + unsigned cleanup
      
      * Cargo.toml/Cargo.lock cleanup
      
      * force-debug feature removed
      
      * mmr tests fixed
      
      * make cargo-clippy happy
      
      * network sync test uses unsigned extrinsic
      
      * cleanup
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      * push_storage_change signed call remove
      
      * GenesisConfig cleanup
      
      * fix
      
      * fix
      
      * GenesisConfig simplified
      
      * storage_keys_works: reworked
      
      * storage_keys_works: expected keys in vec
      
      * storage keys list moved to substrate-test-runtime
      
      * substrate-test: some sanity tests + GenesisConfigBuilder rework
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Apply suggestions from code review
      
      * Review suggestions
      
      * fix
      
      * fix
      
      * beefy: generate_blocks_and_sync block_num sync with actaul value
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * Update test-utils/runtime/src/genesismap.rs
      
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      
      * cargo update -p sc-rpc -p sc-transaction-pool
      
      * Review suggestions
      
      * fix
      
      * doc added
      
      * slot_duration adjusted for Babe::slot_duration
      
      * small doc fixes
      
      * array_bytes::hex used instead of hex
      
      * tiny -> medium name fix
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      
      * TransferData::try_from_unchecked_extrinsic -> try_from
      
      * Update Cargo.lock
      
      ---------
      
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarDavide Galassi <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      6a295e7c
  36. Apr 12, 2023
  37. Mar 30, 2023
    • Adrian Catangiu's avatar
      BEEFY: gossip finality proofs (#13727) · 92c1229e
      Adrian Catangiu authored
      * sc-consensus-beefy: add justifications to gossip protocol
      
      * sc-consensus-beefy: voter gossips finality proofs
      
      * sc-consensus-beefy: add finality proof gossip test
      
      * sc-consensus-beefy: always gossip finality proof
      
      Gossip finality proof in _both_ cases of reaching finality threshold
      through votes:
      1. threshold reached through self vote,
      2. threshold reached through incoming vote.
      
      * address comments
      92c1229e
  38. Mar 20, 2023
    • Davide Galassi's avatar
      Keystore overhaul (iter 2) (#13634) · 480396fe
      Davide Galassi authored
      * Remove bloat about remote keystore
      
      * Update docs and remove unused 'KeystoreRef' trait
      
      * Use wherever possible, MemoryKeystore for testing
      
      * Remove unrequired fully qualified method syntax for Keystore
      480396fe
  39. Mar 17, 2023
    • Davide Galassi's avatar
      Keystore overhaul (#13615) · f110941b
      Davide Galassi authored
      * Remove 'supported_keys' 'sign_with_any' and 'sign_with_all' from keystore trait
      
      * Remove the aync keystore
      
      * Renaming:
      - SyncCryptoStore -> Keystore
      - SyncCryptoStorePtr -> KeystorePtr
      - KeyStore -> MemoryKeystore
      
      * Fix authority discovery worker and tests
      
      * Rename 'insert_unknown' to 'insert'
      
      * Remove leftover
      f110941b