1. 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
    • Dmitry Markin's avatar
      Get rid of `Peerset` compatibility layer (#14337) · 8dc3bd72
      Dmitry Markin authored
      
      
      * Move bootnodes from individual `SetConfig`s to `PeersetConfig`
      
      * Move `SetId` & `SetConfig` from `peerset` to `protocol_controller`
      
      * Remove unused `DropReason`
      
      * Move `Message` & `IncomingIndex` from `peerset` to `protocol_controller`
      
      * Restore running fuzz test
      
      * Get rid of `Peerset` in `fuzz` test
      
      * Spawn runners instead of manual polling in `fuzz` test
      
      * Migrate `Protocol` from `Peerset` to `PeerStore` & `ProtocolController`
      
      * Migrate `NetworkService` from `Peerset` to `PeerStore` & `ProtocolController`
      
      * Migrate `Notifications` from `Peerset` to `ProtocolController`s
      
      * Migrate `Notifications` tests from `Peerset` to `ProtocolController`
      
      * Fix compilation of `NetworkService` & `Protocol`
      
      * Fix borrowing issues in `Notifications`
      
      * Migrate `RequestResponse`from `Peerset` to `PeerStore`
      
      * rustfmt
      
      * Migrate request-response tests from `Peerset` to `PeerStore`
      
      * Migrate `reconnect_after_disconnect` test to `PeerStore` & `ProtocolController`
      
      * Fix `Notifications` tests
      
      * Remove `Peerset` completely
      
      * Fix bug with counting sync peers in `Protocol`
      
      * Eliminate indirect calls to `PeerStore` via `Protocol`
      
      * Eliminate indirect calls to `ProtocolController` via `Protocol`
      
      * Handle `Err` outcome from `remove_peers_from_reserved_set`
      
      * Add note about disconnecting sync peers in `Protocol`
      
      * minor: remove unneeded `clone()`
      
      * minor: extra comma removed
      
      * minor: use `Stream` API of `from_protocol_controllers` channel
      
      * minor: remove TODO
      
      * minor: replace `.map().flatten()` with `.flat_map()`
      
      * minor: update `ProtocolController` docs
      
      * rustfmt
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAaro Altonen <[email protected]>
      
      * Extract `MockPeerStore` to `mock.rs`
      
      * Move `PeerStore` initialization to `build_network`
      
      * minor: remove unused import
      
      * minor: clarify error message
      
      * Convert `syncs_header_only_forks` test into single-threaded
      
      ---------
      
      Co-authored-by: default avatarAaro Altonen <[email protected]>
      8dc3bd72
  2. Jul 27, 2023
  3. Jul 25, 2023
    • Marijn Schouten's avatar
      change HashFor to HashingFor (#14483) · c9b54e10
      Marijn Schouten authored
      * change HashFor to HashingFor
      
      * fmt
      
      * ".git/.scripts/commands/fmt/fmt.sh"
      
      ---------
      
      Co-authored-by: command-bot <>
      c9b54e10
    • Anton's avatar
      chore: update libp2p to 0.52.1 (#14429) · 59d8b864
      Anton authored
      * update libp2p to 0.52.0
      
      * proto name now must implement `AsRef<str>`
      
      * update libp2p version everywhere
      
      * ToSwarm, FromBehaviour, ToBehaviour
      
      also LocalProtocolsChange and RemoteProtocolsChange
      
      * new NetworkBehaviour invariants
      
      * replace `Vec<u8>` with `StreamProtocol`
      
      * rename ConnectionHandlerEvent::Custom to NotifyBehaviour
      
      * remove DialError & ListenError invariants
      
      also fix pending_events
      
      * use connection_limits::Behaviour
      
      See https://github.com/libp2p/rust-libp2p/pull/3885
      
      * impl `void::Void` for `BehaviourOut`
      
      also use `Behaviour::with_codec`
      
      * KademliaHandler no longer public
      
      * fix StreamProtocol construction
      
      * update libp2p-identify to 0.2.0
      
      * remove non-existing methods from PollParameters
      
      rename ConnectionHandlerUpgrErr to StreamUpgradeError
      
      * `P2p` now contains `PeerId`, not `Multihash`
      
      * use multihash-codetable crate
      
      * update Cargo.lock
      
      * reformat text
      
      * comment out tests for now
      
      * remove `.into()` from P2p
      
      * confirm observed addr manually
      
      See https://github.com/libp2p/rust-libp2p/blob/master/protocols/identify/CHANGELOG.md#0430
      
      * remove SwarmEvent::Banned
      
      since we're not using `ban_peer_id`, this can be safely removed.
      we may want to introduce `libp2p::allow_block_list` module in the future.
      
      * fix imports
      
      * replace `libp2p` with smaller deps in network-gossip
      
      * bring back tests
      
      * finish rewriting tests
      
      * uncomment handler tests
      
      * Revert "uncomment handler tests"
      
      This reverts commit 720a06815887f4e10767c62b58864a7ec3a48e50.
      
      * add a fixme
      
      * update Cargo.lock
      
      * remove extra From
      
      * make void uninhabited
      
      * fix discovery test
      
      * use autonat protocols
      
      confirming external addresses manually is unsafe in open networks
      
      * fix SyncNotificationsClogged invariant
      
      * only set server mode manually in tests
      
      doubt that we need to set it on node since we're adding public addresses
      
      * address @dmitry-markin comments
      
      * remove autonat
      
      * removed unused var
      
      * fix EOL
      
      * update smallvec and sha2
      
      in attempt to compile polkadot
      
      * bump k256
      
      in attempt to build cumulus
      
      ---------
      
      Co-authored-by: parity-processbot <>
      59d8b864
  4. Jul 21, 2023
  5. Jul 17, 2023
  6. Jul 11, 2023
    • Bastian Köcher's avatar
      Removal of execution strategies (#14387) · 5eb816d7
      Bastian Köcher authored
      
      
      * Start
      
      * More work!
      
      * Moar
      
      * More changes
      
      * More fixes
      
      * More worrk
      
      * More fixes
      
      * More fixes to make it compile
      
      * Adds `NoOffchainStorage`
      
      * Pass the extensions
      
      * Small basti making small progress
      
      * Fix merge errors and remove `ExecutionContext`
      
      * Move registration of `ReadRuntimeVersionExt` to `ExecutionExtension`
      
      Instead of registering `ReadRuntimeVersionExt` in `sp-state-machine` it is moved to
      `ExecutionExtension` which provides the default extensions.
      
      * Fix compilation
      
      * Register the global extensions inside runtime api instance
      
      * Fixes
      
      * Fix `generate_initial_session_keys` by passing the keystore extension
      
      * Fix the grandpa tests
      
      * Fix more tests
      
      * Fix more tests
      
      * Don't set any heap pages if there isn't an override
      
      * Fix small fallout
      
      * FMT
      
      * Fix tests
      
      * More tests
      
      * Offchain worker custom extensions
      
      * More fixes
      
      * Make offchain tx pool creation reusable
      
      Introduces an `OffchainTransactionPoolFactory` for creating offchain transactions pools that can be
      registered in the runtime externalities context. This factory will be required for a later pr to
      make the creation of offchain transaction pools easier.
      
      * Fixes
      
      * Fixes
      
      * Set offchain transaction pool in BABE before using it in the runtime
      
      * Add the `offchain_tx_pool` to Grandpa as well
      
      * Fix the nodes
      
      * Print some error when using the old warnings
      
      * Fix merge issues
      
      * Fix compilation
      
      * Rename `babe_link`
      
      * Rename to `offchain_tx_pool_factory`
      
      * Cleanup
      
      * FMT
      
      * Fix benchmark name
      
      * Fix `try-runtime`
      
      * Remove `--execution` CLI args
      
      * Make clippy happy
      
      * Forward bls functions
      
      * Fix docs
      
      * Update UI tests
      
      * Update client/api/src/execution_extensions.rs
      
      Co-authored-by: default avatarMichal Kucharczyk <[email protected]>
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      * Update client/cli/src/params/import_params.rs
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      * Update client/api/src/execution_extensions.rs
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      * Pass the offchain storage to the MMR RPC
      
      * Update client/api/src/execution_extensions.rs
      
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      
      * Review comments
      
      * Fixes
      
      ---------
      
      Co-authored-by: default avatarMichal Kucharczyk <[email protected]>
      Co-authored-by: default avatarKoute <[email protected]>
      Co-authored-by: default avatarSebastian Kunert <[email protected]>
      5eb816d7
  7. Jul 06, 2023
  8. Jun 29, 2023
  9. Jun 27, 2023
  10. Jun 21, 2023
  11. Jun 16, 2023
  12. Jun 08, 2023
  13. May 31, 2023
  14. May 29, 2023
  15. 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
  16. May 24, 2023
  17. May 23, 2023
  18. May 12, 2023
    • Anton's avatar
      Upgrade to libp2p 0.51.3 (#13587) · e4b1aa18
      Anton authored
      * client/network: upgrade to libp2p 0.51.0
      
      * make discovery.rs compile
      
      * make peer_info.rs compile
      
      * changes to notifications and request-response proto
      
      * make service.rs compile
      
      * towards making request_responses.rs compile
      
      * make request_responses.rs compile
      
      * make request_responses.rs compile
      
      * fix notifications/behaviour.rs tests
      
      * fix warnings
      
      * remove old code
      
      * allow deprecated code (temporary)
      
      * upgrade to libp2p 0.51.1
      
      * add TODO for behaviour tests
      
      * return empty vec if peer_id is absent
      
      https://github.com/paritytech/substrate/pull/13587#discussion_r1141695167
      
      
      
      fyi: I don't really know what the old behaviour was.
      
      * update comment to reflect new defaults
      
      Closes #13338
      
      * Revert "update comment to reflect new defaults"
      
      This reverts commit 7a981abd69308e9d522ec94905f181439a1b1dba.
      
      * remove config.rs (from wrong merge)
      
      * upgrade to libp2p 0.51.2
      
      * fix formatting
      
      * use handle_pending_outbound_connection in networt_state RPC
      
      * update deps
      
      * use re-exports when we use other libp2p packages
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarDmitry Markin <[email protected]>
      
      * format code
      
      * handle potential errors in network_state RPC
      
      * only update libp2p crate
      
      * update libp2p-core
      
      * fix docs
      
      * use libp2p-identity instead of libp2p
      
      where it's possible. libp2p-identity is much smaller, hence makes sense
      to use it instead of larger libp2p crate.
      
      * Update client/network/src/discovery.rs
      
      Co-authored-by: default avatarAaro Altonen <[email protected]>
      
      * update Cargo.lock
      
      * add comment for per_connection_event_buffer_size
      
      current value is somewhat arbitrary and needs to be tweaked depending on
      memory usage and network worker sleep stats.
      
      * fix link format
      
      * update Cargo.lock
      
      * upgrade to libp2p 0.51.3
      
      * deprecate mplex
      
      * Revert "deprecate mplex"
      
      This reverts commit 9e25820e706e464a0e962a8604861fcb2a7641eb.
      
      * Revert "upgrade to libp2p 0.51.3"
      
      This reverts commit 6544dd4138e2f89517bd7c7281fc78a638ec7040.
      
      * use new libp2p version in `statement` crate
      
      * pin version temporarily
      
      * libp2p 0.51.3
      
      * deprecate mplex
      
      * deprecate legacy noise handshake
      
      * fix build error
      
      * update libp2p-identity
      
      * enable libp2p-identity:ed25519 feature in sc-consensus
      
      * enable ed25519 for peerset as well
      
      ---------
      
      Co-authored-by: default avatarDmitry Markin <[email protected]>
      Co-authored-by: default avatarAaro Altonen <[email protected]>
      Co-authored-by: parity-processbot <>
      e4b1aa18
  19. 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
  20. 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
    • Davide Galassi's avatar
      Refinements to VRF types (#14036) · 3a90728d
      Davide Galassi authored
      * Allow extra signing data
      
      * Fix tests after renaming
      
      * Rename VrfSecret/VrfVerifier to VrfSecret/VrfPublic
      
      * Further encrapsulation of 'transcript' type to the sr25519 implementation
      
      * Keystore sr25519 pre-output
      
      * Leave additional custom input field hidden in the associated VrfInput type
      
      * Fix test
      
      * More ergonomic output_bytes
      
      * Trigger pipeline
      
      * Define a separated type for vrf signature data
      
      * Fix docs
      
      * Fix doc
      
      * Remove annotation
      
      * Directly use dleq_proove and dleq_verify in sr25519
      
      * Trigger CI
      
      * Remove cruft before merge
      3a90728d
  21. May 02, 2023
  22. Apr 19, 2023
    • Davide Galassi's avatar
      VRF refactory (#13889) · bb394e08
      Davide Galassi authored
      
      
      * First iteration to encapsulate schnorrkel and merlin usage
      
      * Remove schnorkel direct dependency from BABE pallet
      
      * Remove schnorrkel direct dependency from BABE client
      
      * Trivial renaming for VrfTranscript data and value
      
      * Better errors
      
      * Expose a function to get a schnorrkel friendly transcript
      
      * Keep the vrf signature stuff together (preventing some clones around)
      
      * Fix tests
      
      * Remove vrf agnostic transcript and define it as an associated type for VrfSigner and VrfVerifier
      
      * Fix babe pallet mock
      
      * Inner types are required to be public for polkadot
      
      * Update client/consensus/babe/src/verification.rs
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      * Nit
      
      * Remove Deref implementations
      
      * make_bytes as a method
      
      * Trigger CI
      
      ---------
      
      Co-authored-by: default avatarKoute <[email protected]>
      bb394e08
  23. Apr 18, 2023
  24. Apr 12, 2023
  25. Apr 11, 2023
  26. Mar 31, 2023
  27. 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
  28. Mar 27, 2023
  29. Mar 24, 2023
    • Davide Galassi's avatar
      Keystore overhaul (final) (#13683) · 40e1704e
      Davide Galassi authored
      
      
      * Introduce keystore specialized sign methods
      
      * Get rid of 'AppKey::UntypedGeneric' associated type.
      
      Untyped generics are accessible using associated types 'Generic' associated type.
      I.e. <T as AppKey>::Public::Generic
      
      * Get rid of 'CryptoTypePublicPair'
      
      * Trivial fix
      
      * Small refactory of local keystore implementations
      
      * Remove 'crypto_id' method from 'Public'
      
      * Trivial rename of 'AppKey' to 'AppCrypto'
      
      * Remove unused import
      
      * Improve docs
      
      * Better signature related errors for authority-discovery
      
      * Apply review suggestion
      
      * Apply review suggestions
      
      Co-authored-by: default avatarKoute <[email protected]>
      
      * Authority discoverty signing error revisited
      
      * Signing error revisited for babe and aura as well
      
      * Further cleanup
      
      ---------
      
      Co-authored-by: default avatarKoute <[email protected]>
      40e1704e
  30. 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
  31. Mar 17, 2023
    • Davide Galassi's avatar
      Bump grandpa to 0.16.2 (#13622) · bc2724f0
      Davide Galassi authored
      bc2724f0
    • 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
  32. Mar 16, 2023
    • Adrian Catangiu's avatar
      sc-consensus-beefy: improve beefy gossip validator (#13606) · 3708b156
      Adrian Catangiu authored
      
      
      * sc-consensus-beefy: improve beefy gossip validator
      
      Old gossip validator was pretty dumb, being very permissive with
      incoming votes - only condition it had was to be newer than best
      finalized.
      
      New filter conditions:
       - voter rounds are initialized (discarding votes until voter is
         actually active),
       - only votes for current active set id are accepted,
       - only votes for rounds in the current voting session are accepted,
       - only votes for GRANDPA finalized blocks are accepted,
       - when BEEFY voter reaches mandatory round, only votes for said
         mandatory round are accepted.
      
      New validator uses the VoterOracle to easily implement above conditions
      and only allow through votes that are immediately useful to the voter.
      
      After every GRANDPA or BEEFY finality, the gossip validator filter is
      updated.
      
      * sc-consensus-beefy: remove votes enqueueing
      
      Since gossip validator will simply disallow votes for future rounds,
      and only allow votes that the voter can immediately process, there
      is no need for the voter to enqueue votes.
      
      It will see these "future" votes later in rebroadcasts, when voter
      will also be able to process them. Only at that point does gossip
      accept and consume them.
      
      * sc-consensus-beefy: refactor persistent state
      
      Move best-beefy and best-grandpa into VoterOracle instead
      of passing them around as params.
      VoterOracle ultimately needs to know best-beefy and/or best-grandpa
      for most of its functions.
      
      * sc-consensus-beefy: further restrict gossip validator
      
      Assuming mandatory done in current session:
      Instead of allowing votes for any round in the current session, only
      accept votes for rounds equal or better than best BEEFY finalized.
      
      * sc-consensus-beefy: add a couple of comments
      
      * sc-consensus-beefy: fix tests involving multiple tasks
      
      Finalize blocks one a time in tests where we want gossip to happen
      in a certain round. Otherwise, some tasks may be left behind in
      terms of gossip round numbers because once "scheduled" a task will
      greedily process as much as possible.
      
      This change should be in line with the real-world scenario where
      voters run "in parallel" across nodes, the only points of
      synchronization being the finality notifications.
      
      * sc-consensus-beefy: address review comments
      
      ---------
      
      Signed-off-by: default avataracatangiu <[email protected]>
      3708b156
  33. Mar 14, 2023