update Substrate/Polkadot/Cumulus deps to master (#1775)

This commit is contained in:
Svyatoslav Nikolsky
2023-01-17 14:40:18 +03:00
committed by Bastian Köcher
parent c36ba5a562
commit 8494162d2a
4 changed files with 12 additions and 17 deletions
-1
View File
@@ -138,7 +138,6 @@ impl ChainWithBeefy for TestBridgedChain {
type MmrHash = <Keccak256 as Hash>::Output;
type BeefyMmrLeafExtra = ();
type AuthorityId = BeefyId;
type Signature = sp_beefy::crypto::AuthoritySignature;
type AuthorityIdToMerkleLeaf = pallet_beefy_mmr::BeefyEcdsaToEthereum;
}
+4 -4
View File
@@ -1,9 +1,9 @@
use crate::{
BridgedBeefyAuthorityId, BridgedBeefyAuthoritySet, BridgedBeefyAuthoritySetInfo,
BridgedBeefyCommitmentHasher, BridgedBeefyMmrLeaf, BridgedBeefySignedCommitment, BridgedChain,
BridgedMmrHash, BridgedMmrHashing, BridgedMmrProof, Config, Error, LOG_TARGET,
BridgedBeefyMmrLeaf, BridgedBeefySignedCommitment, BridgedChain, BridgedMmrHash,
BridgedMmrHashing, BridgedMmrProof, Config, Error, LOG_TARGET,
};
use bp_beefy::{merkle_root, verify_mmr_leaves_proof, BeefyVerify, MmrDataOrHash};
use bp_beefy::{merkle_root, verify_mmr_leaves_proof, BeefyAuthorityId, MmrDataOrHash};
use codec::Encode;
use frame_support::ensure;
use sp_runtime::traits::{Convert, Hash};
@@ -72,7 +72,7 @@ fn verify_signatures<T: Config<I>, I: 'static>(
authority_set.validators().iter().zip(commitment.signatures.iter()).enumerate()
{
if let Some(sig) = maybe_sig {
if BeefyVerify::<BridgedBeefyCommitmentHasher<T, I>>::verify(sig, &msg, authority) {
if authority.verify(sig, &msg) {
missing_signatures = missing_signatures.saturating_sub(1);
if missing_signatures == 0 {
break
+8 -11
View File
@@ -29,8 +29,8 @@ pub use sp_beefy::{
crypto::{AuthorityId as EcdsaValidatorId, AuthoritySignature as EcdsaValidatorSignature},
known_payloads::MMR_ROOT_ID as MMR_ROOT_PAYLOAD_ID,
mmr::{BeefyAuthoritySet, MmrLeafVersion},
BeefyAuthorityId, BeefyVerify, Commitment, Payload as BeefyPayload, SignedCommitment,
ValidatorSet, ValidatorSetId, BEEFY_ENGINE_ID,
BeefyAuthorityId, Commitment, Payload as BeefyPayload, SignedCommitment, ValidatorSet,
ValidatorSetId, BEEFY_ENGINE_ID,
};
use bp_runtime::{BasicOperatingMode, BlockNumberOf, Chain, HashOf};
@@ -39,7 +39,7 @@ use frame_support::Parameter;
use scale_info::TypeInfo;
use sp_runtime::{
traits::{Convert, MaybeSerializeDeserialize},
RuntimeDebug,
RuntimeAppPublic, RuntimeDebug,
};
use sp_std::prelude::*;
@@ -72,7 +72,8 @@ pub trait ChainWithBeefy: Chain {
+ Copy
+ AsRef<[u8]>
+ Default
+ MaybeSerializeDeserialize;
+ MaybeSerializeDeserialize
+ PartialOrd;
/// The type expected for the MMR leaf extra data.
type BeefyMmrLeafExtra: Parameter;
@@ -80,12 +81,7 @@ pub trait ChainWithBeefy: Chain {
/// A way to identify a BEEFY validator.
///
/// Corresponds to the `BeefyId` field of the `pallet-beefy` configuration.
type AuthorityId: BeefyAuthorityId + Parameter;
/// The signature type used by BEEFY.
///
/// Corresponds to the `BeefyId` field of the `pallet-beefy` configuration.
type Signature: BeefyVerify<Self::CommitmentHasher, Signer = Self::AuthorityId> + Parameter;
type AuthorityId: BeefyAuthorityId<Self::CommitmentHasher> + Parameter;
/// A way to convert validator id to its raw representation in the BEEFY merkle tree.
///
@@ -101,7 +97,8 @@ pub type BeefyAuthoritySetOf<C> = ValidatorSet<BeefyAuthorityIdOf<C>>;
/// BEEFY authority set, containing both validator identifiers and the numeric set id.
pub type BeefyAuthoritySetInfoOf<C> = sp_beefy::mmr::BeefyAuthoritySet<MmrHashOf<C>>;
/// BEEFY validator signature used by given Substrate chain.
pub type BeefyValidatorSignatureOf<C> = <C as ChainWithBeefy>::Signature;
pub type BeefyValidatorSignatureOf<C> =
<<C as ChainWithBeefy>::AuthorityId as RuntimeAppPublic>::Signature;
/// Signed BEEFY commitment used by given Substrate chain.
pub type BeefySignedCommitmentOf<C> =
SignedCommitment<BlockNumberOf<C>, BeefyValidatorSignatureOf<C>>;
@@ -162,7 +162,6 @@ impl ChainWithBeefy for Millau {
type MmrHash = <Keccak256 as sp_runtime::traits::Hash>::Output;
type BeefyMmrLeafExtra = ();
type AuthorityId = bp_beefy::EcdsaValidatorId;
type Signature = bp_beefy::EcdsaValidatorSignature;
type AuthorityIdToMerkleLeaf = bp_beefy::BeefyEcdsaToEthereum;
}