mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 04:01:02 +00:00
update Substrate/Polkadot/Cumulus deps to master (#1775)
This commit is contained in:
committed by
Bastian Köcher
parent
c36ba5a562
commit
8494162d2a
@@ -138,7 +138,6 @@ impl ChainWithBeefy for TestBridgedChain {
|
|||||||
type MmrHash = <Keccak256 as Hash>::Output;
|
type MmrHash = <Keccak256 as Hash>::Output;
|
||||||
type BeefyMmrLeafExtra = ();
|
type BeefyMmrLeafExtra = ();
|
||||||
type AuthorityId = BeefyId;
|
type AuthorityId = BeefyId;
|
||||||
type Signature = sp_beefy::crypto::AuthoritySignature;
|
|
||||||
type AuthorityIdToMerkleLeaf = pallet_beefy_mmr::BeefyEcdsaToEthereum;
|
type AuthorityIdToMerkleLeaf = pallet_beefy_mmr::BeefyEcdsaToEthereum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
BridgedBeefyAuthorityId, BridgedBeefyAuthoritySet, BridgedBeefyAuthoritySetInfo,
|
BridgedBeefyAuthorityId, BridgedBeefyAuthoritySet, BridgedBeefyAuthoritySetInfo,
|
||||||
BridgedBeefyCommitmentHasher, BridgedBeefyMmrLeaf, BridgedBeefySignedCommitment, BridgedChain,
|
BridgedBeefyMmrLeaf, BridgedBeefySignedCommitment, BridgedChain, BridgedMmrHash,
|
||||||
BridgedMmrHash, BridgedMmrHashing, BridgedMmrProof, Config, Error, LOG_TARGET,
|
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 codec::Encode;
|
||||||
use frame_support::ensure;
|
use frame_support::ensure;
|
||||||
use sp_runtime::traits::{Convert, Hash};
|
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()
|
authority_set.validators().iter().zip(commitment.signatures.iter()).enumerate()
|
||||||
{
|
{
|
||||||
if let Some(sig) = maybe_sig {
|
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);
|
missing_signatures = missing_signatures.saturating_sub(1);
|
||||||
if missing_signatures == 0 {
|
if missing_signatures == 0 {
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ pub use sp_beefy::{
|
|||||||
crypto::{AuthorityId as EcdsaValidatorId, AuthoritySignature as EcdsaValidatorSignature},
|
crypto::{AuthorityId as EcdsaValidatorId, AuthoritySignature as EcdsaValidatorSignature},
|
||||||
known_payloads::MMR_ROOT_ID as MMR_ROOT_PAYLOAD_ID,
|
known_payloads::MMR_ROOT_ID as MMR_ROOT_PAYLOAD_ID,
|
||||||
mmr::{BeefyAuthoritySet, MmrLeafVersion},
|
mmr::{BeefyAuthoritySet, MmrLeafVersion},
|
||||||
BeefyAuthorityId, BeefyVerify, Commitment, Payload as BeefyPayload, SignedCommitment,
|
BeefyAuthorityId, Commitment, Payload as BeefyPayload, SignedCommitment, ValidatorSet,
|
||||||
ValidatorSet, ValidatorSetId, BEEFY_ENGINE_ID,
|
ValidatorSetId, BEEFY_ENGINE_ID,
|
||||||
};
|
};
|
||||||
|
|
||||||
use bp_runtime::{BasicOperatingMode, BlockNumberOf, Chain, HashOf};
|
use bp_runtime::{BasicOperatingMode, BlockNumberOf, Chain, HashOf};
|
||||||
@@ -39,7 +39,7 @@ use frame_support::Parameter;
|
|||||||
use scale_info::TypeInfo;
|
use scale_info::TypeInfo;
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
traits::{Convert, MaybeSerializeDeserialize},
|
traits::{Convert, MaybeSerializeDeserialize},
|
||||||
RuntimeDebug,
|
RuntimeAppPublic, RuntimeDebug,
|
||||||
};
|
};
|
||||||
use sp_std::prelude::*;
|
use sp_std::prelude::*;
|
||||||
|
|
||||||
@@ -72,7 +72,8 @@ pub trait ChainWithBeefy: Chain {
|
|||||||
+ Copy
|
+ Copy
|
||||||
+ AsRef<[u8]>
|
+ AsRef<[u8]>
|
||||||
+ Default
|
+ Default
|
||||||
+ MaybeSerializeDeserialize;
|
+ MaybeSerializeDeserialize
|
||||||
|
+ PartialOrd;
|
||||||
|
|
||||||
/// The type expected for the MMR leaf extra data.
|
/// The type expected for the MMR leaf extra data.
|
||||||
type BeefyMmrLeafExtra: Parameter;
|
type BeefyMmrLeafExtra: Parameter;
|
||||||
@@ -80,12 +81,7 @@ pub trait ChainWithBeefy: Chain {
|
|||||||
/// A way to identify a BEEFY validator.
|
/// A way to identify a BEEFY validator.
|
||||||
///
|
///
|
||||||
/// Corresponds to the `BeefyId` field of the `pallet-beefy` configuration.
|
/// Corresponds to the `BeefyId` field of the `pallet-beefy` configuration.
|
||||||
type AuthorityId: BeefyAuthorityId + Parameter;
|
type AuthorityId: BeefyAuthorityId<Self::CommitmentHasher> + 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;
|
|
||||||
|
|
||||||
/// A way to convert validator id to its raw representation in the BEEFY merkle tree.
|
/// 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.
|
/// BEEFY authority set, containing both validator identifiers and the numeric set id.
|
||||||
pub type BeefyAuthoritySetInfoOf<C> = sp_beefy::mmr::BeefyAuthoritySet<MmrHashOf<C>>;
|
pub type BeefyAuthoritySetInfoOf<C> = sp_beefy::mmr::BeefyAuthoritySet<MmrHashOf<C>>;
|
||||||
/// BEEFY validator signature used by given Substrate chain.
|
/// 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.
|
/// Signed BEEFY commitment used by given Substrate chain.
|
||||||
pub type BeefySignedCommitmentOf<C> =
|
pub type BeefySignedCommitmentOf<C> =
|
||||||
SignedCommitment<BlockNumberOf<C>, BeefyValidatorSignatureOf<C>>;
|
SignedCommitment<BlockNumberOf<C>, BeefyValidatorSignatureOf<C>>;
|
||||||
|
|||||||
@@ -162,7 +162,6 @@ impl ChainWithBeefy for Millau {
|
|||||||
type MmrHash = <Keccak256 as sp_runtime::traits::Hash>::Output;
|
type MmrHash = <Keccak256 as sp_runtime::traits::Hash>::Output;
|
||||||
type BeefyMmrLeafExtra = ();
|
type BeefyMmrLeafExtra = ();
|
||||||
type AuthorityId = bp_beefy::EcdsaValidatorId;
|
type AuthorityId = bp_beefy::EcdsaValidatorId;
|
||||||
type Signature = bp_beefy::EcdsaValidatorSignature;
|
|
||||||
type AuthorityIdToMerkleLeaf = bp_beefy::BeefyEcdsaToEthereum;
|
type AuthorityIdToMerkleLeaf = bp_beefy::BeefyEcdsaToEthereum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user