Support for multiple signature scheme for BEEFY primitves (#14373)
* 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:Davide Galassi <davxy@datawok.net> * - 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:
Davide Galassi <davxy@datawok.net> * Fix inconsistency in panic message in `primitives/io/src/lib.rs` Co-authored-by:
Davide Galassi <davxy@datawok.net> * Remove redundant feature activation in `primitives/io/Cargo.toml` Co-authored-by:
Davide Galassi <davxy@datawok.net> * - make `w3f-bls` a dev-dependancy only for beefy primitives. - clean up comments. Co-authored-by:
Davide Galassi <davxy@datawok.net> * 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:
Davide Galassi <davxy@datawok.net> * 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:
André Silva <123550+andresilva@users.noreply.github.com> * Fix Cargo.toml * Trigger CI with cumulus companion * Trigger CI after polkadot companion change --------- Co-authored-by:
Davide Galassi <davxy@datawok.net> Co-authored-by:
André Silva <123550+andresilva@users.noreply.github.com>
Showing
- substrate/Cargo.lock 1 addition, 2 deletionssubstrate/Cargo.lock
- substrate/client/consensus/beefy/src/communication/gossip.rs 5 additions, 4 deletionssubstrate/client/consensus/beefy/src/communication/gossip.rs
- substrate/client/consensus/beefy/src/communication/request_response/outgoing_requests_engine.rs 1 addition, 1 deletion...ommunication/request_response/outgoing_requests_engine.rs
- substrate/client/consensus/beefy/src/import.rs 3 additions, 3 deletionssubstrate/client/consensus/beefy/src/import.rs
- substrate/client/consensus/beefy/src/justification.rs 1 addition, 1 deletionsubstrate/client/consensus/beefy/src/justification.rs
- substrate/client/consensus/beefy/src/keystore.rs 45 additions, 26 deletionssubstrate/client/consensus/beefy/src/keystore.rs
- substrate/client/consensus/beefy/src/lib.rs 8 additions, 7 deletionssubstrate/client/consensus/beefy/src/lib.rs
- substrate/client/consensus/beefy/src/round.rs 1 addition, 1 deletionsubstrate/client/consensus/beefy/src/round.rs
- substrate/client/consensus/beefy/src/tests.rs 6 additions, 5 deletionssubstrate/client/consensus/beefy/src/tests.rs
- substrate/client/consensus/beefy/src/worker.rs 2 additions, 2 deletionssubstrate/client/consensus/beefy/src/worker.rs
- substrate/frame/beefy-mmr/src/lib.rs 7 additions, 6 deletionssubstrate/frame/beefy-mmr/src/lib.rs
- substrate/frame/beefy-mmr/src/mock.rs 1 addition, 1 deletionsubstrate/frame/beefy-mmr/src/mock.rs
- substrate/frame/beefy-mmr/src/tests.rs 6 additions, 6 deletionssubstrate/frame/beefy-mmr/src/tests.rs
- substrate/frame/beefy/src/equivocation.rs 3 additions, 3 deletionssubstrate/frame/beefy/src/equivocation.rs
- substrate/frame/beefy/src/mock.rs 1 addition, 1 deletionsubstrate/frame/beefy/src/mock.rs
- substrate/frame/beefy/src/tests.rs 9 additions, 16 deletionssubstrate/frame/beefy/src/tests.rs
- substrate/primitives/application-crypto/Cargo.toml 4 additions, 1 deletionsubstrate/primitives/application-crypto/Cargo.toml
- substrate/primitives/application-crypto/src/bls377.rs 28 additions, 0 deletionssubstrate/primitives/application-crypto/src/bls377.rs
- substrate/primitives/consensus/beefy/Cargo.toml 8 additions, 2 deletionssubstrate/primitives/consensus/beefy/Cargo.toml
- substrate/primitives/consensus/beefy/src/commitment.rs 90 additions, 22 deletionssubstrate/primitives/consensus/beefy/src/commitment.rs
Please register or sign in to comment