Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beefy client generic on aduthority Id #1816

Merged

Conversation

drskalman
Copy link
Contributor

Revived version of paritytech/substrate#13311 . Except Signature is not generic and is dictated by AuthorityId.

drskalman and others added 26 commits September 25, 2023 15:29
…ssfuly try to implement ByteArray for paired crypto Public
…me of aux traits for `paired_crypto::Signature`
…_crypto.rs`.

- put serialize and descerialze under `serde` feature instead of std.
- in `primitives/core/src/bls.rs`.
- fix documentation in `primitives/core/src/bls.rs`.
- cargo fmt pair_crypto.rs
Co-authored-by: Davide Galassi <[email protected]>
- Remove `SignaturePair` trait.
- Skip encoding redundant copy of paired::Public and Signature and implement Decode
…rypto type

- Implement ecdsa_bls37_crypto for BEEFY primitives.
@drskalman
Copy link
Contributor Author

drskalman commented Oct 8, 2023

@davxy It compiles now.

I was able to resolve the decode problem by using RuntimeAppPublic::Signature instead of AppCrypto::Signature, the former is bounded by Codec while the later is not.

Nonetheless I need to constrain associated type RuntimeAppPublic::Signature to Send and Sync and I still do not know how to do it at the definition of AuthorityIdBound so I had to constrain it all over the files whenever I needed to use AuthorityId.

serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
bkchr pushed a commit that referenced this pull request Apr 10, 2024
@drskalman drskalman requested review from serban300 and davxy May 29, 2024 07:32
Copy link
Member

@davxy davxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I just left one consideration about using AppCrypto vs RuntimeAppPublic

substrate/primitives/consensus/beefy/src/lib.rs Outdated Show resolved Hide resolved
/// BEEFY message with commitment and single signature.
Vote(VoteMessage<NumberFor<B>, AuthorityId, Signature>),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just drop this here, but applies all over the place.
Does <AuthorityId as AppCrypto>::Signature work? (in place of as RuntimeAppPublic.
I can't try it right now, but if yes then to me looks more appropriate using a trait that has not being designed for usage within the runtime

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had this conversation somewhere else before, I'm sorry my PR takes ages to merge :-/ AppCrypto::Signature somehow is not bounded by Codec (perhaps it should), RuntimeAppPublic::Signature has Codec and I assume you need to encode and send the Vote. I can check nonetheless.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep!:

error[E0599]: the variant or associated item `decode_all` exists for enum `GossipMessage<B, AuthorityId>`, but its trait bounds were not satisfied
   --> substrate/client/consensus/beefy/src/worker.rs:862:40
    |
862 |                         GossipMessage::<B, AuthorityId>::decode_all(&mut &notification.message[..])
    |                                                          ^^^^^^^^^^ variant or associated item cannot be called on `GossipMessage<B, AuthorityId>` due to unsatisfied trait bounds
    |
   ::: substrate/client/consensus/beefy/src/communication/gossip.rs:73:1
    |
73  | pub(crate) enum GossipMessage<B: Block, AuthorityId: AuthorityIdBound> {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I guess that we can merge this as soon as CI passes

@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6338844

@drskalman
Copy link
Contributor Author

drskalman commented May 29, 2024

@acatangiu @serban300 3 non-required tests are failing. Could you check if we are mergeable or not?

@serban300
Copy link
Contributor

@acatangiu @serban300 3 non-required tests are failing. Could you check if we are mergeable or not?

Only gitlab-zombienet-polkadot-functional-0003-beefy-and-mmr could be related to this PR. But it succeeded on re-run. So I think we can merge. But first I will re-run it again a couple of times just to make sure.

@serban300 serban300 added this pull request to the merge queue May 30, 2024
Merged via the queue into paritytech:master with commit bcab07a May 30, 2024
154 of 156 checks passed
@davxy davxy deleted the skalman--beefy-client-generic-on-auth-id branch May 30, 2024 11:06
ordian added a commit that referenced this pull request May 30, 2024
* master: (93 commits)
  Fix broken windows build (#4636)
  Beefy client generic on aduthority Id (#1816)
  pallet-staking: Put tests behind `cfg(debug_assertions)` (#4620)
  Broker new price adapter (#4521)
  Change `XcmDryRunApi::dry_run_extrinsic` to take a call instead (#4621)
  Update README.md (#4623)
  Publish `chain-spec-builder` (#4518)
  Add omni bencher & chain-spec-builder bins to release (#4557)
  Moves runtime macro out of experimental flag (#4249)
  Filter workspace dependencies in the templates (#4599)
  parachain-inherent: Make `para_id` more prominent (#4555)
  Add metric to measure the time it takes to gather enough assignments (#4587)
  Improve On_demand_assigner events (#4339)
  Conditional `required` checks (#4544)
  [CI] Deny adding git deps (#4572)
  [subsytem-bench] Remove redundant banchmark_name param (#4540)
  Add availability-recovery from systematic chunks (#1644)
  Remove workspace lints from templates (#4598)
  `sc-chain-spec`: deprecated code removed (#4410)
  [subsystem-benchmarks] Add statement-distribution benchmarks (#3863)
  ...
ordian added a commit that referenced this pull request Jun 4, 2024
* master: (106 commits)
  [ci] Delete unused flow (#4676)
  Fix umbrella CI check and fix the C&P message (#4670)
  Add Dockerfiles to the templates (#4637)
  Revamp the Readme of the minimal template (#4649)
  Add chain-spec-builder docker image (#4655)
  Update Amforc bootnodes for Kusama and Polkadot (#4668)
  make all storage items in parachain-system public (#4645)
  [Pools] Refactors and runtime apis for DelegateStake (#4537)
  update amforc westend and its parachain bootnodes (#4641)
  Better error for missing index in CRV2 (#4643)
  Implement `XcmPaymentApi` and `DryRunApi` on all system parachains (#4634)
  Use Unlicense for templates (#4628)
  collator-protocol: remove `elastic-scaling-experimental` feature (#4595)
  Update `runtime_type` ref doc with the new "Associated Type Bounds" (#4624)
  Adds ability to specify chain type in chain-spec-builder (#4542)
  Fix broken windows build (#4636)
  Beefy client generic on aduthority Id (#1816)
  pallet-staking: Put tests behind `cfg(debug_assertions)` (#4620)
  Broker new price adapter (#4521)
  Change `XcmDryRunApi::dry_run_extrinsic` to take a call instead (#4621)
  ...
hitchhooker pushed a commit to ibp-network/polkadot-sdk that referenced this pull request Jun 5, 2024
Revived version of paritytech/substrate#13311 .
Except Signature is not generic and is dictated by AuthorityId.

---------

Co-authored-by: Davide Galassi <[email protected]>
Co-authored-by: Robert Hambrock <[email protected]>
Co-authored-by: Adrian Catangiu <[email protected]>
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Aug 2, 2024
Revived version of paritytech/substrate#13311 .
Except Signature is not generic and is dictated by AuthorityId.

---------

Co-authored-by: Davide Galassi <[email protected]>
Co-authored-by: Robert Hambrock <[email protected]>
Co-authored-by: Adrian Catangiu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants