From f2983dc1f94f1416c4daae851302b8cf553e8309 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Mon, 4 Mar 2024 16:06:45 +0100 Subject: [PATCH 01/14] Preliminary change to WorstCase trait to support benchmarks for pallet-dip-consume --- .../src/merkle_proofs/v0/input_common.rs | 18 +++++++++++++----- .../src/merkle_proofs/v0/provider_state/mod.rs | 4 +++- crates/kilt-dip-primitives/src/utils.rs | 3 ++- .../src/verifier/parachain/mod.rs | 4 +++- pallets/did/src/did_details.rs | 4 +++- .../pallet-dip-consumer/src/benchmarking.rs | 2 +- .../pallet-dip-provider/src/benchmarking.rs | 2 +- pallets/pallet-migration/src/benchmarking.rs | 2 +- pallets/pallet-migration/src/mock.rs | 4 +++- pallets/public-credentials/src/benchmarking.rs | 2 +- pallets/public-credentials/src/mock.rs | 4 +++- runtimes/common/src/assets.rs | 4 +++- runtimes/common/src/dip/did/mod.rs | 4 +++- support/src/traits.rs | 12 ++++++++---- 14 files changed, 48 insertions(+), 21 deletions(-) diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs index 2466276585..c7a86923b2 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs @@ -39,7 +39,9 @@ impl kilt_support::traits::GetWorstCase for where RelayBlockNumber: Default, { - fn worst_case(context: Context) -> Self { + type Output = Self; + + fn worst_case(context: Context) -> Self::Output { Self { relay_block_number: RelayBlockNumber::default(), proof: BoundedBlindedValue::worst_case(context), @@ -54,7 +56,9 @@ pub struct DipCommitmentStateProof(pub(crate) BoundedBlindedValue); #[cfg(feature = "runtime-benchmarks")] impl kilt_support::traits::GetWorstCase for DipCommitmentStateProof { - fn worst_case(context: Context) -> Self { + type Output = Self; + + fn worst_case(context: Context) -> Self::Output { Self(BoundedBlindedValue::worst_case(context)) } } @@ -129,7 +133,9 @@ impl< ProviderWeb3Name: Clone, ProviderLinkableAccountId: Clone, { - fn worst_case(context: Context) -> Self { + type Output = Self; + + fn worst_case(context: Context) -> Self::Output { Self { blinded: BoundedBlindedValue::worst_case(context), revealed: sp_std::vec![RevealedDidMerkleProofLeaf::default(); 64], @@ -192,10 +198,12 @@ where #[cfg(feature = "runtime-benchmarks")] impl kilt_support::traits::GetWorstCase for TimeBoundDidSignature where - DidSignature: kilt_support::traits::GetWorstCase, + DidSignature: kilt_support::traits::GetWorstCase, BlockNumber: Default, { - fn worst_case(context: Context) -> Self { + type Output = Self; + + fn worst_case(context: Context) -> Self::Output { Self { signature: DidSignature::worst_case(context), valid_until: BlockNumber::default(), diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs index ad548ec05e..9099b8c42b 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs @@ -105,7 +105,9 @@ impl< ConsumerBlockNumber: Default, Context: Clone, { - fn worst_case(context: Context) -> Self { + type Output = Self; + + fn worst_case(context: Context) -> Self::Output { Self { provider_head_proof: ProviderHeadStateProof::worst_case(context.clone()), dip_commitment_proof: DipCommitmentStateProof::worst_case(context.clone()), diff --git a/crates/kilt-dip-primitives/src/utils.rs b/crates/kilt-dip-primitives/src/utils.rs index 8c055f4fc8..faadedac50 100644 --- a/crates/kilt-dip-primitives/src/utils.rs +++ b/crates/kilt-dip-primitives/src/utils.rs @@ -71,7 +71,8 @@ impl kilt_support::traits::GetWorstCase for BoundedBlindedV where T: Default + Clone, { - fn worst_case(_context: Context) -> Self { + type Output = Self; + fn worst_case(_context: Context) -> Self::Output { Self(sp_std::vec![sp_std::vec![T::default(); 128]; 64]) } } diff --git a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs index df0f6da68b..37061bed1b 100644 --- a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs @@ -94,7 +94,9 @@ impl< ConsumerBlockNumber: Default, Context: Clone, { - fn worst_case(context: Context) -> Self { + type Output = Self; + + fn worst_case(context: Context) -> Self::Output { Self::V0(ParachainDipDidProof::worst_case(context)) } } diff --git a/pallets/did/src/did_details.rs b/pallets/did/src/did_details.rs index d28291f96d..8e57fca230 100644 --- a/pallets/did/src/did_details.rs +++ b/pallets/did/src/did_details.rs @@ -193,7 +193,9 @@ impl From for DidSignature { #[cfg(feature = "runtime-benchmarks")] impl kilt_support::traits::GetWorstCase for DidSignature { - fn worst_case(_context: Context) -> Self { + type Output = Self; + + fn worst_case(_context: Context) -> Self::Output { Self::Sr25519(sp_core::sr25519::Signature::from_raw([0u8; 64])) } } diff --git a/pallets/pallet-dip-consumer/src/benchmarking.rs b/pallets/pallet-dip-consumer/src/benchmarking.rs index 0052ebbb0d..0de5ad85b7 100644 --- a/pallets/pallet-dip-consumer/src/benchmarking.rs +++ b/pallets/pallet-dip-consumer/src/benchmarking.rs @@ -28,7 +28,7 @@ use kilt_support::{ where T::AccountId: Instanciate, T::Identifier: Instanciate, - <::ProofVerifier as IdentityProofVerifier>::Proof: GetWorstCase>, + <::ProofVerifier as IdentityProofVerifier>::Proof: GetWorstCase, Output = <::ProofVerifier as IdentityProofVerifier>::Proof>, ::RuntimeCall: From>, )] mod benchmarks { diff --git a/pallets/pallet-dip-provider/src/benchmarking.rs b/pallets/pallet-dip-provider/src/benchmarking.rs index a0dcbe4f7f..31aa3e2e84 100644 --- a/pallets/pallet-dip-provider/src/benchmarking.rs +++ b/pallets/pallet-dip-provider/src/benchmarking.rs @@ -28,7 +28,7 @@ use kilt_support::{ T::CommitOriginCheck: GenerateBenchmarkOrigin, T::AccountId: Instanciate, T::Identifier: Instanciate, - <::IdentityProvider as IdentityProvider>::Success: GetWorstCase> + <::IdentityProvider as IdentityProvider>::Success: GetWorstCase, Output = <::IdentityProvider as IdentityProvider>::Success> )] mod benchmarks { diff --git a/pallets/pallet-migration/src/benchmarking.rs b/pallets/pallet-migration/src/benchmarking.rs index 5f221d48a8..598b7b864c 100644 --- a/pallets/pallet-migration/src/benchmarking.rs +++ b/pallets/pallet-migration/src/benchmarking.rs @@ -71,7 +71,7 @@ benchmarks! { ::AccountId: From, ::EnsureOrigin: GenerateBenchmarkOrigin<::RuntimeOrigin, T::AccountId, ::AttesterId>, BlockNumberFor: From, - ::SubjectId: GetWorstCase + sp_std::fmt::Debug + Into> , + ::SubjectId: GetWorstCase::SubjectId> + sp_std::fmt::Debug + Into> , T: ctype::Config::AttesterId>, ::DelegationNodeId: From, ::DelegationEntityId: From, diff --git a/pallets/pallet-migration/src/mock.rs b/pallets/pallet-migration/src/mock.rs index bbf3ba6b80..4a21c99c60 100644 --- a/pallets/pallet-migration/src/mock.rs +++ b/pallets/pallet-migration/src/mock.rs @@ -377,7 +377,9 @@ pub mod runtime { #[cfg(feature = "runtime-benchmarks")] impl kilt_support::traits::GetWorstCase for TestSubjectId { // Only used for benchmark testing, not really relevant. - fn worst_case(_context: Context) -> Self { + type Output = Self; + + fn worst_case(_context: Context) -> Self::Output { crate::mock::TestSubjectId::default() } } diff --git a/pallets/public-credentials/src/benchmarking.rs b/pallets/public-credentials/src/benchmarking.rs index 4a6113f7c5..3fbbdd63c8 100644 --- a/pallets/public-credentials/src/benchmarking.rs +++ b/pallets/public-credentials/src/benchmarking.rs @@ -59,7 +59,7 @@ benchmarks! { T: Config, T: ctype::Config, ::EnsureOrigin: GenerateBenchmarkOrigin, - ::SubjectId: GetWorstCase + Into> + sp_std::fmt::Debug, + ::SubjectId: GetWorstCase::SubjectId> + Into> + sp_std::fmt::Debug, ::CredentialId: Default, BlockNumberFor: From, ::Currency: Mutate, diff --git a/pallets/public-credentials/src/mock.rs b/pallets/public-credentials/src/mock.rs index 18655b3e22..a444563031 100644 --- a/pallets/public-credentials/src/mock.rs +++ b/pallets/public-credentials/src/mock.rs @@ -249,7 +249,9 @@ pub(crate) mod runtime { #[cfg(feature = "runtime-benchmarks")] impl kilt_support::traits::GetWorstCase for TestSubjectId { // Only used for benchmark testing, not really relevant. - fn worst_case(_context: Context) -> Self { + type Output = Self; + + fn worst_case(_context: Context) -> Self::Output { crate::mock::TestSubjectId::default() } } diff --git a/runtimes/common/src/assets.rs b/runtimes/common/src/assets.rs index 855e09e157..21787709c5 100644 --- a/runtimes/common/src/assets.rs +++ b/runtimes/common/src/assets.rs @@ -105,7 +105,9 @@ mod benchmarks { } impl kilt_support::traits::GetWorstCase for AssetDid { - fn worst_case(_context: Context) -> Self { + type Output = Self; + + fn worst_case(_context: Context) -> Self::Output { // Returns the worst case for an AssetDID, which is represented by the longest // identifier according to the spec. Self::try_from( diff --git a/runtimes/common/src/dip/did/mod.rs b/runtimes/common/src/dip/did/mod.rs index 660fc945d5..a8533aafd3 100644 --- a/runtimes/common/src/dip/did/mod.rs +++ b/runtimes/common/src/dip/did/mod.rs @@ -175,7 +175,9 @@ where ::AccountId: Into + From, ::AccountId: AsRef<[u8; 32]> + From<[u8; 32]>, { - fn worst_case(context: IdentityContext) -> Self { + type Output = Self; + + fn worst_case(context: IdentityContext) -> Self::Output { use did::{ did_details::DidVerificationKey, mock_utils::{generate_base_did_creation_details, get_key_agreement_keys}, diff --git a/support/src/traits.rs b/support/src/traits.rs index 5b6cf4a226..535fc65f9c 100644 --- a/support/src/traits.rs +++ b/support/src/traits.rs @@ -82,24 +82,28 @@ pub trait GenerateBenchmarkOrigin { /// only when running benchmarks. #[cfg(feature = "runtime-benchmarks")] pub trait GetWorstCase { - fn worst_case(context: Context) -> Self; + type Output; + fn worst_case(context: Context) -> Self::Output; } #[cfg(feature = "runtime-benchmarks")] impl GetWorstCase for u32 { - fn worst_case(_context: T) -> Self { + type Output = Self; + fn worst_case(_context: T) -> Self::Output { u32::MAX } } #[cfg(feature = "runtime-benchmarks")] impl GetWorstCase for () { - fn worst_case(_context: T) -> Self {} + type Output = Self; + fn worst_case(_context: T) -> Self::Output {} } #[cfg(feature = "runtime-benchmarks")] impl GetWorstCase for bool { - fn worst_case(_context: T) -> Self { + type Output = Self; + fn worst_case(_context: T) -> Self::Output { true } } From 1cf50f40d662e0477e2401c6783d95c1cee3e6be Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Mon, 4 Mar 2024 16:25:45 +0100 Subject: [PATCH 02/14] On the way to a nice benchmarking framework! --- .../pallet-dip-consumer/src/benchmarking.rs | 48 ++++++++----------- pallets/pallet-dip-consumer/src/mock.rs | 23 ++++++++- 2 files changed, 42 insertions(+), 29 deletions(-) diff --git a/pallets/pallet-dip-consumer/src/benchmarking.rs b/pallets/pallet-dip-consumer/src/benchmarking.rs index 0de5ad85b7..3a998bf9ca 100644 --- a/pallets/pallet-dip-consumer/src/benchmarking.rs +++ b/pallets/pallet-dip-consumer/src/benchmarking.rs @@ -16,50 +16,42 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org -use crate::{traits::IdentityProofVerifier, Call, Config, IdentityEntries, Pallet}; +use crate::{Config, IdentityProofOf, RuntimeCallOf}; use frame_benchmarking::v2::*; -use frame_system::RawOrigin; -use kilt_support::{ - benchmark::IdentityContext, - traits::{GetWorstCase, Instanciate}, -}; + +pub struct WorstCaseOf { + pub submitter: T::AccountId, + pub subject: T::Identifier, + pub proof: IdentityProofOf, + pub call: RuntimeCallOf, +} #[benchmarks( where - T::AccountId: Instanciate, - T::Identifier: Instanciate, - <::ProofVerifier as IdentityProofVerifier>::Proof: GetWorstCase, Output = <::ProofVerifier as IdentityProofVerifier>::Proof>, - ::RuntimeCall: From>, + T::ProofVerifier: GetWorstCase>, + ::RuntimeCall: From>, )] mod benchmarks { + use frame_system::RawOrigin; + use kilt_support::traits::GetWorstCase; + use sp_std::{boxed::Box, vec}; - use super::*; - - type IdentityContextOf = - IdentityContext<::Identifier, ::AccountId>; + use crate::{benchmarking::WorstCaseOf, Call, Config, IdentityEntries, Pallet}; #[benchmark] fn dispatch_as() { - let submitter = T::AccountId::new(1); - let subject = T::Identifier::new(1); - - let context = IdentityContext:: { - did: subject.clone(), - submitter: submitter.clone(), - }; + let WorstCaseOf { + submitter, + subject, + proof, + call, + } = ::worst_case(()); assert!(IdentityEntries::::get(&subject).is_none()); let origin = RawOrigin::Signed(submitter); - - let call: ::RuntimeCall = frame_system::Call::::remark { remark: vec![] }.into(); - let boxed_call = Box::from(call); - let proof = <<::ProofVerifier as IdentityProofVerifier>::Proof as GetWorstCase< - IdentityContextOf, - >>::worst_case(context); - let origin = ::RuntimeOrigin::from(origin); #[extrinsic_call] diff --git a/pallets/pallet-dip-consumer/src/mock.rs b/pallets/pallet-dip-consumer/src/mock.rs index 15fc83446d..e47a8655f5 100644 --- a/pallets/pallet-dip-consumer/src/mock.rs +++ b/pallets/pallet-dip-consumer/src/mock.rs @@ -26,8 +26,12 @@ use frame_support::{ traits::{ConstU16, ConstU32, ConstU64, Contains, Currency, Everything}, }; use frame_system::{mocking::MockBlock, EnsureSigned}; +use kilt_support::traits::GetWorstCase; -use crate::{traits::IdentityProofVerifier, Config, DipOrigin, EnsureDipOrigin, IdentityEntries, RuntimeCallOf}; +use crate::{ + benchmarking::WorstCaseOf, traits::IdentityProofVerifier, Config, DipOrigin, EnsureDipOrigin, IdentityEntries, + RuntimeCallOf, +}; // This mock is used both for benchmarks and unit tests. // For benchmarks, the `system::remark` call must be allowed to be dispatched, @@ -134,6 +138,23 @@ impl IdentityProofVerifier for BooleanProofVerifier { } } +#[cfg(feature = "runtime-benchmarks")] +impl GetWorstCase for BooleanProofVerifier { + type Output = WorstCaseOf; + + fn worst_case(_context: ()) -> Self::Output { + WorstCaseOf { + call: frame_system::Call::remark { + remark: b"Hello!".to_vec(), + } + .into(), + proof: true, + subject: AccountId32::new([100; 32]), + submitter: AccountId32::new([200; 32]), + } + } +} + impl crate::Config for TestRuntime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; From 7fc0d074c442350d4ad83148c2f9367b9ac49c08 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Mon, 4 Mar 2024 17:05:51 +0100 Subject: [PATCH 03/14] Project compiling without benchmark feature --- .../src/merkle_proofs/v0/input_common.rs | 66 ++---------------- .../merkle_proofs/v0/provider_state/mod.rs | 28 +++----- .../merkle_proofs/v0/provider_state/tests.rs | 12 ++-- .../src/merkle_proofs/v0/relay_state/tests.rs | 10 +-- crates/kilt-dip-primitives/src/utils.rs | 68 ------------------- .../src/verifier/parachain/mod.rs | 47 +++++++++++++ .../src/verifier/parachain/v0/mock.rs | 7 +- .../src/verifier/parachain/v0/mod.rs | 46 +++++++++++++ .../src/verifier/relaychain/mod.rs | 55 ++++++++++++++- .../src/verifier/relaychain/v0/mod.rs | 54 ++++++++++++++- dip-template/runtimes/dip-consumer/src/dip.rs | 1 + pallets/pallet-dip-consumer/src/mock.rs | 12 ++-- runtimes/common/src/dip/merkle/v0/mod.rs | 5 +- 13 files changed, 235 insertions(+), 176 deletions(-) diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs index c7a86923b2..67d6535274 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs @@ -21,7 +21,7 @@ use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; use sp_std::vec::Vec; -use crate::{merkle_proofs::v0::output_common::RevealedDidMerkleProofLeaf, utils::BoundedBlindedValue}; +use crate::merkle_proofs::v0::output_common::RevealedDidMerkleProofLeaf; /// The state proof for a parachain head. /// @@ -31,37 +31,13 @@ use crate::{merkle_proofs::v0::output_common::RevealedDidMerkleProofLeaf, utils: #[cfg_attr(test, derive(Default))] pub struct ProviderHeadStateProof { pub(crate) relay_block_number: RelayBlockNumber, - pub(crate) proof: BoundedBlindedValue, -} - -#[cfg(feature = "runtime-benchmarks")] -impl kilt_support::traits::GetWorstCase for ProviderHeadStateProof -where - RelayBlockNumber: Default, -{ - type Output = Self; - - fn worst_case(context: Context) -> Self::Output { - Self { - relay_block_number: RelayBlockNumber::default(), - proof: BoundedBlindedValue::worst_case(context), - } - } + pub(crate) proof: Vec>, } /// The state proof for a DIP commitment. #[derive(Clone, Debug, Encode, Decode, PartialEq, Eq, TypeInfo)] #[cfg_attr(test, derive(Default))] -pub struct DipCommitmentStateProof(pub(crate) BoundedBlindedValue); - -#[cfg(feature = "runtime-benchmarks")] -impl kilt_support::traits::GetWorstCase for DipCommitmentStateProof { - type Output = Self; - - fn worst_case(context: Context) -> Self::Output { - Self(BoundedBlindedValue::worst_case(context)) - } -} +pub struct DipCommitmentStateProof(pub(crate) Vec>); /// The Merkle proof for a KILT DID. /// @@ -80,7 +56,7 @@ pub struct DidMerkleProof< ProviderWeb3Name, ProviderLinkableAccountId, > { - pub(crate) blinded: BoundedBlindedValue, + pub(crate) blinded: Vec>, pub(crate) revealed: Vec< RevealedDidMerkleProofLeaf< ProviderDidKeyId, @@ -96,7 +72,7 @@ impl { pub fn new( - blinded: BoundedBlindedValue, + blinded: Vec>, revealed: Vec< RevealedDidMerkleProofLeaf< ProviderDidKeyId, @@ -111,38 +87,6 @@ impl kilt_support::traits::GetWorstCase - for DidMerkleProof< - ProviderDidKeyId, - ProviderAccountId, - ProviderBlockNumber, - ProviderWeb3Name, - ProviderLinkableAccountId, - > where - ProviderDidKeyId: Default + Clone, - ProviderAccountId: Clone, - ProviderBlockNumber: Default + Clone, - ProviderWeb3Name: Clone, - ProviderLinkableAccountId: Clone, -{ - type Output = Self; - - fn worst_case(context: Context) -> Self::Output { - Self { - blinded: BoundedBlindedValue::worst_case(context), - revealed: sp_std::vec![RevealedDidMerkleProofLeaf::default(); 64], - } - } -} - #[cfg(test)] impl Default for DidMerkleProof< diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs index 9099b8c42b..79aba9989e 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs @@ -76,7 +76,7 @@ pub struct ParachainDipDidProof< pub(crate) signature: TimeBoundDidSignature, } -#[cfg(feature = "runtime-benchmarks")] +#[cfg(test)] impl< RelayBlockNumber, KiltDidKeyId, @@ -85,9 +85,8 @@ impl< KiltWeb3Name, KiltLinkableAccountId, ConsumerBlockNumber, - Context, - > kilt_support::traits::GetWorstCase - for ParachainDipDidProof< + > + ParachainDipDidProof< RelayBlockNumber, KiltDidKeyId, KiltAccountId, @@ -96,23 +95,16 @@ impl< KiltLinkableAccountId, ConsumerBlockNumber, > where - RelayBlockNumber: Default, - KiltDidKeyId: Default + Clone, - KiltAccountId: Clone, - KiltBlockNumber: Default + Clone, - KiltWeb3Name: Clone, - KiltLinkableAccountId: Clone, + KiltDidKeyId: Default, + KiltBlockNumber: Default, ConsumerBlockNumber: Default, - Context: Clone, { - type Output = Self; - - fn worst_case(context: Context) -> Self::Output { + pub(crate) fn with_provider_head_proof(provider_head_proof: ProviderHeadStateProof) -> Self { Self { - provider_head_proof: ProviderHeadStateProof::worst_case(context.clone()), - dip_commitment_proof: DipCommitmentStateProof::worst_case(context.clone()), - dip_proof: DidMerkleProof::worst_case(context.clone()), - signature: TimeBoundDidSignature::worst_case(context), + provider_head_proof, + dip_commitment_proof: Default::default(), + dip_proof: Default::default(), + signature: Default::default(), } } } diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/tests.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/tests.rs index 481ff5caca..1790c8b0ad 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/tests.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/tests.rs @@ -77,7 +77,7 @@ mod parachain_dip_did_proof { hex!("80ffff8003ff6c42a935aca27c743910dbb62aae8009854a21741d74080abb406c26b1f58084a7c1351a2986c948c9a111c955d0f8635e4bd305c24f9b6680405fdce955a180ed003737744c7fba94d0c2cb57f96e7bf3310d9c7a285ae789e25af8b79091b38017a0734a39f27a75f6f648bca2facca2381325b529d32bcf82e75aaf6b7d82dd8042e2e666a38ce9fdbe60164d0c3a351ce06c931931d2cd6650378c1ad691c21480d0cc4967746360ee3895a6937608d7f36674426928790cb8ca7426289ad74469804e8940ff6b30dfb0f92341c3a738f262bed9ca03de9b868eb99cfc282aa7786780acda22345d4597dfe6fd831509b944254e26a00fd56e77bc2cb780c0775a520a808c0dae720727cec94dbc853812332bfd6d5f2cc5e287bcd1e5efc530053dbd2280a16a8184b9f2e555d4991995fd479b1ee7b35653f2215f74f822436dbbb2331580984648137ae9c8ecf33f878cedffdba73fb4282ba3ec033102aa6d7442466517801132afeed824c180373b2450b32c72c84a21cdfddbe0f1bf8e76d6958963669580357f2107df0a82f2605f90e39c5665bdf69e1d6222bc425f8390bde67c1d414780c4e048c8dc0ea614a190375a1b215c8e8ff5f5098cd43a93d59be907a2258a74807ad4cd868c49acc40e389d45a1e7e7629e666972ed747c67b607b07f637c1f0b8021bbaa444a77faac92b771c0e1b19162ace64b5ce745892d3ce59f820cba2dc7").to_vec(), hex!("9e710b30bd2eab0352ddcc26417aa1945fd3802284b6ec6d4b3138fca93d003a58421ba947ecbc14c39e76572061105bbc568b809f8b23e74053dd98b58424e102ba5ac16f028714ec16a61522011fe6e16771ff80ed3e43ac278948816e8c9e8adda2dbeefe552702cf8144fd9b50e0b8db99bfcf80694abb8b23315ab79cdb22ca6826e867a9157415a832ad38f376dd819107d3ea80b9aee043e378f8313e68a6030679ccf3880fa1e7ab19b6244b5c262b7a152f004c5f03c716fb8fff3de61a883bb76adb34a2040080f15f37adeb10597dac54c2c65393277b2ca62aa27b2d16a23a78a4cc55ef15bb8008a0c609ab4888f02c2545c002153297c2641c5a7b4f3d8e25c634e721f80bea80b6617c764df278313c426c46961ccde8ee7a03f9007b74bc8bc6c49d1583cf7d801c9a4a3457ad4a568dd4c9abe231304689c9bec78be932ef0a2d30690ca428848059ef8bbe3a06c98792f41b3e0a6cdf1f157d9be85e12a7c1daf9c30f969daba4").to_vec(), hex!("9f0b3c252fcb29d88eff4f3de5de4476c3ffbf805254dc9131b269f3bbbb71f58a76a5034b2bc2faaab0d1cf45c3819dc6e69740804bc059c3d96f627e09a3b6c0f9851d902f84ac68006617289ac0b7d0a272b36280d97e2394406f94be4266da29b6fe7f3178059525eaf3c9b540064389af020bf180636959b43018d3ff8a55246d5874a16c93e85bd2a58c82ebfc1b54dd9b2a7d0780d3c1a10188200f31459d722f7efc693736d1a36af5644fd949b2e411d7942597800328f24d0485b9701135913a569f6ccbf261a05d055183abf3e4ecb4e4375b7c80f3229cd59de7b1e604f110cbcf814466f2d2973e9bdb6c106a662c576e0820e480b66b29cbd45f93602dbc9f1175407c6f69bd686d23dd22a8f0dfe9cff08843ad80ddb2d426c0c546068b429e77253e0a8a32e818151f5fc031e899a0f6acad157580ea7fb3cad8e128cc295194658016f4865ef37501e5759fb4f15cb2ecb689e85e80e9f3cac1b25842da7fbaf947952dc30329a1d19037ab21baed3851acbee629f6800d898e2a4a6ee9969a233c4741e4441c0fe393104b3cfc5adcf348f3ef20fc7480ac6c622536e593ae3c9d423a461faafc7abbf01ecb129e69d66f3382eaf484dc80c7ba3cadffaea5acd013dba51c96129ae93ea6cd45f3930e4302f5b100f6deae806f29f805e30029363e42381d6609ecb6837411bd6fd676c0a37621a3b5588101").to_vec() - ].into_iter().into(), + ], }) } @@ -118,7 +118,7 @@ mod parachain_dip_did_proof { hex!("80ffff8003ff6c42a935aca27c743910dbb62aae8009854a21741d74080abb406c26b1f58084a7c1351a2986c948c9a111c955d0f8635e4bd305c24f9b6680405fdce955a180ed003737744c7fba94d0c2cb57f96e7bf3310d9c7a285ae789e25af8b79091b38017a0734a39f27a75f6f648bca2facca2381325b529d32bcf82e75aaf6b7d82dd8042e2e666a38ce9fdbe60164d0c3a351ce06c931931d2cd6650378c1ad691c21480d0cc4967746360ee3895a6937608d7f36674426928790cb8ca7426289ad74469804e8940ff6b30dfb0f92341c3a738f262bed9ca03de9b868eb99cfc282aa7786780acda22345d4597dfe6fd831509b944254e26a00fd56e77bc2cb780c0775a520a808c0dae720727cec94dbc853812332bfd6d5f2cc5e287bcd1e5efc530053dbd2280a16a8184b9f2e555d4991995fd479b1ee7b35653f2215f74f822436dbbb2331580984648137ae9c8ecf33f878cedffdba73fb4282ba3ec033102aa6d7442466517801132afeed824c180373b2450b32c72c84a21cdfddbe0f1bf8e76d6958963669580357f2107df0a82f2605f90e39c5665bdf69e1d6222bc425f8390bde67c1d414780c4e048c8dc0ea614a190375a1b215c8e8ff5f5098cd43a93d59be907a2258a74807ad4cd868c49acc40e389d45a1e7e7629e666972ed747c67b607b07f637c1f0b8021bbaa444a77faac92b771c0e1b19162ace64b5ce745892d3ce59f820cba2dc7").to_vec(), hex!("9e710b30bd2eab0352ddcc26417aa1945fd3802284b6ec6d4b3138fca93d003a58421ba947ecbc14c39e76572061105bbc568b809f8b23e74053dd98b58424e102ba5ac16f028714ec16a61522011fe6e16771ff80ed3e43ac278948816e8c9e8adda2dbeefe552702cf8144fd9b50e0b8db99bfcf80694abb8b23315ab79cdb22ca6826e867a9157415a832ad38f376dd819107d3ea80b9aee043e378f8313e68a6030679ccf3880fa1e7ab19b6244b5c262b7a152f004c5f03c716fb8fff3de61a883bb76adb34a2040080f15f37adeb10597dac54c2c65393277b2ca62aa27b2d16a23a78a4cc55ef15bb8008a0c609ab4888f02c2545c002153297c2641c5a7b4f3d8e25c634e721f80bea80b6617c764df278313c426c46961ccde8ee7a03f9007b74bc8bc6c49d1583cf7d801c9a4a3457ad4a568dd4c9abe231304689c9bec78be932ef0a2d30690ca428848059ef8bbe3a06c98792f41b3e0a6cdf1f157d9be85e12a7c1daf9c30f969daba4").to_vec(), hex!("9f0b3c252fcb29d88eff4f3de5de4476c3ffbf805254dc9131b269f3bbbb71f58a76a5034b2bc2faaab0d1cf45c3819dc6e69740804bc059c3d96f627e09a3b6c0f9851d902f84ac68006617289ac0b7d0a272b36280d97e2394406f94be4266da29b6fe7f3178059525eaf3c9b540064389af020bf180636959b43018d3ff8a55246d5874a16c93e85bd2a58c82ebfc1b54dd9b2a7d0780d3c1a10188200f31459d722f7efc693736d1a36af5644fd949b2e411d7942597800328f24d0485b9701135913a569f6ccbf261a05d055183abf3e4ecb4e4375b7c80f3229cd59de7b1e604f110cbcf814466f2d2973e9bdb6c106a662c576e0820e480b66b29cbd45f93602dbc9f1175407c6f69bd686d23dd22a8f0dfe9cff08843ad80ddb2d426c0c546068b429e77253e0a8a32e818151f5fc031e899a0f6acad157580ea7fb3cad8e128cc295194658016f4865ef37501e5759fb4f15cb2ecb689e85e80e9f3cac1b25842da7fbaf947952dc30329a1d19037ab21baed3851acbee629f6800d898e2a4a6ee9969a233c4741e4441c0fe393104b3cfc5adcf348f3ef20fc7480ac6c622536e593ae3c9d423a461faafc7abbf01ecb129e69d66f3382eaf484dc80c7ba3cadffaea5acd013dba51c96129ae93ea6cd45f3930e4302f5b100f6deae806f29f805e30029363e42381d6609ecb6837411bd6fd676c0a37621a3b5588101").to_vec() - ].into_iter().into(), + ], }; // Only interested in the parachain head verification part, we skip everything // else. @@ -286,7 +286,7 @@ mod dip_did_proof_with_verified_relay_state_root { hex!("800c808052d9b1ca86bf39ca4b7d574a5bcea35625200b5ff30c4517f7f361c67376e7fd8003ab0887cbb70c4e0d8d0f738e4b05732fd8cb5da24fa5f1112e20ba3603d58a80873d542c3a85337b597f63fc7a89837909196a9f0823625af4e2c18cc5274b56").to_vec(), hex!("80ffff808a66c19052add13a202bcd73b546ae0cb70544f166c4a469672c666f0a5f9d8a80b84c2df313e2e749ff7e47eee888d9a023ba0a14a59852f4526b3e4b93b6dcbc807310fd50a0ae630c15e9eb07bda831d6d0cb6044d53a3dafb68e3fdb199fffdf80015ecd5e8af66e3d72ee5cc828c25989ca848e55396cccd9c196a4df1349fb9980a2ec48e449c43cc34954836cc14af398695f6569e301cef5a13eb88a16aa395580fd068d1339506db2893ba54a00a85aa712d68ff98ceeb5f4632f4e53618bb77880a3f173abac33e571e2a66f13127eeec3fb31bb1ae6f4b0fca8e658bbfbb5e52a803084ef6eaf38b821c59b3de92c4679117509b0b031e52ef5a80fdcff72e498ec804f36b8fb07a75463165f1714181009c86a2790685e78abd43220f5ecb194c887802559300c82eef4b21724bba2706cc2815e98cac3993c8d8dc9057b1aaf45ae8d8006571e929d492077d682dbc911934874ec00335029a90bd39e37d6d641e11873800397abe2ea62a374e5f0650c54fb99e8ef825066da798b0f4d729a7281f3575880b35cfb12f77988e1305ba651db7a8efbd43e4e8b057a56736cf6485f3033f481809ab1e406503e3ce63425a294f3f37aa4827b6a4ab38cf7e960a0d3335d79234e80be7c96632aa67491005e607a53bc1ab725fa465e29797bc29973d4cf5f64239b8037fe2a92c86d4c38ff38570b071e994ab86214e43e095dfb6ed142170fdac430").to_vec(), hex!("be75edf06348b4330d1e88564111cb3d5bf19e4ed2927982e234d989e812f3f3010880ffe3135a9ee019dbfe4143608c9f4a4291ab827d7d9d055028d556d9cea2fce180eb5d42e7c6f84ac20e0d5ab42008c631b3e87f36d55d0d5053c9fb4f944ef97c").to_vec(), - ].into_iter().into())) + ])) } #[test] @@ -325,7 +325,7 @@ mod dip_did_proof_with_verified_relay_state_root { hex!("800c808052d9b1ca86bf39ca4b7d574a5bcea35625200b5ff30c4517f7f361c67376e7fd80ccbd1321b25f59f4de9cd943c7322b8f2b943e30e510e7f32571250f651015bc80873d542c3a85337b597f63fc7a89837909196a9f0823625af4e2c18cc5274b56").to_vec(), hex!("80ffff808a66c19052add13a202bcd73b546ae0cb70544f166c4a469672c666f0a5f9d8a80b84c2df313e2e749ff7e47eee888d9a023ba0a14a59852f4526b3e4b93b6dcbc80e2f12a87d30577bc3586e4684c34438a779df39f6bee51b098193f1484e7b20f80015ecd5e8af66e3d72ee5cc828c25989ca848e55396cccd9c196a4df1349fb99808587812cb707ea395adbd624fba27708a8b734dd26c75febf4d79f30f775d31f80cf4fdd2b7ee898fa3de2063d08ca5488a65e49b4f21969be56dd22b79729f4ce80f77d231bea6c289f8d969c0a2cc81ec8447efa0747845799e7bc635626801605806830b9c8dadb45b721c323e66aaf4417dd1f2a3b0315c17c7e9bc3a75312677d807368afb2a07ba2ca0ceec6c88e0e3040a39d4c86408f97d2fa0006c39531b4ca802559300c82eef4b21724bba2706cc2815e98cac3993c8d8dc9057b1aaf45ae8d808c1f6312826116f8e9aa52506bfc8b3b4583998f8858213044dac52f3ac1138c803e008fcbfb660c563e9eb278cf78fe3988027713cd9077898c351c41844fefc480002990139706fe0a03fcfc41614c9cec1ae13ddafba4de0630af0b87503d8312809ab1e406503e3ce63425a294f3f37aa4827b6a4ab38cf7e960a0d3335d79234e80be7c96632aa67491005e607a53bc1ab725fa465e29797bc29973d4cf5f64239b8003bce13d1847862ce6f26f6b420ffda9cd9b635c2ec8533f23c7b2d454d66b29").to_vec(), hex!("be75edf06348b4330d1e88564111cb3d5bf19e4ed2927982e234d989e812f3f3110880ffe3135a9ee019dbfe4143608c9f4a4291ab827d7d9d055028d556d9cea2fce1804276317882ff464bb21f7fb6b9e20ccee7a1e414608ecb3c8c349dfa286dfd7480eb5d42e7c6f84ac20e0d5ab42008c631b3e87f36d55d0d5053c9fb4f944ef97c").to_vec(), - ].into_iter().into()); + ]); // Only interested in the DIP commitment verification part, we skip everything // else. let proof = @@ -477,9 +477,7 @@ mod dip_did_proof_with_verified_subject_commitment { ) .to_vec(), hex!("7f0400da6646d21f19b4d7d9f80d5beb103fbef7f4bb95eb94e0c02552175b1bff3a010000").to_vec(), - ] - .into_iter() - .into(), + ], revealed: vec![RevealedDidKey { id: hex!("50da6646d21f19b4d7d9f80d5beb103fbef7f4bb95eb94e0c02552175b1bff3a").into(), relationship: DidVerificationKeyRelationship::Authentication.into(), diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/relay_state/tests.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/relay_state/tests.rs index a1df2647f9..42aef97c56 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/relay_state/tests.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/relay_state/tests.rs @@ -186,7 +186,7 @@ mod relay_dip_did_proof_with_verified_relay_state_root { hex!("80ffff8003ff6c42a935aca27c743910dbb62aae8009854a21741d74080abb406c26b1f58084a7c1351a2986c948c9a111c955d0f8635e4bd305c24f9b6680405fdce955a180ed003737744c7fba94d0c2cb57f96e7bf3310d9c7a285ae789e25af8b79091b38017a0734a39f27a75f6f648bca2facca2381325b529d32bcf82e75aaf6b7d82dd8042e2e666a38ce9fdbe60164d0c3a351ce06c931931d2cd6650378c1ad691c21480d0cc4967746360ee3895a6937608d7f36674426928790cb8ca7426289ad74469804e8940ff6b30dfb0f92341c3a738f262bed9ca03de9b868eb99cfc282aa7786780acda22345d4597dfe6fd831509b944254e26a00fd56e77bc2cb780c0775a520a808c0dae720727cec94dbc853812332bfd6d5f2cc5e287bcd1e5efc530053dbd2280a16a8184b9f2e555d4991995fd479b1ee7b35653f2215f74f822436dbbb2331580984648137ae9c8ecf33f878cedffdba73fb4282ba3ec033102aa6d7442466517801132afeed824c180373b2450b32c72c84a21cdfddbe0f1bf8e76d6958963669580357f2107df0a82f2605f90e39c5665bdf69e1d6222bc425f8390bde67c1d414780c4e048c8dc0ea614a190375a1b215c8e8ff5f5098cd43a93d59be907a2258a74807ad4cd868c49acc40e389d45a1e7e7629e666972ed747c67b607b07f637c1f0b8021bbaa444a77faac92b771c0e1b19162ace64b5ce745892d3ce59f820cba2dc7").to_vec(), hex!("9e710b30bd2eab0352ddcc26417aa1945fd3802284b6ec6d4b3138fca93d003a58421ba947ecbc14c39e76572061105bbc568b809f8b23e74053dd98b58424e102ba5ac16f028714ec16a61522011fe6e16771ff80ed3e43ac278948816e8c9e8adda2dbeefe552702cf8144fd9b50e0b8db99bfcf80694abb8b23315ab79cdb22ca6826e867a9157415a832ad38f376dd819107d3ea80b9aee043e378f8313e68a6030679ccf3880fa1e7ab19b6244b5c262b7a152f004c5f03c716fb8fff3de61a883bb76adb34a2040080f15f37adeb10597dac54c2c65393277b2ca62aa27b2d16a23a78a4cc55ef15bb8008a0c609ab4888f02c2545c002153297c2641c5a7b4f3d8e25c634e721f80bea80b6617c764df278313c426c46961ccde8ee7a03f9007b74bc8bc6c49d1583cf7d801c9a4a3457ad4a568dd4c9abe231304689c9bec78be932ef0a2d30690ca428848059ef8bbe3a06c98792f41b3e0a6cdf1f157d9be85e12a7c1daf9c30f969daba4").to_vec(), hex!("9f0b3c252fcb29d88eff4f3de5de4476c3ffbf805254dc9131b269f3bbbb71f58a76a5034b2bc2faaab0d1cf45c3819dc6e69740804bc059c3d96f627e09a3b6c0f9851d902f84ac68006617289ac0b7d0a272b36280d97e2394406f94be4266da29b6fe7f3178059525eaf3c9b540064389af020bf180636959b43018d3ff8a55246d5874a16c93e85bd2a58c82ebfc1b54dd9b2a7d0780d3c1a10188200f31459d722f7efc693736d1a36af5644fd949b2e411d7942597800328f24d0485b9701135913a569f6ccbf261a05d055183abf3e4ecb4e4375b7c80f3229cd59de7b1e604f110cbcf814466f2d2973e9bdb6c106a662c576e0820e480b66b29cbd45f93602dbc9f1175407c6f69bd686d23dd22a8f0dfe9cff08843ad80ddb2d426c0c546068b429e77253e0a8a32e818151f5fc031e899a0f6acad157580ea7fb3cad8e128cc295194658016f4865ef37501e5759fb4f15cb2ecb689e85e80e9f3cac1b25842da7fbaf947952dc30329a1d19037ab21baed3851acbee629f6800d898e2a4a6ee9969a233c4741e4441c0fe393104b3cfc5adcf348f3ef20fc7480ac6c622536e593ae3c9d423a461faafc7abbf01ecb129e69d66f3382eaf484dc80c7ba3cadffaea5acd013dba51c96129ae93ea6cd45f3930e4302f5b100f6deae806f29f805e30029363e42381d6609ecb6837411bd6fd676c0a37621a3b5588101").to_vec() - ].into_iter().into(), + ], }; // Only interested in the parachain head verification part, we skip everything // else. @@ -219,7 +219,7 @@ mod relay_dip_did_proof_with_verified_relay_state_root { hex!("80ffff8003ff6c42a935aca27c743910dbb62aae8009854a21741d74080abb406c26b1f58084a7c1351a2986c948c9a111c955d0f8635e4bd305c24f9b6680405fdce955a180ed003737744c7fba94d0c2cb57f96e7bf3310d9c7a285ae789e25af8b79091b38017a0734a39f27a75f6f648bca2facca2381325b529d32bcf82e75aaf6b7d82dd8042e2e666a38ce9fdbe60164d0c3a351ce06c931931d2cd6650378c1ad691c21480d0cc4967746360ee3895a6937608d7f36674426928790cb8ca7426289ad74469804e8940ff6b30dfb0f92341c3a738f262bed9ca03de9b868eb99cfc282aa7786780acda22345d4597dfe6fd831509b944254e26a00fd56e77bc2cb780c0775a520a808c0dae720727cec94dbc853812332bfd6d5f2cc5e287bcd1e5efc530053dbd2280a16a8184b9f2e555d4991995fd479b1ee7b35653f2215f74f822436dbbb2331580984648137ae9c8ecf33f878cedffdba73fb4282ba3ec033102aa6d7442466517801132afeed824c180373b2450b32c72c84a21cdfddbe0f1bf8e76d6958963669580357f2107df0a82f2605f90e39c5665bdf69e1d6222bc425f8390bde67c1d414780c4e048c8dc0ea614a190375a1b215c8e8ff5f5098cd43a93d59be907a2258a74807ad4cd868c49acc40e389d45a1e7e7629e666972ed747c67b607b07f637c1f0b8021bbaa444a77faac92b771c0e1b19162ace64b5ce745892d3ce59f820cba2dc7").to_vec(), hex!("9e710b30bd2eab0352ddcc26417aa1945fd3802284b6ec6d4b3138fca93d003a58421ba947ecbc14c39e76572061105bbc568b809f8b23e74053dd98b58424e102ba5ac16f028714ec16a61522011fe6e16771ff80ed3e43ac278948816e8c9e8adda2dbeefe552702cf8144fd9b50e0b8db99bfcf80694abb8b23315ab79cdb22ca6826e867a9157415a832ad38f376dd819107d3ea80b9aee043e378f8313e68a6030679ccf3880fa1e7ab19b6244b5c262b7a152f004c5f03c716fb8fff3de61a883bb76adb34a2040080f15f37adeb10597dac54c2c65393277b2ca62aa27b2d16a23a78a4cc55ef15bb8008a0c609ab4888f02c2545c002153297c2641c5a7b4f3d8e25c634e721f80bea80b6617c764df278313c426c46961ccde8ee7a03f9007b74bc8bc6c49d1583cf7d801c9a4a3457ad4a568dd4c9abe231304689c9bec78be932ef0a2d30690ca428848059ef8bbe3a06c98792f41b3e0a6cdf1f157d9be85e12a7c1daf9c30f969daba4").to_vec(), hex!("9f0b3c252fcb29d88eff4f3de5de4476c3ffbf805254dc9131b269f3bbbb71f58a76a5034b2bc2faaab0d1cf45c3819dc6e69740804bc059c3d96f627e09a3b6c0f9851d902f84ac68006617289ac0b7d0a272b36280d97e2394406f94be4266da29b6fe7f3178059525eaf3c9b540064389af020bf180636959b43018d3ff8a55246d5874a16c93e85bd2a58c82ebfc1b54dd9b2a7d0780d3c1a10188200f31459d722f7efc693736d1a36af5644fd949b2e411d7942597800328f24d0485b9701135913a569f6ccbf261a05d055183abf3e4ecb4e4375b7c80f3229cd59de7b1e604f110cbcf814466f2d2973e9bdb6c106a662c576e0820e480b66b29cbd45f93602dbc9f1175407c6f69bd686d23dd22a8f0dfe9cff08843ad80ddb2d426c0c546068b429e77253e0a8a32e818151f5fc031e899a0f6acad157580ea7fb3cad8e128cc295194658016f4865ef37501e5759fb4f15cb2ecb689e85e80e9f3cac1b25842da7fbaf947952dc30329a1d19037ab21baed3851acbee629f6800d898e2a4a6ee9969a233c4741e4441c0fe393104b3cfc5adcf348f3ef20fc7480ac6c622536e593ae3c9d423a461faafc7abbf01ecb129e69d66f3382eaf484dc80c7ba3cadffaea5acd013dba51c96129ae93ea6cd45f3930e4302f5b100f6deae806f29f805e30029363e42381d6609ecb6837411bd6fd676c0a37621a3b5588101").to_vec() - ].into_iter().into(), + ], }; // Only interested in the parachain head verification part, we skip everything // else. @@ -250,7 +250,7 @@ mod relay_dip_did_proof_with_verified_relay_state_root { hex!("80ffff8003ff6c42a935aca27c743910dbb62aae8009854a21741d74080abb406c26b1f58084a7c1351a2986c948c9a111c955d0f8635e4bd305c24f9b6680405fdce955a180ed003737744c7fba94d0c2cb57f96e7bf3310d9c7a285ae789e25af8b79091b38017a0734a39f27a75f6f648bca2facca2381325b529d32bcf82e75aaf6b7d82dd8042e2e666a38ce9fdbe60164d0c3a351ce06c931931d2cd6650378c1ad691c21480d0cc4967746360ee3895a6937608d7f36674426928790cb8ca7426289ad74469804e8940ff6b30dfb0f92341c3a738f262bed9ca03de9b868eb99cfc282aa7786780acda22345d4597dfe6fd831509b944254e26a00fd56e77bc2cb780c0775a520a808c0dae720727cec94dbc853812332bfd6d5f2cc5e287bcd1e5efc530053dbd2280a16a8184b9f2e555d4991995fd479b1ee7b35653f2215f74f822436dbbb2331580984648137ae9c8ecf33f878cedffdba73fb4282ba3ec033102aa6d7442466517801132afeed824c180373b2450b32c72c84a21cdfddbe0f1bf8e76d6958963669580357f2107df0a82f2605f90e39c5665bdf69e1d6222bc425f8390bde67c1d414780c4e048c8dc0ea614a190375a1b215c8e8ff5f5098cd43a93d59be907a2258a74807ad4cd868c49acc40e389d45a1e7e7629e666972ed747c67b607b07f637c1f0b8021bbaa444a77faac92b771c0e1b19162ace64b5ce745892d3ce59f820cba2dc7").to_vec(), hex!("9e710b30bd2eab0352ddcc26417aa1945fd3802284b6ec6d4b3138fca93d003a58421ba947ecbc14c39e76572061105bbc568b809f8b23e74053dd98b58424e102ba5ac16f028714ec16a61522011fe6e16771ff80ed3e43ac278948816e8c9e8adda2dbeefe552702cf8144fd9b50e0b8db99bfcf80694abb8b23315ab79cdb22ca6826e867a9157415a832ad38f376dd819107d3ea80b9aee043e378f8313e68a6030679ccf3880fa1e7ab19b6244b5c262b7a152f004c5f03c716fb8fff3de61a883bb76adb34a2040080f15f37adeb10597dac54c2c65393277b2ca62aa27b2d16a23a78a4cc55ef15bb8008a0c609ab4888f02c2545c002153297c2641c5a7b4f3d8e25c634e721f80bea80b6617c764df278313c426c46961ccde8ee7a03f9007b74bc8bc6c49d1583cf7d801c9a4a3457ad4a568dd4c9abe231304689c9bec78be932ef0a2d30690ca428848059ef8bbe3a06c98792f41b3e0a6cdf1f157d9be85e12a7c1daf9c30f969daba4").to_vec(), hex!("9f0b3c252fcb29d88eff4f3de5de4476c3ffbf805254dc9131b269f3bbbb71f58a76a5034b2bc2faaab0d1cf45c3819dc6e69740804bc059c3d96f627e09a3b6c0f9851d902f84ac68006617289ac0b7d0a272b36280d97e2394406f94be4266da29b6fe7f3178059525eaf3c9b540064389af020bf180636959b43018d3ff8a55246d5874a16c93e85bd2a58c82ebfc1b54dd9b2a7d0780d3c1a10188200f31459d722f7efc693736d1a36af5644fd949b2e411d7942597800328f24d0485b9701135913a569f6ccbf261a05d055183abf3e4ecb4e4375b7c80f3229cd59de7b1e604f110cbcf814466f2d2973e9bdb6c106a662c576e0820e480b66b29cbd45f93602dbc9f1175407c6f69bd686d23dd22a8f0dfe9cff08843ad80ddb2d426c0c546068b429e77253e0a8a32e818151f5fc031e899a0f6acad157580ea7fb3cad8e128cc295194658016f4865ef37501e5759fb4f15cb2ecb689e85e80e9f3cac1b25842da7fbaf947952dc30329a1d19037ab21baed3851acbee629f6800d898e2a4a6ee9969a233c4741e4441c0fe393104b3cfc5adcf348f3ef20fc7480ac6c622536e593ae3c9d423a461faafc7abbf01ecb129e69d66f3382eaf484dc80c7ba3cadffaea5acd013dba51c96129ae93ea6cd45f3930e4302f5b100f6deae806f29f805e30029363e42381d6609ecb6837411bd6fd676c0a37621a3b5588101").to_vec() - ].into_iter().into(), + ], }; let proof = RelayDipDidProofWithVerifiedRelayStateRoot::<_, _, (), (), _, (), ()>::with_relay_state_root_and_provider_head_proof(relay_state_root, provider_head_proof); assert_err!( @@ -277,7 +277,7 @@ mod relay_dip_did_proof_with_verified_relay_state_root { hex!("80ffff8003ff6c42a935aca27c743910dbb62aae8009854a21741d74080abb406c26b1f58084a7c1351a2986c948c9a111c955d0f8635e4bd305c24f9b6680405fdce955a180ed003737744c7fba94d0c2cb57f96e7bf3310d9c7a285ae789e25af8b79091b38017a0734a39f27a75f6f648bca2facca2381325b529d32bcf82e75aaf6b7d82dd8042e2e666a38ce9fdbe60164d0c3a351ce06c931931d2cd6650378c1ad691c21480d0cc4967746360ee3895a6937608d7f36674426928790cb8ca7426289ad74469804e8940ff6b30dfb0f92341c3a738f262bed9ca03de9b868eb99cfc282aa7786780acda22345d4597dfe6fd831509b944254e26a00fd56e77bc2cb780c0775a520a808c0dae720727cec94dbc853812332bfd6d5f2cc5e287bcd1e5efc530053dbd2280a16a8184b9f2e555d4991995fd479b1ee7b35653f2215f74f822436dbbb2331580984648137ae9c8ecf33f878cedffdba73fb4282ba3ec033102aa6d7442466517801132afeed824c180373b2450b32c72c84a21cdfddbe0f1bf8e76d6958963669580357f2107df0a82f2605f90e39c5665bdf69e1d6222bc425f8390bde67c1d414780c4e048c8dc0ea614a190375a1b215c8e8ff5f5098cd43a93d59be907a2258a74807ad4cd868c49acc40e389d45a1e7e7629e666972ed747c67b607b07f637c1f0b8021bbaa444a77faac92b771c0e1b19162ace64b5ce745892d3ce59f820cba2dc7").to_vec(), hex!("9e710b30bd2eab0352ddcc26417aa1945fd3802284b6ec6d4b3138fca93d003a58421ba947ecbc14c39e76572061105bbc568b809f8b23e74053dd98b58424e102ba5ac16f028714ec16a61522011fe6e16771ff80ed3e43ac278948816e8c9e8adda2dbeefe552702cf8144fd9b50e0b8db99bfcf80694abb8b23315ab79cdb22ca6826e867a9157415a832ad38f376dd819107d3ea80b9aee043e378f8313e68a6030679ccf3880fa1e7ab19b6244b5c262b7a152f004c5f03c716fb8fff3de61a883bb76adb34a2040080f15f37adeb10597dac54c2c65393277b2ca62aa27b2d16a23a78a4cc55ef15bb8008a0c609ab4888f02c2545c002153297c2641c5a7b4f3d8e25c634e721f80bea80b6617c764df278313c426c46961ccde8ee7a03f9007b74bc8bc6c49d1583cf7d801c9a4a3457ad4a568dd4c9abe231304689c9bec78be932ef0a2d30690ca428848059ef8bbe3a06c98792f41b3e0a6cdf1f157d9be85e12a7c1daf9c30f969daba4").to_vec(), hex!("9f0b3c252fcb29d88eff4f3de5de4476c3ffbf805254dc9131b269f3bbbb71f58a76a5034b2bc2faaab0d1cf45c3819dc6e69740804bc059c3d96f627e09a3b6c0f9851d902f84ac68006617289ac0b7d0a272b36280d97e2394406f94be4266da29b6fe7f3178059525eaf3c9b540064389af020bf180636959b43018d3ff8a55246d5874a16c93e85bd2a58c82ebfc1b54dd9b2a7d0780d3c1a10188200f31459d722f7efc693736d1a36af5644fd949b2e411d7942597800328f24d0485b9701135913a569f6ccbf261a05d055183abf3e4ecb4e4375b7c80f3229cd59de7b1e604f110cbcf814466f2d2973e9bdb6c106a662c576e0820e480b66b29cbd45f93602dbc9f1175407c6f69bd686d23dd22a8f0dfe9cff08843ad80ddb2d426c0c546068b429e77253e0a8a32e818151f5fc031e899a0f6acad157580ea7fb3cad8e128cc295194658016f4865ef37501e5759fb4f15cb2ecb689e85e80e9f3cac1b25842da7fbaf947952dc30329a1d19037ab21baed3851acbee629f6800d898e2a4a6ee9969a233c4741e4441c0fe393104b3cfc5adcf348f3ef20fc7480ac6c622536e593ae3c9d423a461faafc7abbf01ecb129e69d66f3382eaf484dc80c7ba3cadffaea5acd013dba51c96129ae93ea6cd45f3930e4302f5b100f6deae806f29f805e30029363e42381d6609ecb6837411bd6fd676c0a37621a3b5588101").to_vec() - ].into_iter().into(), + ], }; let proof = RelayDipDidProofWithVerifiedRelayStateRoot::<_, _, (), (), _, (), ()>::with_relay_state_root_and_provider_head_proof(relay_state_root, provider_head_proof); assert_err!( @@ -304,7 +304,7 @@ mod relay_dip_did_proof_with_verified_relay_state_root { hex!("80ffff8003ff6c42a935aca27c743910dbb62aae8009854a21741d74080abb406c26b1f58084a7c1351a2986c948c9a111c955d0f8635e4bd305c24f9b6680405fdce955a180ed003737744c7fba94d0c2cb57f96e7bf3310d9c7a285ae789e25af8b79091b38017a0734a39f27a75f6f648bca2facca2381325b529d32bcf82e75aaf6b7d82dd8042e2e666a38ce9fdbe60164d0c3a351ce06c931931d2cd6650378c1ad691c21480d0cc4967746360ee3895a6937608d7f36674426928790cb8ca7426289ad74469804e8940ff6b30dfb0f92341c3a738f262bed9ca03de9b868eb99cfc282aa7786780acda22345d4597dfe6fd831509b944254e26a00fd56e77bc2cb780c0775a520a808c0dae720727cec94dbc853812332bfd6d5f2cc5e287bcd1e5efc530053dbd2280a16a8184b9f2e555d4991995fd479b1ee7b35653f2215f74f822436dbbb2331580984648137ae9c8ecf33f878cedffdba73fb4282ba3ec033102aa6d7442466517801132afeed824c180373b2450b32c72c84a21cdfddbe0f1bf8e76d6958963669580357f2107df0a82f2605f90e39c5665bdf69e1d6222bc425f8390bde67c1d414780c4e048c8dc0ea614a190375a1b215c8e8ff5f5098cd43a93d59be907a2258a74807ad4cd868c49acc40e389d45a1e7e7629e666972ed747c67b607b07f637c1f0b8021bbaa444a77faac92b771c0e1b19162ace64b5ce745892d3ce59f820cba2dc7").to_vec(), hex!("9e710b30bd2eab0352ddcc26417aa1945fd3802284b6ec6d4b3138fca93d003a58421ba947ecbc14c39e76572061105bbc568b809f8b23e74053dd98b58424e102ba5ac16f028714ec16a61522011fe6e16771ff80ed3e43ac278948816e8c9e8adda2dbeefe552702cf8144fd9b50e0b8db99bfcf80694abb8b23315ab79cdb22ca6826e867a9157415a832ad38f376dd819107d3ea80b9aee043e378f8313e68a6030679ccf3880fa1e7ab19b6244b5c262b7a152f004c5f03c716fb8fff3de61a883bb76adb34a2040080f15f37adeb10597dac54c2c65393277b2ca62aa27b2d16a23a78a4cc55ef15bb8008a0c609ab4888f02c2545c002153297c2641c5a7b4f3d8e25c634e721f80bea80b6617c764df278313c426c46961ccde8ee7a03f9007b74bc8bc6c49d1583cf7d801c9a4a3457ad4a568dd4c9abe231304689c9bec78be932ef0a2d30690ca428848059ef8bbe3a06c98792f41b3e0a6cdf1f157d9be85e12a7c1daf9c30f969daba4").to_vec(), // hex!("9f0b3c252fcb29d88eff4f3de5de4476c3ffbf805254dc9131b269f3bbbb71f58a76a5034b2bc2faaab0d1cf45c3819dc6e69740804bc059c3d96f627e09a3b6c0f9851d902f84ac68006617289ac0b7d0a272b36280d97e2394406f94be4266da29b6fe7f3178059525eaf3c9b540064389af020bf180636959b43018d3ff8a55246d5874a16c93e85bd2a58c82ebfc1b54dd9b2a7d0780d3c1a10188200f31459d722f7efc693736d1a36af5644fd949b2e411d7942597800328f24d0485b9701135913a569f6ccbf261a05d055183abf3e4ecb4e4375b7c80f3229cd59de7b1e604f110cbcf814466f2d2973e9bdb6c106a662c576e0820e480b66b29cbd45f93602dbc9f1175407c6f69bd686d23dd22a8f0dfe9cff08843ad80ddb2d426c0c546068b429e77253e0a8a32e818151f5fc031e899a0f6acad157580ea7fb3cad8e128cc295194658016f4865ef37501e5759fb4f15cb2ecb689e85e80e9f3cac1b25842da7fbaf947952dc30329a1d19037ab21baed3851acbee629f6800d898e2a4a6ee9969a233c4741e4441c0fe393104b3cfc5adcf348f3ef20fc7480ac6c622536e593ae3c9d423a461faafc7abbf01ecb129e69d66f3382eaf484dc80c7ba3cadffaea5acd013dba51c96129ae93ea6cd45f3930e4302f5b100f6deae806f29f805e30029363e42381d6609ecb6837411bd6fd676c0a37621a3b5588101").to_vec() - ].into_iter().into(), + ], }; let proof = RelayDipDidProofWithVerifiedRelayStateRoot::<_, _, (), (), _, (), ()>::with_relay_state_root_and_provider_head_proof(relay_state_root, provider_head_proof); assert_err!( diff --git a/crates/kilt-dip-primitives/src/utils.rs b/crates/kilt-dip-primitives/src/utils.rs index faadedac50..1e5c37b534 100644 --- a/crates/kilt-dip-primitives/src/utils.rs +++ b/crates/kilt-dip-primitives/src/utils.rs @@ -16,77 +16,9 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org -use parity_scale_codec::{Decode, Encode}; -use scale_info::TypeInfo; -use sp_std::{fmt::Debug, vec::Vec}; - /// The output of a type implementing the [`sp_runtime::traits::Hash`] trait. pub type OutputOf = ::Output; -/// The vector of vectors that implements a statically-configured maximum length -/// without requiring const generics, used in benchmarking worst cases. -#[derive(Encode, Decode, PartialEq, Eq, PartialOrd, Ord, Debug, TypeInfo, Clone)] -pub struct BoundedBlindedValue(Vec>); - -impl BoundedBlindedValue { - pub fn into_inner(self) -> Vec> { - self.0 - } -} - -impl From for BoundedBlindedValue -where - C: Iterator>, -{ - fn from(value: C) -> Self { - Self(value.into_iter().collect()) - } -} - -impl sp_std::ops::Deref for BoundedBlindedValue { - type Target = Vec>; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl sp_std::ops::DerefMut for BoundedBlindedValue { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl IntoIterator for BoundedBlindedValue { - type IntoIter = > as IntoIterator>::IntoIter; - type Item = > as IntoIterator>::Item; - - fn into_iter(self) -> Self::IntoIter { - self.0.into_iter() - } -} - -#[cfg(feature = "runtime-benchmarks")] -impl kilt_support::traits::GetWorstCase for BoundedBlindedValue -where - T: Default + Clone, -{ - type Output = Self; - fn worst_case(_context: Context) -> Self::Output { - Self(sp_std::vec![sp_std::vec![T::default(); 128]; 64]) - } -} - -#[cfg(any(test, feature = "runtime-benchmarks"))] -impl Default for BoundedBlindedValue -where - T: Default + Clone, -{ - fn default() -> Self { - Self(sp_std::vec![sp_std::vec![T::default(); 128]; 64]) - } -} - pub(crate) use calculate_parachain_head_storage_key::*; mod calculate_parachain_head_storage_key { use parity_scale_codec::Encode; diff --git a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs index 37061bed1b..6bd0cbd7dc 100644 --- a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs @@ -104,6 +104,7 @@ impl< /// Versioned proof verifier. For version-specific description, refer to each /// verifier's documentation. pub struct KiltVersionedParachainVerifier< + ConsumerRuntime, RelaychainRuntime, RelaychainStateRootStore, const KILT_PARA_ID: u32, @@ -119,6 +120,7 @@ pub struct KiltVersionedParachainVerifier< const MAX_DID_MERKLE_LEAVES_REVEALED: u32 = 64, >( PhantomData<( + ConsumerRuntime, RelaychainRuntime, RelaychainStateRootStore, KiltRuntime, @@ -144,6 +146,7 @@ impl< const MAX_DID_MERKLE_LEAVES_REVEALED: u32, > IdentityProofVerifier for KiltVersionedParachainVerifier< + ConsumerRuntime, RelaychainRuntime, RelaychainStateRootStore, KILT_PARA_ID, @@ -206,6 +209,7 @@ impl< ) -> Result { match proof { VersionedDipParachainStateProof::V0(v0_proof) => kilt_support::traits::GetWorstCase + for KiltVersionedParachainVerifier< + ConsumerRuntime, + RelaychainRuntime, + RelaychainStateRootStore, + KILT_PARA_ID, + KiltRuntime, + DidCallVerifier, + SignedExtra, + MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT, + MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE, + MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT, + MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE, + MAX_DID_MERKLE_PROOF_LEAVE_COUNT, + MAX_DID_MERKLE_PROOF_LEAVE_SIZE, + MAX_DID_MERKLE_LEAVES_REVEALED, + > where + ConsumerRuntime: pallet_dip_consumer::Config, +{ + type Output = pallet_dip_consumer::benchmarking::WorstCaseOf; + + fn worst_case(context: ()) -> Self::Output { + // TODO: Update this. + unimplemented!() + } +} diff --git a/crates/kilt-dip-primitives/src/verifier/parachain/v0/mock.rs b/crates/kilt-dip-primitives/src/verifier/parachain/v0/mock.rs index 4198f46495..b2eaba6e45 100644 --- a/crates/kilt-dip-primitives/src/verifier/parachain/v0/mock.rs +++ b/crates/kilt-dip-primitives/src/verifier/parachain/v0/mock.rs @@ -128,6 +128,7 @@ pub(crate) const MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32 = 64; pub(crate) const MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32 = 1024; pub(crate) const MAX_DID_MERKLE_LEAVES_REVEALED: u32 = 64; pub type Verifier = ParachainVerifier< + TestRuntime, RococoRuntime, RelayStateRootsViaRelayStorePallet, 2_000, @@ -203,16 +204,16 @@ pub(crate) fn cross_chain_proof_with_authentication_key_and_web3_name() -> Parac hex!("80ffff80e4b470c8e610803be35fb30c2297c88daefe2fb9984db06c45b68c441d989f6680fce4c77e35ddc74b02c611a5436c98b6d2fec67ef1d9eb0c706ac06570913aa580594aafb93d9618327a4d0723e4e6ae1c34de455716c3205e665493a88303e3c4809d3100527438cdc0c7b8a19b932fc76e25d7e22b5ef9ca0a0dbcdfeefec9e9238085ab5177d435d816c3143c5a7ffc4bd8929328ec3ec9a8fb6b8ad1ff9eaf08aa80739be177872c5beb6da57440ce6941849b20f0bc344170a48312fa761fa45b3280275ba9412df014f6c2bd421a42b64052417d01defc479406b157ef5733dbf280805b682132c52908705526057f73ab7fccab4af6d72a9805634dd8d3cc53f130d180c2d44d371e5fc1f50227d7491ad65ad049630361cefb4ab1844831237609f08380134bd63183fb7e62530dd82964c89077ec083b5117f24842f8453f6f9fe3d83080afddf55b94871699b66eb154e0b6495121e88337c7b80f86058ddf54ad9e25c3804b438f963950b0230a6bdbe6664bf5a492d1c05a62343dabf14b377024995a1880490ee6b2b446a32bf0bd68d8cdc905688bdc036a5f349ee84deb700f0bcc95a9803b225accc70e19d48fd9b2e3fdec7b185a451556cf50362b056951abf2df89f4806bfdbbf0e0bedcb993b65c9cea1e929a56d78a3b7bc53d1b7ca6fc488e2295ee80d6513cd4e03e5d4dfda76ba48fefe60422081e4f885128b01400ae254fbc48a1").to_vec(), hex!("9e710b30bd2eab0352ddcc26417aa1945f43803b3441f15daa8a53147d69c48eac75356fab581febbb8030520b248c5942a148801f09f47c0d4767dc1ff9ae54ba8f174d9e5fa06b8242368a39481f5fe5a078f3802e2e0716043a02f2f29fdd52922704af194b98545ce5ca832255e8ec41bcdb6480935f8561d684b40c45e36088c7daa1575cc60b54080e3e023ae43db4092287ba505f0e7b9012096b41c4eb3aaf947f6ea4290800004c5f03c716fb8fff3de61a883bb76adb34a204008092e3fee779c209e5562dd0679d5fcb3876ce9ea0b126e14f1f801a50d8c1d8a44c5f0f4993f016e2d2f8e5f43be7bb259486040080cfad4870b13343cea64432d5dc64a59f0a5c6da43817f25d8a72a3900c9cee17").to_vec(), hex!("9f0b3c252fcb29d88eff4f3de5de4476c350008072c23a8d4d26e772d0e0e0877b3fa481025ba0f8695a5537b7771587bbe5ca60808e11df642368fb86db2a9cd579f9a3bedf50546a1a325f3c4052c037683e3656").to_vec(), - ].into_iter().into() }, dip_commitment_proof: DipCommitmentStateProof(vec![ + ] }, dip_commitment_proof: DipCommitmentStateProof(vec![ hex!("7f440bf19e4ed2927982e234d989e812f3f32da9da135714ded7366de71f9a6bd6620f03ac92421fea3539e7b80a01bc14cc200265029563162101a12dfa1fa4ab9a00008032e9f6961b6f2915ebb3b3fff7ecdee4d11c1dc7c326c7890cd098498da51df1").to_vec(), hex!("800c8080da28793d083b197f8d92fc3e77f5064436f1d8eea0fbea56ddb936aba6544500806105b92c7c2c540155c67a2782607dace59d3093432f81564d5ada8bff4be04180b2aafe11c416356c5a97e233670962facb2a18944c3bdc4b9e27f1fa67a5bafe").to_vec(), hex!("80ffff80353e4d164b13c87910044f1b4e76277e404a0ab46a7cd6c33a65aaadc2375ba88007b1390da34b4dce1328430fd924a6e193517a8148dd70a912c0dc2f7f8d2d4c80ade4fe11f1179c11ffdcbfa22755ecb2b1a904b42a8e61838ac5d61b50527e5180e12d12e0e160241a582c5068f11f66364c4421b3444fc3a69da31576a46e93d180e32fd413c5f3f35cf140619d01c260348df629c9581ddb2ffa3ed3a4454611bc80e73af1cd43b13af0d4726e252583bfc4b0e4f159cacfbedeb14669fec54f16d28014e3e0704c9a07636322335a3c663ec9fd9df8b7bf71d6e8183fefecfbfe0e508089e0d83f324b3a94a57e6c9ca7517f7829acf273e063c3b86e876f5f5000dfad808237efee33d7cbf612b36cf8e72b49b7a7ee4d48085dcaf5ffa8b163261a495b80591a4868cf7eafa20b043d709923044e17e7cde25ee7a35b9732af83d346ddf8808ddf2174553f85bc1836060e6ed175ba06730cecc706a30493e8bcfd9823eeca80e36ae624a00ef6eed407fd4d97dfe9980549cc00adeb2f9454c79d73032e10e48085c95ba8d0c7c8734e14270f873eefada04c1c71d6d99d9236772f890c8a74fa80f395b7003a2eb1e39c624b9a707a6cb58c3cb6997932fc80662ae19c785a91f580b5e5172489541dfc581e116554b63de15fddf38ffed2b109394749c20b8f6ce3805256998e8d08896289d5756f1f96ec6d8f4be237654682f91f559a511bf50a75").to_vec(), hex!("9e75edf06348b4330d1e88564111cb3d3000505f0e7b9012096b41c4eb3aaf947f6ea429080000801109e5a50d25358a1bcff63c57103c8eb73b80885bb28ba9b666503b8669953e").to_vec(), - ].into_iter().into()), dip_proof: crate::DidMerkleProof { blinded: vec![ + ]), dip_proof: crate::DidMerkleProof { blinded: vec![ hex!("8022000000").to_vec(), hex!("7f04069d06a63af2662632789148708798b64f753eb007f162a641efbbe572f20e33010000").to_vec(), hex!("6f0c623964373239616630626365346664303738313630393800").to_vec(), - ].into_iter().into(), revealed: vec![ + ], revealed: vec![ RevealedDidKey { id: hex!("169d06a63af2662632789148708798b64f753eb007f162a641efbbe572f20e33").into(), relationship: DidVerificationKeyRelationship::Authentication.into(), diff --git a/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs b/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs index d0e1fc80ff..8a7ef118c2 100644 --- a/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs @@ -70,6 +70,7 @@ mod tests; /// * `MAX_DID_MERKLE_LEAVES_REVEALED`: The maximum number of leaves that can be /// revealed as part of the DID Merkle proof. pub struct ParachainVerifier< + ConsumerRuntime, RelaychainRuntime, RelaychainStateRootStore, const KILT_PARA_ID: u32, @@ -85,6 +86,7 @@ pub struct ParachainVerifier< const MAX_DID_MERKLE_LEAVES_REVEALED: u32, >( PhantomData<( + ConsumerRuntime, RelaychainRuntime, RelaychainStateRootStore, KiltRuntime, @@ -110,6 +112,7 @@ impl< const MAX_DID_MERKLE_LEAVES_REVEALED: u32, > IdentityProofVerifier for ParachainVerifier< + ConsumerRuntime, RelaychainRuntime, RelaychainStateRootStore, KILT_PARA_ID, @@ -273,3 +276,46 @@ impl< Ok(revealed_did_info) } } + +#[cfg(feature = "runtime-benchmarks")] +impl< + ConsumerRuntime, + RelaychainRuntime, + RelaychainStateRootStore, + const KILT_PARA_ID: u32, + KiltRuntime, + DidCallVerifier, + SignedExtra, + const MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32, + const MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32, + const MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32, + const MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE: u32, + const MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32, + const MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32, + const MAX_DID_MERKLE_LEAVES_REVEALED: u32, + > kilt_support::traits::GetWorstCase + for ParachainVerifier< + ConsumerRuntime, + RelaychainRuntime, + RelaychainStateRootStore, + KILT_PARA_ID, + KiltRuntime, + DidCallVerifier, + SignedExtra, + MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT, + MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE, + MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT, + MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE, + MAX_DID_MERKLE_PROOF_LEAVE_COUNT, + MAX_DID_MERKLE_PROOF_LEAVE_SIZE, + MAX_DID_MERKLE_LEAVES_REVEALED, + > where + ConsumerRuntime: pallet_dip_consumer::Config, +{ + type Output = pallet_dip_consumer::benchmarking::WorstCaseOf; + + // TODO: Change with proper proof. + fn worst_case(context: ()) -> Self::Output { + unimplemented!() + } +} diff --git a/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs b/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs index d1909153a8..a09cbb40ed 100644 --- a/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs @@ -70,6 +70,7 @@ pub enum VersionedRelaychainStateProof< /// Versioned proof verifier. For version-specific description, refer to each /// verifier's documentation. pub struct KiltVersionedRelaychainVerifier< + ConsumerRuntime, ConsumerBlockHashStore, const KILT_PARA_ID: u32, KiltRuntime, @@ -82,7 +83,16 @@ pub struct KiltVersionedRelaychainVerifier< const MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32 = 64, const MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32 = 128, const MAX_DID_MERKLE_LEAVES_REVEALED: u32 = 64, ->(#[allow(clippy::type_complexity)] PhantomData<(ConsumerBlockHashStore, KiltRuntime, DidCallVerifier, SignedExtra)>); +>( + #[allow(clippy::type_complexity)] + PhantomData<( + ConsumerRuntime, + ConsumerBlockHashStore, + KiltRuntime, + DidCallVerifier, + SignedExtra, + )>, +); impl< ConsumerRuntime, @@ -100,6 +110,7 @@ impl< const MAX_DID_MERKLE_LEAVES_REVEALED: u32, > IdentityProofVerifier for KiltVersionedRelaychainVerifier< + ConsumerRuntime, ConsumerBlockHashStore, KILT_PARA_ID, KiltRuntime, @@ -160,6 +171,7 @@ impl< ) -> Result { match proof { VersionedRelaychainStateProof::V0(v0_proof) => kilt_support::traits::GetWorstCase + for KiltVersionedRelaychainVerifier< + ConsumerRuntime, + ConsumerBlockHashStore, + KILT_PARA_ID, + KiltRuntime, + DidCallVerifier, + SignedExtra, + MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT, + MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE, + MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT, + MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE, + MAX_DID_MERKLE_PROOF_LEAVE_COUNT, + MAX_DID_MERKLE_PROOF_LEAVE_SIZE, + MAX_DID_MERKLE_LEAVES_REVEALED, + > where + ConsumerRuntime: pallet_dip_consumer::Config, +{ + type Output = pallet_dip_consumer::benchmarking::WorstCaseOf; + + fn worst_case(context: ()) -> Self::Output { + // TODO: Update this. + unimplemented!() + } +} diff --git a/crates/kilt-dip-primitives/src/verifier/relaychain/v0/mod.rs b/crates/kilt-dip-primitives/src/verifier/relaychain/v0/mod.rs index 0dc7af8ac3..91ec65b072 100644 --- a/crates/kilt-dip-primitives/src/verifier/relaychain/v0/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/relaychain/v0/mod.rs @@ -63,6 +63,7 @@ use crate::{ /// * `MAX_DID_MERKLE_PROOF_LEAVE_SIZE`: The maximum number of leaves that can /// be revealed as part of the DID Merkle proof. pub struct RelaychainVerifier< + ConsumerRuntime, ConsumerBlockHashStore, const KILT_PARA_ID: u32, KiltRuntime, @@ -75,7 +76,16 @@ pub struct RelaychainVerifier< const MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32, const MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32, const MAX_DID_MERKLE_LEAVES_REVEALED: u32, ->(#[allow(clippy::type_complexity)] PhantomData<(ConsumerBlockHashStore, KiltRuntime, DidCallVerifier, SignedExtra)>); +>( + #[allow(clippy::type_complexity)] + PhantomData<( + ConsumerRuntime, + ConsumerBlockHashStore, + KiltRuntime, + DidCallVerifier, + SignedExtra, + )>, +); impl< ConsumerRuntime, @@ -93,6 +103,7 @@ impl< const MAX_DID_MERKLE_LEAVES_REVEALED: u32, > IdentityProofVerifier for RelaychainVerifier< + ConsumerRuntime, ConsumerBlockHashStore, KILT_PARA_ID, KiltRuntime, @@ -250,3 +261,44 @@ impl< Ok(revealed_did_info) } } + +#[cfg(feature = "runtime-benchmarks")] +impl< + ConsumerRuntime, + ConsumerBlockHashStore, + const KILT_PARA_ID: u32, + KiltRuntime, + DidCallVerifier, + SignedExtra, + const MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32, + const MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32, + const MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32, + const MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE: u32, + const MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32, + const MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32, + const MAX_DID_MERKLE_LEAVES_REVEALED: u32, + > kilt_support::traits::GetWorstCase + for RelaychainVerifier< + ConsumerRuntime, + ConsumerBlockHashStore, + KILT_PARA_ID, + KiltRuntime, + DidCallVerifier, + SignedExtra, + MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT, + MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE, + MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT, + MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE, + MAX_DID_MERKLE_PROOF_LEAVE_COUNT, + MAX_DID_MERKLE_PROOF_LEAVE_SIZE, + MAX_DID_MERKLE_LEAVES_REVEALED, + > where + ConsumerRuntime: pallet_dip_consumer::Config, +{ + type Output = pallet_dip_consumer::benchmarking::WorstCaseOf; + + // TODO: Change with proper proof. + fn worst_case(context: ()) -> Self::Output { + unimplemented!() + } +} diff --git a/dip-template/runtimes/dip-consumer/src/dip.rs b/dip-template/runtimes/dip-consumer/src/dip.rs index fa7a97516b..6db73ae7c2 100644 --- a/dip-template/runtimes/dip-consumer/src/dip.rs +++ b/dip-template/runtimes/dip-consumer/src/dip.rs @@ -38,6 +38,7 @@ pub type MerkleProofVerifierOutput = , 2_000, diff --git a/pallets/pallet-dip-consumer/src/mock.rs b/pallets/pallet-dip-consumer/src/mock.rs index e47a8655f5..c83ebb897d 100644 --- a/pallets/pallet-dip-consumer/src/mock.rs +++ b/pallets/pallet-dip-consumer/src/mock.rs @@ -26,12 +26,8 @@ use frame_support::{ traits::{ConstU16, ConstU32, ConstU64, Contains, Currency, Everything}, }; use frame_system::{mocking::MockBlock, EnsureSigned}; -use kilt_support::traits::GetWorstCase; -use crate::{ - benchmarking::WorstCaseOf, traits::IdentityProofVerifier, Config, DipOrigin, EnsureDipOrigin, IdentityEntries, - RuntimeCallOf, -}; +use crate::{traits::IdentityProofVerifier, Config, DipOrigin, EnsureDipOrigin, IdentityEntries, RuntimeCallOf}; // This mock is used both for benchmarks and unit tests. // For benchmarks, the `system::remark` call must be allowed to be dispatched, @@ -139,11 +135,11 @@ impl IdentityProofVerifier for BooleanProofVerifier { } #[cfg(feature = "runtime-benchmarks")] -impl GetWorstCase for BooleanProofVerifier { - type Output = WorstCaseOf; +impl kilt_support::traits::GetWorstCase for BooleanProofVerifier { + type Output = crate::benchmarking::WorstCaseOf; fn worst_case(_context: ()) -> Self::Output { - WorstCaseOf { + crate::benchmarking::WorstCaseOf { call: frame_system::Call::remark { remark: b"Hello!".to_vec(), } diff --git a/runtimes/common/src/dip/merkle/v0/mod.rs b/runtimes/common/src/dip/merkle/v0/mod.rs index fdb66b959b..591c7e43de 100644 --- a/runtimes/common/src/dip/merkle/v0/mod.rs +++ b/runtimes/common/src/dip/merkle/v0/mod.rs @@ -313,10 +313,7 @@ where Ok(CompleteMerkleProof { root, - proof: DidMerkleProofOf::::new( - proof.into_iter().into(), - leaves.into_iter().flatten().collect::>(), - ), + proof: DidMerkleProofOf::::new(proof, leaves.into_iter().flatten().collect::>()), }) } From 2b5e2688baa6832092016d8bf9e8f2f9544babd9 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Tue, 5 Mar 2024 08:25:00 +0100 Subject: [PATCH 04/14] Remove benchmark-specific logic from verifier --- Cargo.lock | 1 - crates/kilt-dip-primitives/Cargo.toml | 1 - .../merkle_proofs/v0/dip_subject_state/mod.rs | 19 ++----- .../merkle_proofs/v0/provider_state/mod.rs | 53 +++++-------------- .../src/verifier/parachain/mod.rs | 38 +------------ .../src/verifier/parachain/v0/mod.rs | 2 +- .../src/verifier/relaychain/mod.rs | 2 +- .../src/verifier/relaychain/v0/mod.rs | 2 +- 8 files changed, 21 insertions(+), 97 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dbfc9d0736..799563add7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4621,7 +4621,6 @@ dependencies = [ name = "kilt-dip-primitives" version = "1.12.0-dev" dependencies = [ - "cfg-if", "cumulus-pallet-parachain-system", "cumulus-primitives-core", "did", diff --git a/crates/kilt-dip-primitives/Cargo.toml b/crates/kilt-dip-primitives/Cargo.toml index 78d0fa948a..9e39c4c33c 100644 --- a/crates/kilt-dip-primitives/Cargo.toml +++ b/crates/kilt-dip-primitives/Cargo.toml @@ -14,7 +14,6 @@ version.workspace = true # External dependencies hash-db.workspace = true log.workspace = true -cfg-if.workspace = true # Internal dependencies did.workspace = true diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/dip_subject_state/mod.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/dip_subject_state/mod.rs index 8206077320..df2e492574 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/dip_subject_state/mod.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/dip_subject_state/mod.rs @@ -20,6 +20,7 @@ use did::{ did_details::{DidPublicKey, DidPublicKeyDetails}, DidSignature, }; +use frame_support::ensure; use sp_core::ConstU32; use sp_runtime::{traits::SaturatedConversion, BoundedVec}; use sp_std::vec::Vec; @@ -106,13 +107,7 @@ impl< >, Error, > { - cfg_if::cfg_if! { - if #[cfg(feature = "runtime-benchmarks")] { - let _ = self.signature.valid_until >= *block_number; - } else { - frame_support::ensure!(self.signature.valid_until >= *block_number, Error::InvalidSignatureTime); - } - } + ensure!(self.signature.valid_until >= *block_number, Error::InvalidSignatureTime); Ok(DipRevealedDetailsAndVerifiedDidSignatureFreshness { revealed_leaves: self.revealed_leaves, signature: self.signature.signature, @@ -214,15 +209,7 @@ impl< .map(|(index, _)| u32::saturated_from(index)) .collect(); - if signing_leaves_indices.is_empty() { - cfg_if::cfg_if! { - if #[cfg(feature = "runtime-benchmarks")] { - return Ok(DipOriginInfo::default()); - } else { - return Err(Error::InvalidDidKeyRevealed); - } - } - } + ensure!(!signing_leaves_indices.is_empty(), Error::InvalidDidKeyRevealed); let signing_leaves_indices_vector = signing_leaves_indices.try_into().map_err(|_| { log::error!("Should never fail to convert vector of signing leaf indices into BoundedVec."); diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs index 79aba9989e..c5844229dd 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs @@ -160,7 +160,7 @@ impl< let provider_head_storage_key = calculate_parachain_head_storage_key(provider_para_id); // TODO: Figure out why RPC call returns 2 bytes in front which we don't need //This could be the reason (and the solution): https://substrate.stackexchange.com/a/1891/1795 - let provider_header_result = verify_storage_value_proof_with_decoder::<_, RelayHasher, ProviderHeader>( + let provider_header = verify_storage_value_proof_with_decoder::<_, RelayHasher, ProviderHeader>( &provider_head_storage_key, *relay_state_root, self.provider_head_proof.proof, @@ -171,14 +171,8 @@ impl< let mut trimmed_input = &input[2..]; ProviderHeader::decode(&mut trimmed_input).ok() }, - ); - cfg_if::cfg_if! { - if #[cfg(feature = "runtime-benchmarks")] { - let provider_header = provider_header_result.unwrap_or_else(|_| ProviderHeader::new(::Number::default(), ::Hash::default(), ::Hash::default(), ::Hash::default(), sp_runtime::Digest::default())); - } else { - let provider_header = provider_header_result.map_err(Error::ParaHeadMerkleProof)?; - } - } + ) + .map_err(Error::ParaHeadMerkleProof)?; Ok(DipDidProofWithVerifiedStateRoot { state_root: *provider_header.state_root(), dip_commitment_proof: self.dip_commitment_proof, @@ -219,14 +213,8 @@ impl< StateRootStore: GetWithArg>>, ProviderHeader: Decode + HeaderT, Number = KiltBlockNumber>, { - let relay_state_root = StateRootStore::get(&self.provider_head_proof.relay_block_number); - cfg_if::cfg_if! { - if #[cfg(feature = "runtime-benchmarks")] { - let relay_state_root = relay_state_root.unwrap_or_default(); - } else { - let relay_state_root = relay_state_root.ok_or(Error::RelayStateRootNotFound)?; - } - } + let relay_state_root = + StateRootStore::get(&self.provider_head_proof.relay_block_number).ok_or(Error::RelayStateRootNotFound)?; self.verify_provider_head_proof_with_state_root::( provider_para_id, &relay_state_root, @@ -318,19 +306,12 @@ impl< { let dip_commitment_storage_key = calculate_dip_identity_commitment_storage_key_for_runtime::(subject, 0); - let dip_commitment_result = - verify_storage_value_proof::<_, ParachainHasher, IdentityCommitmentOf>( - &dip_commitment_storage_key, - self.state_root, - self.dip_commitment_proof.0, - ); - cfg_if::cfg_if! { - if #[cfg(feature = "runtime-benchmarks")] { - let dip_commitment = dip_commitment_result.unwrap_or_default(); - } else { - let dip_commitment = dip_commitment_result.map_err(Error::DipCommitmentMerkleProof)?; - } - } + let dip_commitment = verify_storage_value_proof::<_, ParachainHasher, IdentityCommitmentOf>( + &dip_commitment_storage_key, + self.state_root, + self.dip_commitment_proof.0, + ) + .map_err(Error::DipCommitmentMerkleProof)?; Ok(DipDidProofWithVerifiedSubjectCommitment { dip_commitment, dip_proof: self.dip_proof, @@ -463,19 +444,13 @@ impl< .iter() .map(|revealed_leaf| (revealed_leaf.encoded_key(), Some(revealed_leaf.encoded_value()))) .collect::>(); - let proof_verification_result = verify_trie_proof::, _, _, _>( + verify_trie_proof::, _, _, _>( &self.dip_commitment, self.dip_proof.blinded.as_slice(), proof_leaves_key_value_pairs.as_slice(), - ); + ) + .map_err(|_| Error::InvalidDidMerkleProof)?; - cfg_if::cfg_if! { - if #[cfg(feature = "runtime-benchmarks")] { - drop(proof_verification_result); - } else { - proof_verification_result.map_err(|_| Error::InvalidDidMerkleProof)?; - } - } let revealed_leaves = BoundedVec::try_from(self.dip_proof.revealed).map_err(|_| { log::error!("Should not fail to construct BoundedVec since bounds were checked before."); Error::Internal diff --git a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs index 6bd0cbd7dc..492e0a932e 100644 --- a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs @@ -65,42 +65,6 @@ pub enum VersionedDipParachainStateProof< ), } -#[cfg(feature = "runtime-benchmarks")] -impl< - RelayBlockNumber, - KiltDidKeyId, - KiltAccountId, - KiltBlockNumber, - KiltWeb3Name, - KiltLinkableAccountId, - ConsumerBlockNumber, - Context, - > kilt_support::traits::GetWorstCase - for VersionedDipParachainStateProof< - RelayBlockNumber, - KiltDidKeyId, - KiltAccountId, - KiltBlockNumber, - KiltWeb3Name, - KiltLinkableAccountId, - ConsumerBlockNumber, - > where - RelayBlockNumber: Default, - KiltDidKeyId: Default + Clone, - KiltAccountId: Clone, - KiltBlockNumber: Default + Clone, - KiltWeb3Name: Clone, - KiltLinkableAccountId: Clone, - ConsumerBlockNumber: Default, - Context: Clone, -{ - type Output = Self; - - fn worst_case(context: Context) -> Self::Output { - Self::V0(ParachainDipDidProof::worst_case(context)) - } -} - /// Versioned proof verifier. For version-specific description, refer to each /// verifier's documentation. pub struct KiltVersionedParachainVerifier< @@ -271,7 +235,7 @@ impl< { type Output = pallet_dip_consumer::benchmarking::WorstCaseOf; - fn worst_case(context: ()) -> Self::Output { + fn worst_case(_context: ()) -> Self::Output { // TODO: Update this. unimplemented!() } diff --git a/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs b/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs index 8a7ef118c2..f44377f9d0 100644 --- a/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs @@ -315,7 +315,7 @@ impl< type Output = pallet_dip_consumer::benchmarking::WorstCaseOf; // TODO: Change with proper proof. - fn worst_case(context: ()) -> Self::Output { + fn worst_case(_context: ()) -> Self::Output { unimplemented!() } } diff --git a/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs b/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs index a09cbb40ed..e2c5a3ad9d 100644 --- a/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs @@ -230,7 +230,7 @@ impl< { type Output = pallet_dip_consumer::benchmarking::WorstCaseOf; - fn worst_case(context: ()) -> Self::Output { + fn worst_case(_context: ()) -> Self::Output { // TODO: Update this. unimplemented!() } diff --git a/crates/kilt-dip-primitives/src/verifier/relaychain/v0/mod.rs b/crates/kilt-dip-primitives/src/verifier/relaychain/v0/mod.rs index 91ec65b072..d629188565 100644 --- a/crates/kilt-dip-primitives/src/verifier/relaychain/v0/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/relaychain/v0/mod.rs @@ -298,7 +298,7 @@ impl< type Output = pallet_dip_consumer::benchmarking::WorstCaseOf; // TODO: Change with proper proof. - fn worst_case(context: ()) -> Self::Output { + fn worst_case(_context: ()) -> Self::Output { unimplemented!() } } From 6f0edb2530f102e076033b63a9a1d9e14a78fee3 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Tue, 5 Mar 2024 11:13:51 +0100 Subject: [PATCH 05/14] Remove benchmarking logic from generic proof verifier. --- .../src/verifier/parachain/mod.rs | 43 ------------------- .../src/verifier/parachain/v0/mod.rs | 43 ------------------- .../src/verifier/relaychain/mod.rs | 41 ------------------ .../src/verifier/relaychain/v0/mod.rs | 41 ------------------ 4 files changed, 168 deletions(-) diff --git a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs index 492e0a932e..35e079a4e8 100644 --- a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs @@ -197,46 +197,3 @@ impl< } } } - -#[cfg(feature = "runtime-benchmarks")] -impl< - ConsumerRuntime, - RelaychainRuntime, - RelaychainStateRootStore, - const KILT_PARA_ID: u32, - KiltRuntime, - DidCallVerifier, - SignedExtra, - const MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32, - const MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32, - const MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32, - const MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE: u32, - const MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32, - const MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32, - const MAX_DID_MERKLE_LEAVES_REVEALED: u32, - > kilt_support::traits::GetWorstCase - for KiltVersionedParachainVerifier< - ConsumerRuntime, - RelaychainRuntime, - RelaychainStateRootStore, - KILT_PARA_ID, - KiltRuntime, - DidCallVerifier, - SignedExtra, - MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT, - MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE, - MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT, - MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE, - MAX_DID_MERKLE_PROOF_LEAVE_COUNT, - MAX_DID_MERKLE_PROOF_LEAVE_SIZE, - MAX_DID_MERKLE_LEAVES_REVEALED, - > where - ConsumerRuntime: pallet_dip_consumer::Config, -{ - type Output = pallet_dip_consumer::benchmarking::WorstCaseOf; - - fn worst_case(_context: ()) -> Self::Output { - // TODO: Update this. - unimplemented!() - } -} diff --git a/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs b/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs index f44377f9d0..53c8ab7fc1 100644 --- a/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs @@ -276,46 +276,3 @@ impl< Ok(revealed_did_info) } } - -#[cfg(feature = "runtime-benchmarks")] -impl< - ConsumerRuntime, - RelaychainRuntime, - RelaychainStateRootStore, - const KILT_PARA_ID: u32, - KiltRuntime, - DidCallVerifier, - SignedExtra, - const MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32, - const MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32, - const MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32, - const MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE: u32, - const MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32, - const MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32, - const MAX_DID_MERKLE_LEAVES_REVEALED: u32, - > kilt_support::traits::GetWorstCase - for ParachainVerifier< - ConsumerRuntime, - RelaychainRuntime, - RelaychainStateRootStore, - KILT_PARA_ID, - KiltRuntime, - DidCallVerifier, - SignedExtra, - MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT, - MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE, - MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT, - MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE, - MAX_DID_MERKLE_PROOF_LEAVE_COUNT, - MAX_DID_MERKLE_PROOF_LEAVE_SIZE, - MAX_DID_MERKLE_LEAVES_REVEALED, - > where - ConsumerRuntime: pallet_dip_consumer::Config, -{ - type Output = pallet_dip_consumer::benchmarking::WorstCaseOf; - - // TODO: Change with proper proof. - fn worst_case(_context: ()) -> Self::Output { - unimplemented!() - } -} diff --git a/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs b/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs index e2c5a3ad9d..2384f4d9e9 100644 --- a/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs @@ -194,44 +194,3 @@ impl< } } } - -#[cfg(feature = "runtime-benchmarks")] -impl< - ConsumerRuntime, - ConsumerBlockHashStore, - const KILT_PARA_ID: u32, - KiltRuntime, - DidCallVerifier, - SignedExtra, - const MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32, - const MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32, - const MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32, - const MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE: u32, - const MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32, - const MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32, - const MAX_DID_MERKLE_LEAVES_REVEALED: u32, - > kilt_support::traits::GetWorstCase - for KiltVersionedRelaychainVerifier< - ConsumerRuntime, - ConsumerBlockHashStore, - KILT_PARA_ID, - KiltRuntime, - DidCallVerifier, - SignedExtra, - MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT, - MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE, - MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT, - MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE, - MAX_DID_MERKLE_PROOF_LEAVE_COUNT, - MAX_DID_MERKLE_PROOF_LEAVE_SIZE, - MAX_DID_MERKLE_LEAVES_REVEALED, - > where - ConsumerRuntime: pallet_dip_consumer::Config, -{ - type Output = pallet_dip_consumer::benchmarking::WorstCaseOf; - - fn worst_case(_context: ()) -> Self::Output { - // TODO: Update this. - unimplemented!() - } -} diff --git a/crates/kilt-dip-primitives/src/verifier/relaychain/v0/mod.rs b/crates/kilt-dip-primitives/src/verifier/relaychain/v0/mod.rs index d629188565..e3c5166587 100644 --- a/crates/kilt-dip-primitives/src/verifier/relaychain/v0/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/relaychain/v0/mod.rs @@ -261,44 +261,3 @@ impl< Ok(revealed_did_info) } } - -#[cfg(feature = "runtime-benchmarks")] -impl< - ConsumerRuntime, - ConsumerBlockHashStore, - const KILT_PARA_ID: u32, - KiltRuntime, - DidCallVerifier, - SignedExtra, - const MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32, - const MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32, - const MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32, - const MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE: u32, - const MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32, - const MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32, - const MAX_DID_MERKLE_LEAVES_REVEALED: u32, - > kilt_support::traits::GetWorstCase - for RelaychainVerifier< - ConsumerRuntime, - ConsumerBlockHashStore, - KILT_PARA_ID, - KiltRuntime, - DidCallVerifier, - SignedExtra, - MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT, - MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE, - MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT, - MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE, - MAX_DID_MERKLE_PROOF_LEAVE_COUNT, - MAX_DID_MERKLE_PROOF_LEAVE_SIZE, - MAX_DID_MERKLE_LEAVES_REVEALED, - > where - ConsumerRuntime: pallet_dip_consumer::Config, -{ - type Output = pallet_dip_consumer::benchmarking::WorstCaseOf; - - // TODO: Change with proper proof. - fn worst_case(_context: ()) -> Self::Output { - unimplemented!() - } -} From f36c476f138841cefceace73bb0884681b801c19 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Tue, 5 Mar 2024 12:02:37 +0100 Subject: [PATCH 06/14] Code compiling --- Cargo.lock | 1 + .../src/verifier/parachain/mod.rs | 4 -- .../src/verifier/parachain/v0/mock.rs | 1 - .../src/verifier/parachain/v0/mod.rs | 3 - .../src/verifier/relaychain/mod.rs | 14 +---- .../src/verifier/relaychain/v0/mod.rs | 13 +---- dip-template/runtimes/dip-consumer/Cargo.toml | 3 + dip-template/runtimes/dip-consumer/src/dip.rs | 55 +++++++++++++++---- 8 files changed, 50 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 799563add7..0b6bf2c2ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2497,6 +2497,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "kilt-dip-primitives", + "kilt-support", "pallet-aura", "pallet-authorship", "pallet-balances", diff --git a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs index 35e079a4e8..45bbba3b99 100644 --- a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs @@ -68,7 +68,6 @@ pub enum VersionedDipParachainStateProof< /// Versioned proof verifier. For version-specific description, refer to each /// verifier's documentation. pub struct KiltVersionedParachainVerifier< - ConsumerRuntime, RelaychainRuntime, RelaychainStateRootStore, const KILT_PARA_ID: u32, @@ -84,7 +83,6 @@ pub struct KiltVersionedParachainVerifier< const MAX_DID_MERKLE_LEAVES_REVEALED: u32 = 64, >( PhantomData<( - ConsumerRuntime, RelaychainRuntime, RelaychainStateRootStore, KiltRuntime, @@ -110,7 +108,6 @@ impl< const MAX_DID_MERKLE_LEAVES_REVEALED: u32, > IdentityProofVerifier for KiltVersionedParachainVerifier< - ConsumerRuntime, RelaychainRuntime, RelaychainStateRootStore, KILT_PARA_ID, @@ -173,7 +170,6 @@ impl< ) -> Result { match proof { VersionedDipParachainStateProof::V0(v0_proof) => , 2_000, diff --git a/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs b/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs index 53c8ab7fc1..d0e1fc80ff 100644 --- a/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/parachain/v0/mod.rs @@ -70,7 +70,6 @@ mod tests; /// * `MAX_DID_MERKLE_LEAVES_REVEALED`: The maximum number of leaves that can be /// revealed as part of the DID Merkle proof. pub struct ParachainVerifier< - ConsumerRuntime, RelaychainRuntime, RelaychainStateRootStore, const KILT_PARA_ID: u32, @@ -86,7 +85,6 @@ pub struct ParachainVerifier< const MAX_DID_MERKLE_LEAVES_REVEALED: u32, >( PhantomData<( - ConsumerRuntime, RelaychainRuntime, RelaychainStateRootStore, KiltRuntime, @@ -112,7 +110,6 @@ impl< const MAX_DID_MERKLE_LEAVES_REVEALED: u32, > IdentityProofVerifier for ParachainVerifier< - ConsumerRuntime, RelaychainRuntime, RelaychainStateRootStore, KILT_PARA_ID, diff --git a/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs b/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs index 2384f4d9e9..d1909153a8 100644 --- a/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs @@ -70,7 +70,6 @@ pub enum VersionedRelaychainStateProof< /// Versioned proof verifier. For version-specific description, refer to each /// verifier's documentation. pub struct KiltVersionedRelaychainVerifier< - ConsumerRuntime, ConsumerBlockHashStore, const KILT_PARA_ID: u32, KiltRuntime, @@ -83,16 +82,7 @@ pub struct KiltVersionedRelaychainVerifier< const MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32 = 64, const MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32 = 128, const MAX_DID_MERKLE_LEAVES_REVEALED: u32 = 64, ->( - #[allow(clippy::type_complexity)] - PhantomData<( - ConsumerRuntime, - ConsumerBlockHashStore, - KiltRuntime, - DidCallVerifier, - SignedExtra, - )>, -); +>(#[allow(clippy::type_complexity)] PhantomData<(ConsumerBlockHashStore, KiltRuntime, DidCallVerifier, SignedExtra)>); impl< ConsumerRuntime, @@ -110,7 +100,6 @@ impl< const MAX_DID_MERKLE_LEAVES_REVEALED: u32, > IdentityProofVerifier for KiltVersionedRelaychainVerifier< - ConsumerRuntime, ConsumerBlockHashStore, KILT_PARA_ID, KiltRuntime, @@ -171,7 +160,6 @@ impl< ) -> Result { match proof { VersionedRelaychainStateProof::V0(v0_proof) => ( - #[allow(clippy::type_complexity)] - PhantomData<( - ConsumerRuntime, - ConsumerBlockHashStore, - KiltRuntime, - DidCallVerifier, - SignedExtra, - )>, -); +>(#[allow(clippy::type_complexity)] PhantomData<(ConsumerBlockHashStore, KiltRuntime, DidCallVerifier, SignedExtra)>); impl< ConsumerRuntime, @@ -103,7 +93,6 @@ impl< const MAX_DID_MERKLE_LEAVES_REVEALED: u32, > IdentityProofVerifier for RelaychainVerifier< - ConsumerRuntime, ConsumerBlockHashStore, KILT_PARA_ID, KiltRuntime, diff --git a/dip-template/runtimes/dip-consumer/Cargo.toml b/dip-template/runtimes/dip-consumer/Cargo.toml index 5a2986fbd5..88e5d4d271 100644 --- a/dip-template/runtimes/dip-consumer/Cargo.toml +++ b/dip-template/runtimes/dip-consumer/Cargo.toml @@ -66,6 +66,7 @@ rococo-runtime.workspace = true # Benchmarks frame-benchmarking = {workspace = true, optional = true} frame-system-benchmarking = {workspace = true, optional = true} +kilt-support = { workspace = true, optional = true } [features] default = [ @@ -114,6 +115,7 @@ std = [ "rococo-runtime/std", "frame-benchmarking?/std", "frame-system-benchmarking?/std", + "kilt-support?/std", ] runtime-benchmarks = [ @@ -133,4 +135,5 @@ runtime-benchmarks = [ "rococo-runtime/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-system-benchmarking/runtime-benchmarks", + "kilt-support/runtime-benchmarks" ] diff --git a/dip-template/runtimes/dip-consumer/src/dip.rs b/dip-template/runtimes/dip-consumer/src/dip.rs index 6db73ae7c2..867f8415c7 100644 --- a/dip-template/runtimes/dip-consumer/src/dip.rs +++ b/dip-template/runtimes/dip-consumer/src/dip.rs @@ -23,28 +23,61 @@ use frame_system::{pallet_prelude::BlockNumberFor, EnsureSigned}; use kilt_dip_primitives::{ traits::DipCallOriginFilter, KiltVersionedParachainVerifier, RelayStateRootsViaRelayStorePallet, RevealedDidKey, }; -use pallet_dip_consumer::traits::IdentityProofVerifier; +use pallet_dip_consumer::{benchmarking::WorstCaseOf, traits::IdentityProofVerifier}; use rococo_runtime::Runtime as RelaychainRuntime; use sp_core::ConstU32; use sp_std::{marker::PhantomData, vec::Vec}; use crate::{weights, AccountId, DidIdentifier, Runtime, RuntimeCall, RuntimeOrigin}; -pub type MerkleProofVerifierOutput = >::VerificationResult; -/// The verifier logic assumes the provider is a sibling KILT parachain, the -/// relaychain is a Rococo relaychain, and that a KILT subject can provide DIP -/// proof that reveal at most 10 DID keys and 10 linked accounts (defaults -/// provided by the `KiltVersionedParachainVerifier` type). Calls that do not -/// pass the [`DipCallFilter`] will be discarded early on in the verification -/// process. -pub type ProofVerifier = KiltVersionedParachainVerifier< - Runtime, +/// The verifier logic is tied to the provider template runtime definition. +pub type ProviderTemplateProofVerifier = KiltVersionedParachainVerifier< RelaychainRuntime, RelayStateRootsViaRelayStorePallet, 2_000, ProviderRuntime, DipCallFilter, BlockNumberFor, ProviderAccountId>, >; +pub type MerkleProofVerifierInput = >::Proof; +pub type MerkleProofVerifierOutput = + >::VerificationResult; +// Wrapper around the verifier to implement the `GetWorstCase` trait. +pub struct ProviderTemplateProofVerifierWrapper; + +// Delegate verification logic to the specialized version of +// `KiltVersionedParachainVerifier`. +impl IdentityProofVerifier for ProviderTemplateProofVerifierWrapper { + type Error = >::Error; + type Proof = MerkleProofVerifierInput; + type VerificationResult = MerkleProofVerifierOutput; + + fn verify_proof_for_call_against_details( + call: &pallet_dip_consumer::RuntimeCallOf, + subject: &::Identifier, + submitter: &::AccountId, + identity_details: &mut Option<::LocalIdentityInfo>, + proof: Self::Proof, + ) -> Result { + >::verify_proof_for_call_against_details( + call, + subject, + submitter, + identity_details, + proof, + ) + } +} + +// Implement worst-case logic for this specific verifier. +#[cfg(feature = "runtime-benchmarks")] +impl kilt_support::traits::GetWorstCase for ProviderTemplateProofVerifierWrapper { + type Output = WorstCaseOf; + + fn worst_case(_context: ()) -> Self::Output { + // TODO: Proper proof based on generated fixtures. + unimplemented!() + } +} impl pallet_dip_consumer::Config for Runtime { type DipCallOriginFilter = PreliminaryDipOriginFilter; @@ -57,7 +90,7 @@ impl pallet_dip_consumer::Config for Runtime { // that two cross-chain operations targeting the same chain and with the same // nonce cannot be both successfully evaluated. type LocalIdentityInfo = u128; - type ProofVerifier = ProofVerifier; + type ProofVerifier = ProviderTemplateProofVerifierWrapper; type RuntimeCall = RuntimeCall; type RuntimeOrigin = RuntimeOrigin; type WeightInfo = weights::pallet_dip_consumer::WeightInfo; From 8d32166d5229055c2c636b28f60efbe48de4beac Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Tue, 5 Mar 2024 14:51:40 +0100 Subject: [PATCH 07/14] Benchmark working! --- Cargo.lock | 1 + crates/kilt-dip-primitives/Cargo.toml | 2 +- .../src/merkle_proofs/v0/input_common.rs | 31 +- .../merkle_proofs/v0/provider_state/mod.rs | 34 ++ .../src/verifier/parachain/mod.rs | 45 +++ dip-template/runtimes/dip-consumer/Cargo.toml | 4 +- dip-template/runtimes/dip-consumer/src/dip.rs | 311 +++++++++++++++++- pallets/did/src/did_details.rs | 9 - 8 files changed, 405 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b6bf2c2ec..14b63d906c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2496,6 +2496,7 @@ dependencies = [ "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", + "hex-literal 0.3.4", "kilt-dip-primitives", "kilt-support", "pallet-aura", diff --git a/crates/kilt-dip-primitives/Cargo.toml b/crates/kilt-dip-primitives/Cargo.toml index 9e39c4c33c..6d5ea8ff39 100644 --- a/crates/kilt-dip-primitives/Cargo.toml +++ b/crates/kilt-dip-primitives/Cargo.toml @@ -77,5 +77,5 @@ std = [ runtime-benchmarks = [ "kilt-support/runtime-benchmarks", "pallet-dip-consumer/runtime-benchmarks", - "pallet-dip-provider/runtime-benchmarks", + "pallet-dip-provider/runtime-benchmarks" ] diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs index 67d6535274..b29b475aff 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs @@ -34,11 +34,26 @@ pub struct ProviderHeadStateProof { pub(crate) proof: Vec>, } +impl ProviderHeadStateProof { + pub fn new(relay_block_number: RelayBlockNumber, proof: Vec>) -> Self { + Self { + proof, + relay_block_number, + } + } +} + /// The state proof for a DIP commitment. #[derive(Clone, Debug, Encode, Decode, PartialEq, Eq, TypeInfo)] #[cfg_attr(test, derive(Default))] pub struct DipCommitmentStateProof(pub(crate) Vec>); +impl DipCommitmentStateProof { + pub fn new(proof: Vec>) -> Self { + Self(proof) + } +} + /// The Merkle proof for a KILT DID. /// /// The generic types indicate the following: @@ -138,19 +153,3 @@ where } } } - -#[cfg(feature = "runtime-benchmarks")] -impl kilt_support::traits::GetWorstCase for TimeBoundDidSignature -where - DidSignature: kilt_support::traits::GetWorstCase, - BlockNumber: Default, -{ - type Output = Self; - - fn worst_case(context: Context) -> Self::Output { - Self { - signature: DidSignature::worst_case(context), - valid_until: BlockNumber::default(), - } - } -} diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs index c5844229dd..89ae1ed4e2 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs @@ -76,6 +76,40 @@ pub struct ParachainDipDidProof< pub(crate) signature: TimeBoundDidSignature, } +impl< + RelayBlockNumber, + KiltDidKeyId, + KiltAccountId, + KiltBlockNumber, + KiltWeb3Name, + KiltLinkableAccountId, + ConsumerBlockNumber, + > + ParachainDipDidProof< + RelayBlockNumber, + KiltDidKeyId, + KiltAccountId, + KiltBlockNumber, + KiltWeb3Name, + KiltLinkableAccountId, + ConsumerBlockNumber, + > +{ + pub fn new( + provider_head_proof: ProviderHeadStateProof, + dip_commitment_proof: DipCommitmentStateProof, + dip_proof: DidMerkleProof, + signature: TimeBoundDidSignature, + ) -> Self { + Self { + dip_commitment_proof, + dip_proof, + provider_head_proof, + signature, + } + } +} + #[cfg(test)] impl< RelayBlockNumber, diff --git a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs index 45bbba3b99..0e87833d33 100644 --- a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs @@ -65,6 +65,51 @@ pub enum VersionedDipParachainStateProof< ), } +impl< + RelayBlockNumber, + KiltDidKeyId, + KiltAccountId, + KiltBlockNumber, + KiltWeb3Name, + KiltLinkableAccountId, + ConsumerBlockNumber, + > + From< + ParachainDipDidProof< + RelayBlockNumber, + KiltDidKeyId, + KiltAccountId, + KiltBlockNumber, + KiltWeb3Name, + KiltLinkableAccountId, + ConsumerBlockNumber, + >, + > + for VersionedDipParachainStateProof< + RelayBlockNumber, + KiltDidKeyId, + KiltAccountId, + KiltBlockNumber, + KiltWeb3Name, + KiltLinkableAccountId, + ConsumerBlockNumber, + > +{ + fn from( + value: ParachainDipDidProof< + RelayBlockNumber, + KiltDidKeyId, + KiltAccountId, + KiltBlockNumber, + KiltWeb3Name, + KiltLinkableAccountId, + ConsumerBlockNumber, + >, + ) -> Self { + Self::V0(value) + } +} + /// Versioned proof verifier. For version-specific description, refer to each /// verifier's documentation. pub struct KiltVersionedParachainVerifier< diff --git a/dip-template/runtimes/dip-consumer/Cargo.toml b/dip-template/runtimes/dip-consumer/Cargo.toml index 88e5d4d271..449dbc13d7 100644 --- a/dip-template/runtimes/dip-consumer/Cargo.toml +++ b/dip-template/runtimes/dip-consumer/Cargo.toml @@ -67,6 +67,7 @@ rococo-runtime.workspace = true frame-benchmarking = {workspace = true, optional = true} frame-system-benchmarking = {workspace = true, optional = true} kilt-support = { workspace = true, optional = true } +hex-literal = { workspace = true, optional = true } [features] default = [ @@ -135,5 +136,6 @@ runtime-benchmarks = [ "rococo-runtime/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-system-benchmarking/runtime-benchmarks", - "kilt-support/runtime-benchmarks" + "kilt-support/runtime-benchmarks", + "hex-literal" ] diff --git a/dip-template/runtimes/dip-consumer/src/dip.rs b/dip-template/runtimes/dip-consumer/src/dip.rs index 867f8415c7..b7f017345d 100644 --- a/dip-template/runtimes/dip-consumer/src/dip.rs +++ b/dip-template/runtimes/dip-consumer/src/dip.rs @@ -16,16 +16,23 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org -use did::{DidVerificationKeyRelationship, KeyIdOf}; +use did::{ + did_details::{DidEncryptionKey, DidPublicKeyDetails, DidVerificationKey}, + DidSignature, DidVerificationKeyRelationship, KeyIdOf, +}; use dip_provider_runtime_template::{AccountId as ProviderAccountId, Runtime as ProviderRuntime}; -use frame_support::traits::Contains; +use frame_support::{pallet_prelude::ValueQuery, storage_alias, traits::Contains}; use frame_system::{pallet_prelude::BlockNumberFor, EnsureSigned}; use kilt_dip_primitives::{ - traits::DipCallOriginFilter, KiltVersionedParachainVerifier, RelayStateRootsViaRelayStorePallet, RevealedDidKey, + traits::DipCallOriginFilter, DidKeyRelationship, DidMerkleProof, DipCommitmentStateProof, + KiltVersionedParachainVerifier, ParachainDipDidProof, ProviderHeadStateProof, RelayStateRootsViaRelayStorePallet, + RevealedAccountId, RevealedDidKey, RevealedWeb3Name, TimeBoundDidSignature, }; use pallet_dip_consumer::{benchmarking::WorstCaseOf, traits::IdentityProofVerifier}; +use pallet_relay_store::RelayParentInfo; use rococo_runtime::Runtime as RelaychainRuntime; use sp_core::ConstU32; +use sp_runtime::AccountId32; use sp_std::{marker::PhantomData, vec::Vec}; use crate::{weights, AccountId, DidIdentifier, Runtime, RuntimeCall, RuntimeOrigin}; @@ -74,8 +81,302 @@ impl kilt_support::traits::GetWorstCase for ProviderTemplateProofVerifierWrapper type Output = WorstCaseOf; fn worst_case(_context: ()) -> Self::Output { - // TODO: Proper proof based on generated fixtures. - unimplemented!() + use frame_support::Twox64Concat; + use hex_literal::hex; + use sp_core::{ed25519, sr25519, H256}; + use sp_std::vec; + + #[storage_alias] + type BlockHash = StorageMap< + System, + Twox64Concat, + BlockNumberFor, + ::Hash, + ValueQuery, + >; + #[storage_alias] + type LatestRelayHeads = StorageMap>; + + const PROOF_RELAY_BLOCK: u32 = 97; + + let provider_head_state_proof = ProviderHeadStateProof::new(PROOF_RELAY_BLOCK, vec![ + hex!("3703f5a4efb16ffa83d007000008cee9c1c963e73af7fc207dbebe6f1bbb4021ef306d72178c1f0ed9f697fb5d").to_vec(), + hex!("7d0379fca928dfb717b6f057a1e219ded3c9f0161411d8862fb0d35db5fa0658dfd66cbfe88cbd5e3c6e23b59ee284f49179453481973e23cdbaedae536563e9cb0ec8383b1c68c67a1756d37a56b1a9a4f8b6a1d2b4e85454d6b017f44fd5c17b0f620c066175726120b9e87d08000000000452505352884a92d2daf0f346d3fe051b8842ef5ee3ac796feea708ff44e2b35c662698b80e7d010561757261010180278e6ab8cd65e94d8c8264cb34ccac5e2a0fc797fc2d0cf7be8b602ca6061044c440d12404de5c595454bec27de12cb1cd631342e6c4090b556828533b3483").to_vec(), + hex!("8004648031b60c9237ed343094831987f2bec10b211621255ad0b440cf161fa820d30db480f6f6801e4b41e2e6d8ec194dba122bfb9eb33feb2545ef5144cea79551f7cc5280800f085545989f203978befd777d0db4963134effddc31c8d991ed83eff86e598024001dd7f8ab2d65332af5f168e33329c3363d38619ae10579556f7c568d8cfa").to_vec(), + hex!("80ffff80da3b13b6f4d00e78e5b4f9febe6ebdd907cb93f888684ae98beb244b23c2bfe9808eedebcb5207842de9ca534d8417b005715106e4c89481e45436606b0e7a51a2801fec1d90c30b290a110a2e6abdadc8243d13ab9974e64f618478704c3ab3d26180965db03a23a9608d689bc991515dabf5929cf73813cb71a330a84a61465116aa800db60e6cc6a1bf8cfdf30b0898db1e570400f22dd342a2e395e9f65dd322f838808a72642beadb74458557cfac7f0a094f164726efc64a41664f89d1c6676fed4e80792a15dbb3b1a6756b605c0785572dc15de8342c534890665add81be037faae1805b682132c52908705526057f73ab7fccab4af6d72a9805634dd8d3cc53f130d180c2d44d371e5fc1f50227d7491ad65ad049630361cefb4ab1844831237609f08380613ee4da8696b75f4409975f271bc6a2d8a1b4acdfd4dd617af34e1488d4f66b802701a3a8687f58f9de5c4f1fa21fa40d0a731b3954d58b02ea286c83b1a98d4180721c6d88d612c4dd11022fc52ee952342f6ba9630e4be9307dfa00988f22060180294443dd616e0b3e21617f766ba58dac88ce58224d7caa4dae29fea8ae629f7180e0d0559c10499f45c1162c73a5f19228779cc75762b99c7d9266dfd58ac4d4bd806bfdbbf0e0bedcb993b65c9cea1e929a56d78a3b7bc53d1b7ca6fc488e2295ee80c306d51e0505b64fb65c094b1c003c2188145a47acb2c1a3ad7cf3c239cc08b3").to_vec(), + hex!("9e710b30bd2eab0352ddcc26417aa1945f43803b3441f15daa8a53147d69c48eac75356fab581febbb8030520b248c5942a148803efd73d3f24bd2b3ca3916f50072b3cedcec47eb3c61ebb3318d44b7aa9bde3f802e2e0716043a02f2f29fdd52922704af194b98545ce5ca832255e8ec41bcdb64805777400f9579aadc0324691757c92714c245ff336464684b4e1c166ec4fd25eb505f0e7b9012096b41c4eb3aaf947f6ea4290800004c5f03c716fb8fff3de61a883bb76adb34a2040080bfafab45a320864b3a0037065b596599b16bfb6eb2a837e1c4839577045684654c5f0f4993f016e2d2f8e5f43be7bb2594860400801412850013bc8a13c78289220554c9aabb218bd2d3919b9d55a9cc434d337272").to_vec(), + hex!("9f0b3c252fcb29d88eff4f3de5de4476c350008008c8d0b4cf32fddcde0ace00fa1d052669181c9658ddb0a0e8d967edd7766ed680746cb579dee48fc7153d83cca35a07c60b37660b193012a49a85155d252daa0c").to_vec(), + ]); + let dip_commitment_proof = DipCommitmentStateProof::new(vec![ + hex!("7f24086f0d72fb64cf00aea16625a4c4ad138e416da9a3fa2302a4d0f367029d1784cbc85d226705684e01a12dfa1fa4ab9a00008030957a9ddde54ceb05cf3b96c348b458026e42b05f2159bf35011bc3957717aa").to_vec(), + hex!("800c8080da28793d083b197f8d92fc3e77f5064436f1d8eea0fbea56ddb936aba65445008027c4fa196c2981e3f0e695d6b20f54626eda4c6b7c048b8e78f538c3003fe594804c1639cc5554613cba6090de44badd65709713a9efac68281cd883904507722f").to_vec(), + hex!("80ffff80353e4d164b13c87910044f1b4e76277e404a0ab46a7cd6c33a65aaadc2375ba88007b1390da34b4dce1328430fd924a6e193517a8148dd70a912c0dc2f7f8d2d4c8008a563235f40d290d669842210155bf39823051d55778d15b44285b58b56db468040f42b645208abd84a2f00e27a227d2dcbc04d593d428b8aaf424494ca9fc3898049e4b5d562b41f98388487036c83400c59c09ae23091f6ea2e37f248f409ed5e801ca59f119820510bcd535f508127ca3fe9c38765c143dbb44be9f556ad3e4a4c8014e3e0704c9a07636322335a3c663ec9fd9df8b7bf71d6e8183fefecfbfe0e50808387a771b3f40eeeca915cd56599105120bd236e9da44122032155f9961c69638073f910fc27a7ebad806ebcea959a18debc401163da29832d9e8d87c13fbd270b80450ee2563f72918bfa60fbee9eeb1523b5c0c03ca4dced71d9896fc30c57157680e83c74d69e5cd6dee4cd34bed845929f515fd99ea8b0f2c9f4f41ee1108695e680ecfada42d946722ae4377aa62c262fe1e7e33b300c0eaa0c6d9451defbc740c580369fc68368609c90c18c4378933b282c57c2973beabb7baad0aef61ef09a7ba480f395b7003a2eb1e39c624b9a707a6cb58c3cb6997932fc80662ae19c785a91f580b5e5172489541dfc581e116554b63de15fddf38ffed2b109394749c20b8f6ce380646ba914c6984d5d37b95687a778e2b80628f739ee223273fdc51e179393e581").to_vec(), + hex!("9e75edf06348b4330d1e88564111cb3d3000505f0e7b9012096b41c4eb3aaf947f6ea42908000080f55a9532867b91cdfb7c67084730fa19f121659a7050b9cf3dce004be452bea4").to_vec(), + hex!("9f0bf19e4ed2927982e234d989e812f3f30401809aeada952657ae61b8e86d7c3cf64315e71658d378e1e0d9a418a97e3fe19c4d8028d2665c55ce38abb47566d37912f1947f6d126e68b86a8656d1ab187a82553f").to_vec(), + ]); + let dip_proof = DidMerkleProof::new( + vec![ + hex!("80f7eb00000000000000000000000000").to_vec(), + hex!("81016d8b000000000000000000").to_vec(), + hex!("7f0005e69aa86ca4ef945c050f71df4018c40043e57994b70f1ce8d30723b52e78f300").to_vec(), + hex!("7f0003125b5671d675e64bf07c911e6aed00eed230bf5d89b4063faf4d8b2738660000").to_vec(), + hex!("8020020000").to_vec(), + hex!("7ec2a225d9f89d836a1a0918ac43ea276717c82e6555dd2d935c77b55e6a2af700").to_vec(), + hex!("7ebaf365662e138e79e9f20d4b811470421fb5456533f27cb9d86f74ff58338500").to_vec(), + hex!("7f00054c64e7c349536628c7b8dc8bd4f69d23f409ab6b8a2586a0441252b6eec13b00").to_vec(), + hex!("7f0003bfdd8989572fafed46db59551a54167229f94e4c399a8a45680e7f716ff7bb00").to_vec(), + hex!("7f000ef8883295cd31bd47965d3d291ae8f4b8b12b2e7c0346f804ac3c87c9fad44c00").to_vec(), + hex!("7f000068f812b08c085e9c13ebdac3e3e02ca5e4d72f825730ce62c1860133af6ed300").to_vec(), + hex!("8002400000").to_vec(), + hex!("7e5e2ec431e7b58042d14f77082c639609873ef15986d7162ecfb8de44e3d28700").to_vec(), + hex!("7eed7077ac0d92683c6200b724fbdc305854691c80a29bdffefb5ec4a40dac3900").to_vec(), + hex!("7f0005cb1d1b41caf49a644faa643ed53235da11e27bb32dea75a997bf519bb24ef300").to_vec(), + hex!("7f020529c46d67b890ac140fb81c80b4db478ed7f6bcef7de075410ff6e418906bb70000").to_vec(), + hex!("7f0208eae731f8e1832afdfbffbdba974985ddc243c4b21a0b26ea491e537d0a8a230000").to_vec(), + hex!("7f02096cf53b2d24cbf261c63666dc5264a223014143eb53b3068b8a22712f027c670000").to_vec(), + hex!("6f0c663831623736356330643338386364666663636537386500").to_vec(), + hex!("7f0202d18e551945503ab4819410b00a03f9d0837b1ec94dadfbed10a329026b15990000").to_vec(), + hex!("7f020e22736773636ca149240d65840a7a9e8f730c7fb49595924160c10a999a133a0000").to_vec(), + hex!("7f040e2e5a8f885d4e9cf36e7b712dccbc02370a1b9832b086f7546b9b19b8e16a76010300").to_vec(), + hex!("7f020bb048fe494d7a31ee94481770cc65b413767310558907cc12da89c63847dd680000").to_vec(), + hex!("7f020ed56fa195ae408557da06b1fda161bbb3d59decbdf8da11b62d94ba4a97a5050000").to_vec(), + hex!("7f0403a9176af554951693286560dff02ac1839fc78dfd541ae5420fe4add3bd651e010100").to_vec(), + hex!("8000420000").to_vec(), + hex!("7f0178b1f175a02e5e32150ae7467eff3364833fecc8a5854c64cd394ca06348320000").to_vec(), + hex!("7f018df100a81fa9c82787ec56d3abc219dba95d49d4bad8339776dc1ab2bcf4560000").to_vec(), + hex!("7f0402b08a60751c017f70c3d006dc34d94210942562bc5b27af012534d9627dc3d8010000").to_vec(), + ], + vec![ + RevealedDidKey { + id: hex!("f2b08a60751c017f70c3d006dc34d94210942562bc5b27af012534d9627dc3d8").into(), + relationship: DidVerificationKeyRelationship::Authentication.into(), + details: DidPublicKeyDetails { + key: DidVerificationKey::Sr25519(sr25519::Public(hex!( + "aea16625a4c4ad138e416da9a3fa2302a4d0f367029d1784cbc85d226705684e" + ))) + .into(), + block_number: 26, + }, + } + .into(), + RevealedDidKey { + id: hex!("0123125b5671d675e64bf07c911e6aed00eed230bf5d89b4063faf4d8b273866").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "01588da8661499cdcdcdd8cb2cad3f025ccfd81dc68e89ea271a72f4a2632a74" + )) + .into(), + block_number: 26, + }, + } + .into(), + RevealedDidKey { + id: hex!("1529c46d67b890ac140fb81c80b4db478ed7f6bcef7de075410ff6e418906bb7").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "6dbf487eb115549616188f18b065ed0b8250eec0932b6dc12af47365215e833d" + )) + .into(), + block_number: 26, + }, + } + .into(), + RevealedDidKey { + id: hex!("28eae731f8e1832afdfbffbdba974985ddc243c4b21a0b26ea491e537d0a8a23").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "7a6c0ad3cf5f3121f8ee1dfb98543c8e39e1a71bda6ca8b94af9f384d7bfb44f" + )) + .into(), + block_number: 26, + }, + } + .into(), + RevealedDidKey { + id: hex!("496cf53b2d24cbf261c63666dc5264a223014143eb53b3068b8a22712f027c67").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "143cdc8c7ac305ca85385d1fd47277775b9a6d5a3595a98cfc8676a9d2274449" + )) + .into(), + block_number: 26, + }, + } + .into(), + RevealedDidKey { + id: hex!("62d18e551945503ab4819410b00a03f9d0837b1ec94dadfbed10a329026b1599").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "e2d9f974b8d5483ca6c2f82750889bcde7c7c5b1f5ed5c871dab09c2518fd75c" + )) + .into(), + block_number: 26, + }, + } + .into(), + RevealedDidKey { + id: hex!("7e22736773636ca149240d65840a7a9e8f730c7fb49595924160c10a999a133a").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "095de33b750ba03738cc2ca30920b1758318145e7f96b6ce952177b1f5714229" + )) + .into(), + block_number: 26, + }, + } + .into(), + RevealedDidKey { + id: hex!("9bb048fe494d7a31ee94481770cc65b413767310558907cc12da89c63847dd68").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "014154bcc7195582e2ad289604082a3b0f23af6ba70bc24ddbc36c5e9c622f21" + )) + .into(), + block_number: 26, + }, + } + .into(), + RevealedDidKey { + id: hex!("bed56fa195ae408557da06b1fda161bbb3d59decbdf8da11b62d94ba4a97a505").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "6922c04846b47fcc23a1936e95457183ed3c4f155624a23f50bfeb14e8647466" + )) + .into(), + block_number: 26, + }, + } + .into(), + RevealedDidKey { + id: hex!("e978b1f175a02e5e32150ae7467eff3364833fecc8a5854c64cd394ca0634832").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "f5437452eef8fa791b1bd66c24ad01bae3da4f04ec93a7525f5d1100d3cb4e14" + )) + .into(), + block_number: 26, + }, + } + .into(), + RevealedDidKey { + id: hex!("ee8df100a81fa9c82787ec56d3abc219dba95d49d4bad8339776dc1ab2bcf456").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "72225bb468e6dfead4afe19d7b5971c6934896fb0563e9a03224c27c5c12ca72" + )) + .into(), + block_number: 26, + }, + } + .into(), + RevealedDidKey { + id: hex!("d3a9176af554951693286560dff02ac1839fc78dfd541ae5420fe4add3bd651e").into(), + relationship: DidVerificationKeyRelationship::CapabilityDelegation.into(), + details: DidPublicKeyDetails { + key: DidVerificationKey::Ed25519(ed25519::Public(hex!( + "d790fd1b9eb633be20d16d381fdecf6cc826357164059a0fa2e44a4964551088" + ))) + .into(), + block_number: 26, + }, + } + .into(), + RevealedDidKey { + id: hex!("8e2e5a8f885d4e9cf36e7b712dccbc02370a1b9832b086f7546b9b19b8e16a76").into(), + relationship: DidVerificationKeyRelationship::AssertionMethod.into(), + details: DidPublicKeyDetails { + key: DidVerificationKey::Ed25519(ed25519::Public(hex!( + "71b66f3e5594cff1df7373e7795739219a0acdeebe6bd7f691783fee120b5747" + ))) + .into(), + block_number: 26, + }, + } + .into(), + RevealedAccountId( + AccountId32::new(hex!("9068f812b08c085e9c13ebdac3e3e02ca5e4d72f825730ce62c1860133af6ed3")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("554c64e7c349536628c7b8dc8bd4f69d23f409ab6b8a2586a0441252b6eec13b")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("8ef8883295cd31bd47965d3d291ae8f4b8b12b2e7c0346f804ac3c87c9fad44c")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("63bfdd8989572fafed46db59551a54167229f94e4c399a8a45680e7f716ff7bb")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("b15e2ec431e7b58042d14f77082c639609873ef15986d7162ecfb8de44e3d287")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("39baf365662e138e79e9f20d4b811470421fb5456533f27cb9d86f74ff583385")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("beed7077ac0d92683c6200b724fbdc305854691c80a29bdffefb5ec4a40dac39")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("f5cb1d1b41caf49a644faa643ed53235da11e27bb32dea75a997bf519bb24ef3")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("05e69aa86ca4ef945c050f71df4018c40043e57994b70f1ce8d30723b52e78f3")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("35c2a225d9f89d836a1a0918ac43ea276717c82e6555dd2d935c77b55e6a2af7")).into(), + ) + .into(), + RevealedWeb3Name { + web3_name: b"f81b765c0d388cdffcce78e".to_vec().try_into().unwrap(), + claimed_at: 26, + } + .into(), + ], + ); + let signature = TimeBoundDidSignature::new(DidSignature::Sr25519(sr25519::Signature(hex!("804e4e48dc9dc920e14edb8d3590c1bbc3523c60088d7a71250c3e30a265b77704d7e244bfed86a42126a326c7ed15ae707c888b788202c8e9c488071859228a"))), 79 as BlockNumberFor); + let proof = ParachainDipDidProof::new(provider_head_state_proof, dip_commitment_proof, dip_proof, signature); + + BlockHash::insert( + 0, + H256(hex!("8704d60f04d95d6cd6b774a84582b251a3129bb8f88b5c564447a76f31d0857b")), + ); + LatestRelayHeads::insert( + 97, + RelayParentInfo { + relay_parent_storage_root: H256(hex!( + "5977f2b96c1982d205055cfd1ce41592e9cd435770f62d7e11b9583d25fa67a8" + )), + }, + ); + + WorstCaseOf { + proof: proof.into(), + call: pallet_postit::Call::post { + text: b"Hello, world!".to_vec().try_into().unwrap(), + } + .into(), + // 4rs36nx5DuPgvJMs5bd2C8X8ySnGnc8KLsP2BUuJbxtYWEBn + subject: DidIdentifier::new(hex!("aea16625a4c4ad138e416da9a3fa2302a4d0f367029d1784cbc85d226705684e")), + // 4pMywUEABML35y2feheNsQDJFqYVTrUZbCww7XLRMkZxfmbm + submitter: AccountId::new(hex!("40002ce6270685b06ea56b9f5594efc9422ae8e498ee202ef3d886d84c4b343e")), + } } } diff --git a/pallets/did/src/did_details.rs b/pallets/did/src/did_details.rs index 8e57fca230..29a2a24bdc 100644 --- a/pallets/did/src/did_details.rs +++ b/pallets/did/src/did_details.rs @@ -191,15 +191,6 @@ impl From for DidSignature { } } -#[cfg(feature = "runtime-benchmarks")] -impl kilt_support::traits::GetWorstCase for DidSignature { - type Output = Self; - - fn worst_case(_context: Context) -> Self::Output { - Self::Sr25519(sp_core::sr25519::Signature::from_raw([0u8; 64])) - } -} - pub trait DidVerifiableIdentifier { /// Allows a verifiable identifier to verify a signature it produces and /// return the public key From 44a01adcb2f7339a08835b4d84c61481add494b1 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Tue, 5 Mar 2024 16:56:17 +0100 Subject: [PATCH 08/14] Add worst case tests --- Cargo.lock | 1 + .../src/merkle_proofs/v0/input_common.rs | 12 ++++ .../merkle_proofs/v0/provider_state/mod.rs | 18 ++++++ .../src/verifier/parachain/mod.rs | 22 +++++--- .../src/verifier/relaychain/mod.rs | 22 +++++--- dip-template/runtimes/dip-consumer/Cargo.toml | 3 + dip-template/runtimes/dip-consumer/src/dip.rs | 55 +++++++++++++++++-- dip-template/runtimes/dip-provider/src/dip.rs | 4 +- 8 files changed, 117 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 14b63d906c..50b1f80b04 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2521,6 +2521,7 @@ dependencies = [ "sp-consensus-aura", "sp-core", "sp-inherents", + "sp-io", "sp-offchain", "sp-runtime", "sp-session", diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs index b29b475aff..f9a5d6b5b3 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/input_common.rs @@ -100,6 +100,18 @@ impl Self { Self { blinded, revealed } } + + pub fn revealed( + &self, + ) -> &[RevealedDidMerkleProofLeaf< + ProviderDidKeyId, + ProviderAccountId, + ProviderBlockNumber, + ProviderWeb3Name, + ProviderLinkableAccountId, + >] { + self.revealed.as_ref() + } } #[cfg(test)] diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs index 89ae1ed4e2..66a52a21a7 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs @@ -108,6 +108,24 @@ impl< signature, } } + + pub fn provider_head_proof(&self) -> &ProviderHeadStateProof { + &self.provider_head_proof + } + + pub fn dip_commitment_proof(&self) -> &DipCommitmentStateProof { + &self.dip_commitment_proof + } + + pub fn dip_proof( + &self, + ) -> &DidMerkleProof { + &self.dip_proof + } + + pub fn signature(&self) -> &TimeBoundDidSignature { + &self.signature + } } #[cfg(test)] diff --git a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs index 0e87833d33..1a8b07c8ed 100644 --- a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs @@ -110,6 +110,14 @@ impl< } } +pub const DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32 = 64; +pub const DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32 = 1024; +pub const DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32 = 64; +pub const DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE: u32 = 1024; +pub const DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32 = 64; +pub const DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32 = 1024; +pub const DEFAULT_MAX_DID_MERKLE_LEAVES_REVEALED: u32 = 64; + /// Versioned proof verifier. For version-specific description, refer to each /// verifier's documentation. pub struct KiltVersionedParachainVerifier< @@ -119,13 +127,13 @@ pub struct KiltVersionedParachainVerifier< KiltRuntime, DidCallVerifier, SignedExtra = (), - const MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32 = 64, - const MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32 = 1024, - const MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32 = 64, - const MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE: u32 = 1024, - const MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32 = 64, - const MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32 = 1024, - const MAX_DID_MERKLE_LEAVES_REVEALED: u32 = 64, + const MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32 = DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT, + const MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32 = DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE, + const MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32 = DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT, + const MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE: u32 = DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE, + const MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32 = DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_COUNT, + const MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32 = DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_SIZE, + const MAX_DID_MERKLE_LEAVES_REVEALED: u32 = DEFAULT_MAX_DID_MERKLE_LEAVES_REVEALED, >( PhantomData<( RelaychainRuntime, diff --git a/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs b/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs index d1909153a8..d2eab981b4 100644 --- a/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs @@ -67,6 +67,14 @@ pub enum VersionedRelaychainStateProof< ), } +pub const DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32 = 64; +pub const DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32 = 1024; +pub const DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32 = 64; +pub const DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE: u32 = 1024; +pub const DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32 = 64; +pub const DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32 = 1024; +pub const DEFAULT_MAX_DID_MERKLE_LEAVES_REVEALED: u32 = 64; + /// Versioned proof verifier. For version-specific description, refer to each /// verifier's documentation. pub struct KiltVersionedRelaychainVerifier< @@ -75,13 +83,13 @@ pub struct KiltVersionedRelaychainVerifier< KiltRuntime, DidCallVerifier, SignedExtra = (), - const MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32 = 64, - const MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32 = 128, - const MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32 = 64, - const MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE: u32 = 128, - const MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32 = 64, - const MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32 = 128, - const MAX_DID_MERKLE_LEAVES_REVEALED: u32 = 64, + const MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32 = DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT, + const MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32 = DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE, + const MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32 = DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT, + const MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE: u32 = DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE, + const MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32 = DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_COUNT, + const MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32 = DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_SIZE, + const MAX_DID_MERKLE_LEAVES_REVEALED: u32 = DEFAULT_MAX_DID_MERKLE_LEAVES_REVEALED, >(#[allow(clippy::type_complexity)] PhantomData<(ConsumerBlockHashStore, KiltRuntime, DidCallVerifier, SignedExtra)>); impl< diff --git a/dip-template/runtimes/dip-consumer/Cargo.toml b/dip-template/runtimes/dip-consumer/Cargo.toml index 449dbc13d7..cb7a7c4267 100644 --- a/dip-template/runtimes/dip-consumer/Cargo.toml +++ b/dip-template/runtimes/dip-consumer/Cargo.toml @@ -13,6 +13,9 @@ version.workspace = true [build-dependencies] substrate-wasm-builder.workspace = true +[dev-dependencies] +sp-io = {workspace = true, features = ["std"]} + [dependencies] parity-scale-codec = {workspace = true, features = ["derive"]} scale-info = {workspace = true, features = ["derive"]} diff --git a/dip-template/runtimes/dip-consumer/src/dip.rs b/dip-template/runtimes/dip-consumer/src/dip.rs index b7f017345d..50b9ce2aac 100644 --- a/dip-template/runtimes/dip-consumer/src/dip.rs +++ b/dip-template/runtimes/dip-consumer/src/dip.rs @@ -20,13 +20,22 @@ use did::{ did_details::{DidEncryptionKey, DidPublicKeyDetails, DidVerificationKey}, DidSignature, DidVerificationKeyRelationship, KeyIdOf, }; -use dip_provider_runtime_template::{AccountId as ProviderAccountId, Runtime as ProviderRuntime}; +use dip_provider_runtime_template::{ + AccountId as ProviderAccountId, MaxTotalKeyAgreementKeys, Runtime as ProviderRuntime, + MAX_REVEALABLE_LINKED_ACCOUNTS, +}; use frame_support::{pallet_prelude::ValueQuery, storage_alias, traits::Contains}; use frame_system::{pallet_prelude::BlockNumberFor, EnsureSigned}; use kilt_dip_primitives::{ - traits::DipCallOriginFilter, DidKeyRelationship, DidMerkleProof, DipCommitmentStateProof, - KiltVersionedParachainVerifier, ParachainDipDidProof, ProviderHeadStateProof, RelayStateRootsViaRelayStorePallet, - RevealedAccountId, RevealedDidKey, RevealedWeb3Name, TimeBoundDidSignature, + parachain::{ + DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_COUNT, DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_SIZE, + DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT, DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE, + DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT, DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE, + }, + traits::DipCallOriginFilter, + DidKeyRelationship, DidMerkleProof, DipCommitmentStateProof, KiltVersionedParachainVerifier, ParachainDipDidProof, + ProviderHeadStateProof, RelayStateRootsViaRelayStorePallet, RevealedAccountId, RevealedDidKey, RevealedWeb3Name, + TimeBoundDidSignature, }; use pallet_dip_consumer::{benchmarking::WorstCaseOf, traits::IdentityProofVerifier}; use pallet_relay_store::RelayParentInfo; @@ -37,6 +46,10 @@ use sp_std::{marker::PhantomData, vec::Vec}; use crate::{weights, AccountId, DidIdentifier, Runtime, RuntimeCall, RuntimeOrigin}; +// 3 is the attestation, delegation, and authentication key. +// 1 is the web3name. +const MAX_PROVIDER_REVEALABLE_KEYS_COUNT: u32 = MaxTotalKeyAgreementKeys + 3 + 1 + MAX_REVEALABLE_LINKED_ACCOUNTS; + /// The verifier logic is tied to the provider template runtime definition. pub type ProviderTemplateProofVerifier = KiltVersionedParachainVerifier< RelaychainRuntime, @@ -44,6 +57,14 @@ pub type ProviderTemplateProofVerifier = KiltVersionedParachainVerifier< 2_000, ProviderRuntime, DipCallFilter, BlockNumberFor, ProviderAccountId>, + (), + DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT, + DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE, + DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT, + DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE, + DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_COUNT, + DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_SIZE, + MAX_PROVIDER_REVEALABLE_KEYS_COUNT, >; pub type MerkleProofVerifierInput = >::Proof; pub type MerkleProofVerifierOutput = @@ -380,6 +401,32 @@ impl kilt_support::traits::GetWorstCase for ProviderTemplateProofVerifierWrapper } } +#[cfg(all(test, feature = "runtime-benchmarks"))] +mod worst_case_tests { + use kilt_dip_primitives::{parachain::DEFAULT_MAX_DID_MERKLE_LEAVES_REVEALED, VersionedDipParachainStateProof}; + use kilt_support::traits::GetWorstCase; + use pallet_dip_consumer::benchmarking::WorstCaseOf; + + use crate::ProviderTemplateProofVerifierWrapper; + + #[test] + fn worst_case_max_limits() { + sp_io::TestExternalities::default().execute_with(|| { + let WorstCaseOf { proof, .. } = ::worst_case(()); + let VersionedDipParachainStateProof::V0(proof) = proof; + // We test that the worst case reveals the maximum number of leaves revealable. + // This is required since the worst case is generated elsewhere and used here as + // a fixture. + sp_io::TestExternalities::default().execute_with(|| { + assert_eq!( + proof.dip_proof().revealed().len(), + MAX_PROVIDER_REVEALABLE_KEYS as usize + ); + }); + }); + } +} + impl pallet_dip_consumer::Config for Runtime { type DipCallOriginFilter = PreliminaryDipOriginFilter; // Any signed origin can submit a cross-chain DIP tx, since subject diff --git a/dip-template/runtimes/dip-provider/src/dip.rs b/dip-template/runtimes/dip-provider/src/dip.rs index 4480940671..0eac34638f 100644 --- a/dip-template/runtimes/dip-provider/src/dip.rs +++ b/dip-template/runtimes/dip-provider/src/dip.rs @@ -34,7 +34,7 @@ use crate::{ weights, AccountId, Balances, DidIdentifier, Runtime, RuntimeEvent, RuntimeHoldReason, }; -const MAX_LINKED_ACCOUNTS: u32 = 20; +pub const MAX_REVEALABLE_LINKED_ACCOUNTS: u32 = 20; pub mod runtime_api { use super::*; @@ -243,7 +243,7 @@ impl pallet_dip_provider::Config for Runtime { type IdentityCommitmentGenerator = DidMerkleRootGenerator; // Identity info is defined as the collection of DID keys, linked accounts, and // the optional web3name of a given DID subject. - type IdentityProvider = LinkedDidInfoProvider; + type IdentityProvider = LinkedDidInfoProvider; type ProviderHooks = deposit::DepositCollectorHooks; type RuntimeEvent = RuntimeEvent; type WeightInfo = weights::pallet_dip_provider::WeightInfo; From 98e1fe5213f3c5493f93738323b5390548358ca3 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Tue, 5 Mar 2024 17:07:34 +0100 Subject: [PATCH 09/14] Project compiling --- .../src/merkle_proofs/v0/dip_subject_state/mod.rs | 5 +---- .../src/merkle_proofs/v0/provider_state/mod.rs | 6 ++---- .../src/merkle_proofs/v0/relay_state/mod.rs | 5 ++--- dip-template/runtimes/dip-consumer/src/dip.rs | 12 ++++++------ dip-template/runtimes/dip-provider/src/lib.rs | 3 ++- 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/dip_subject_state/mod.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/dip_subject_state/mod.rs index df2e492574..b525297407 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/dip_subject_state/mod.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/dip_subject_state/mod.rs @@ -30,7 +30,6 @@ use crate::{ input_common::TimeBoundDidSignature, output_common::{DidKeyRelationship, DipOriginInfo, RevealedDidKey, RevealedDidMerkleProofLeaf}, }, - traits::BenchmarkDefault, Error, }; @@ -161,9 +160,7 @@ impl< KiltWeb3Name, KiltLinkableAccountId, MAX_REVEALED_LEAVES_COUNT, - > where - KiltDidKeyId: BenchmarkDefault, - KiltBlockNumber: BenchmarkDefault, + > { /// Iterates over the revealed DID leaves to find the ones that generated a /// valid signature for the provided payload. diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs index 66a52a21a7..8e91c1cbc2 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs @@ -33,7 +33,7 @@ use crate::{ input_common::{DidMerkleProof, DipCommitmentStateProof, ProviderHeadStateProof, TimeBoundDidSignature}, }, state_proofs::{verify_storage_value_proof, verify_storage_value_proof_with_decoder}, - traits::{BenchmarkDefault, GetWithArg}, + traits::GetWithArg, utils::{ calculate_dip_identity_commitment_storage_key_for_runtime, calculate_parachain_head_storage_key, OutputOf, }, @@ -178,8 +178,7 @@ impl< KiltWeb3Name, KiltLinkableAccountId, ConsumerBlockNumber, - > where - KiltBlockNumber: BenchmarkDefault, + > { /// Verifies the head data of the state proof for the provider with the /// given para ID and relaychain state root. @@ -354,7 +353,6 @@ impl< StateRoot: Ord, ParachainHasher: Hash, ProviderRuntime: pallet_dip_provider::Config, - IdentityCommitmentOf: BenchmarkDefault, { let dip_commitment_storage_key = calculate_dip_identity_commitment_storage_key_for_runtime::(subject, 0); diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/relay_state/mod.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/relay_state/mod.rs index 9dc4c33ae6..5a08bc9dce 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/relay_state/mod.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/relay_state/mod.rs @@ -29,7 +29,7 @@ use crate::{ input_common::{DidMerkleProof, DipCommitmentStateProof, ProviderHeadStateProof, TimeBoundDidSignature}, provider_state::ParachainDipDidProof, }, - traits::{BenchmarkDefault, GetWithArg}, + traits::GetWithArg, utils::OutputOf, DipDidProofWithVerifiedStateRoot, Error, }; @@ -204,8 +204,7 @@ impl< KiltBlockNumber, KiltWeb3Name, KiltLinkableAccountId, - > where - KiltBlockNumber: BenchmarkDefault, + > { /// Verifies the head data of the state proof for the provider with the /// given para ID. diff --git a/dip-template/runtimes/dip-consumer/src/dip.rs b/dip-template/runtimes/dip-consumer/src/dip.rs index 50b9ce2aac..9a303b9945 100644 --- a/dip-template/runtimes/dip-consumer/src/dip.rs +++ b/dip-template/runtimes/dip-consumer/src/dip.rs @@ -21,8 +21,8 @@ use did::{ DidSignature, DidVerificationKeyRelationship, KeyIdOf, }; use dip_provider_runtime_template::{ - AccountId as ProviderAccountId, MaxTotalKeyAgreementKeys, Runtime as ProviderRuntime, - MAX_REVEALABLE_LINKED_ACCOUNTS, + AccountId as ProviderAccountId, Runtime as ProviderRuntime, MAX_REVEALABLE_LINKED_ACCOUNTS, + MAX_TOTAL_KEY_AGREEMENT_KEYS, }; use frame_support::{pallet_prelude::ValueQuery, storage_alias, traits::Contains}; use frame_system::{pallet_prelude::BlockNumberFor, EnsureSigned}; @@ -48,7 +48,7 @@ use crate::{weights, AccountId, DidIdentifier, Runtime, RuntimeCall, RuntimeOrig // 3 is the attestation, delegation, and authentication key. // 1 is the web3name. -const MAX_PROVIDER_REVEALABLE_KEYS_COUNT: u32 = MaxTotalKeyAgreementKeys + 3 + 1 + MAX_REVEALABLE_LINKED_ACCOUNTS; +const MAX_PROVIDER_REVEALABLE_KEYS_COUNT: u32 = MAX_TOTAL_KEY_AGREEMENT_KEYS + 3 + 1 + MAX_REVEALABLE_LINKED_ACCOUNTS; /// The verifier logic is tied to the provider template runtime definition. pub type ProviderTemplateProofVerifier = KiltVersionedParachainVerifier< @@ -403,11 +403,11 @@ impl kilt_support::traits::GetWorstCase for ProviderTemplateProofVerifierWrapper #[cfg(all(test, feature = "runtime-benchmarks"))] mod worst_case_tests { - use kilt_dip_primitives::{parachain::DEFAULT_MAX_DID_MERKLE_LEAVES_REVEALED, VersionedDipParachainStateProof}; + use kilt_dip_primitives::VersionedDipParachainStateProof; use kilt_support::traits::GetWorstCase; use pallet_dip_consumer::benchmarking::WorstCaseOf; - use crate::ProviderTemplateProofVerifierWrapper; + use crate::{dip::MAX_PROVIDER_REVEALABLE_KEYS_COUNT, ProviderTemplateProofVerifierWrapper}; #[test] fn worst_case_max_limits() { @@ -420,7 +420,7 @@ mod worst_case_tests { sp_io::TestExternalities::default().execute_with(|| { assert_eq!( proof.dip_proof().revealed().len(), - MAX_PROVIDER_REVEALABLE_KEYS as usize + MAX_PROVIDER_REVEALABLE_KEYS_COUNT as usize ); }); }); diff --git a/dip-template/runtimes/dip-provider/src/lib.rs b/dip-template/runtimes/dip-provider/src/lib.rs index 36d7e0a548..0a3051da63 100644 --- a/dip-template/runtimes/dip-provider/src/lib.rs +++ b/dip-template/runtimes/dip-provider/src/lib.rs @@ -376,9 +376,10 @@ impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for RuntimeCall } } +pub const MAX_TOTAL_KEY_AGREEMENT_KEYS: u32 = 50; parameter_types! { #[derive(Debug, Clone, Eq, PartialEq)] - pub const MaxTotalKeyAgreementKeys: u32 = 50; + pub const MaxTotalKeyAgreementKeys: u32 = MAX_TOTAL_KEY_AGREEMENT_KEYS; #[derive(Debug, Clone, Eq, PartialEq, TypeInfo, Encode, Decode)] pub const MaxNewKeyAgreementKeys: u32 = 50; } From 6baee806634312676584b615e3b5835eff407582 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Tue, 5 Mar 2024 17:18:15 +0100 Subject: [PATCH 10/14] Clippy fixes --- dip-template/runtimes/dip-consumer/src/dip.rs | 38 ++++++++++--------- dip-template/runtimes/dip-provider/src/lib.rs | 6 +-- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/dip-template/runtimes/dip-consumer/src/dip.rs b/dip-template/runtimes/dip-consumer/src/dip.rs index 9a303b9945..a42876fb1f 100644 --- a/dip-template/runtimes/dip-consumer/src/dip.rs +++ b/dip-template/runtimes/dip-consumer/src/dip.rs @@ -16,15 +16,11 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org -use did::{ - did_details::{DidEncryptionKey, DidPublicKeyDetails, DidVerificationKey}, - DidSignature, DidVerificationKeyRelationship, KeyIdOf, -}; +use did::{DidVerificationKeyRelationship, KeyIdOf}; use dip_provider_runtime_template::{ - AccountId as ProviderAccountId, Runtime as ProviderRuntime, MAX_REVEALABLE_LINKED_ACCOUNTS, - MAX_TOTAL_KEY_AGREEMENT_KEYS, + AccountId as ProviderAccountId, Runtime as ProviderRuntime, MAX_PUBLIC_KEYS_PER_DID, MAX_REVEALABLE_LINKED_ACCOUNTS, }; -use frame_support::{pallet_prelude::ValueQuery, storage_alias, traits::Contains}; +use frame_support::traits::Contains; use frame_system::{pallet_prelude::BlockNumberFor, EnsureSigned}; use kilt_dip_primitives::{ parachain::{ @@ -33,22 +29,17 @@ use kilt_dip_primitives::{ DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT, DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE, }, traits::DipCallOriginFilter, - DidKeyRelationship, DidMerkleProof, DipCommitmentStateProof, KiltVersionedParachainVerifier, ParachainDipDidProof, - ProviderHeadStateProof, RelayStateRootsViaRelayStorePallet, RevealedAccountId, RevealedDidKey, RevealedWeb3Name, - TimeBoundDidSignature, + KiltVersionedParachainVerifier, RelayStateRootsViaRelayStorePallet, RevealedDidKey, }; -use pallet_dip_consumer::{benchmarking::WorstCaseOf, traits::IdentityProofVerifier}; -use pallet_relay_store::RelayParentInfo; +use pallet_dip_consumer::traits::IdentityProofVerifier; use rococo_runtime::Runtime as RelaychainRuntime; use sp_core::ConstU32; -use sp_runtime::AccountId32; use sp_std::{marker::PhantomData, vec::Vec}; use crate::{weights, AccountId, DidIdentifier, Runtime, RuntimeCall, RuntimeOrigin}; -// 3 is the attestation, delegation, and authentication key. -// 1 is the web3name. -const MAX_PROVIDER_REVEALABLE_KEYS_COUNT: u32 = MAX_TOTAL_KEY_AGREEMENT_KEYS + 3 + 1 + MAX_REVEALABLE_LINKED_ACCOUNTS; +// +1 for the web3name. +const MAX_PROVIDER_REVEALABLE_KEYS_COUNT: u32 = MAX_PUBLIC_KEYS_PER_DID + MAX_REVEALABLE_LINKED_ACCOUNTS + 1; /// The verifier logic is tied to the provider template runtime definition. pub type ProviderTemplateProofVerifier = KiltVersionedParachainVerifier< @@ -99,12 +90,23 @@ impl IdentityProofVerifier for ProviderTemplateProofVerifierWrapper { // Implement worst-case logic for this specific verifier. #[cfg(feature = "runtime-benchmarks")] impl kilt_support::traits::GetWorstCase for ProviderTemplateProofVerifierWrapper { - type Output = WorstCaseOf; + type Output = pallet_dip_consumer::benchmarking::WorstCaseOf; fn worst_case(_context: ()) -> Self::Output { - use frame_support::Twox64Concat; + use did::{ + did_details::{DidEncryptionKey, DidPublicKeyDetails, DidVerificationKey}, + DidSignature, + }; + use frame_support::{pallet_prelude::ValueQuery, storage_alias, Twox64Concat}; use hex_literal::hex; + use kilt_dip_primitives::{ + DidKeyRelationship, DidMerkleProof, DipCommitmentStateProof, ParachainDipDidProof, ProviderHeadStateProof, + RevealedAccountId, RevealedWeb3Name, TimeBoundDidSignature, + }; + use pallet_dip_consumer::benchmarking::WorstCaseOf; + use pallet_relay_store::RelayParentInfo; use sp_core::{ed25519, sr25519, H256}; + use sp_runtime::AccountId32; use sp_std::vec; #[storage_alias] diff --git a/dip-template/runtimes/dip-provider/src/lib.rs b/dip-template/runtimes/dip-provider/src/lib.rs index 0a3051da63..f23dbc18a4 100644 --- a/dip-template/runtimes/dip-provider/src/lib.rs +++ b/dip-template/runtimes/dip-provider/src/lib.rs @@ -376,10 +376,10 @@ impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for RuntimeCall } } -pub const MAX_TOTAL_KEY_AGREEMENT_KEYS: u32 = 50; +pub const MAX_PUBLIC_KEYS_PER_DID: u32 = 53; parameter_types! { #[derive(Debug, Clone, Eq, PartialEq)] - pub const MaxTotalKeyAgreementKeys: u32 = MAX_TOTAL_KEY_AGREEMENT_KEYS; + pub const MaxTotalKeyAgreementKeys: u32 = 50; #[derive(Debug, Clone, Eq, PartialEq, TypeInfo, Encode, Decode)] pub const MaxNewKeyAgreementKeys: u32 = 50; } @@ -398,7 +398,7 @@ impl did::Config for Runtime { type MaxNumberOfServicesPerDid = ConstU32<1>; type MaxNumberOfTypesPerService = ConstU32<1>; type MaxNumberOfUrlsPerService = ConstU32<1>; - type MaxPublicKeysPerDid = ConstU32<53>; + type MaxPublicKeysPerDid = ConstU32; type MaxServiceIdLength = ConstU32<100>; type MaxServiceTypeLength = ConstU32<100>; type MaxServiceUrlLength = ConstU32<100>; From f7d805849061605c527992b7d009e15dd9d9d766 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Wed, 6 Mar 2024 09:59:56 +0100 Subject: [PATCH 11/14] Fixed test --- .../src/verifier/parachain/mod.rs | 8 +- .../src/verifier/relaychain/mod.rs | 8 +- dip-template/runtimes/dip-consumer/src/dip.rs | 797 +++++++++++++++--- 3 files changed, 705 insertions(+), 108 deletions(-) diff --git a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs index 1a8b07c8ed..4ca660b573 100644 --- a/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/parachain/mod.rs @@ -110,13 +110,13 @@ impl< } } -pub const DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32 = 64; +pub const DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32 = 128; pub const DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32 = 1024; -pub const DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32 = 64; +pub const DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32 = 128; pub const DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE: u32 = 1024; -pub const DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32 = 64; +pub const DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32 = 128; pub const DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32 = 1024; -pub const DEFAULT_MAX_DID_MERKLE_LEAVES_REVEALED: u32 = 64; +pub const DEFAULT_MAX_DID_MERKLE_LEAVES_REVEALED: u32 = 128; /// Versioned proof verifier. For version-specific description, refer to each /// verifier's documentation. diff --git a/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs b/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs index d2eab981b4..4702ca5167 100644 --- a/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs @@ -67,13 +67,13 @@ pub enum VersionedRelaychainStateProof< ), } -pub const DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32 = 64; +pub const DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32 = 128; pub const DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32 = 1024; -pub const DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32 = 64; +pub const DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32 = 128; pub const DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_SIZE: u32 = 1024; -pub const DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32 = 64; +pub const DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_COUNT: u32 = 128; pub const DEFAULT_MAX_DID_MERKLE_PROOF_LEAVE_SIZE: u32 = 1024; -pub const DEFAULT_MAX_DID_MERKLE_LEAVES_REVEALED: u32 = 64; +pub const DEFAULT_MAX_DID_MERKLE_LEAVES_REVEALED: u32 = 128; /// Versioned proof verifier. For version-specific description, refer to each /// verifier's documentation. diff --git a/dip-template/runtimes/dip-consumer/src/dip.rs b/dip-template/runtimes/dip-consumer/src/dip.rs index a42876fb1f..b48ca75a43 100644 --- a/dip-template/runtimes/dip-consumer/src/dip.rs +++ b/dip-template/runtimes/dip-consumer/src/dip.rs @@ -120,271 +120,868 @@ impl kilt_support::traits::GetWorstCase for ProviderTemplateProofVerifierWrapper #[storage_alias] type LatestRelayHeads = StorageMap>; - const PROOF_RELAY_BLOCK: u32 = 97; + const PROOF_RELAY_BLOCK: u32 = 193; let provider_head_state_proof = ProviderHeadStateProof::new(PROOF_RELAY_BLOCK, vec![ - hex!("3703f5a4efb16ffa83d007000008cee9c1c963e73af7fc207dbebe6f1bbb4021ef306d72178c1f0ed9f697fb5d").to_vec(), - hex!("7d0379fca928dfb717b6f057a1e219ded3c9f0161411d8862fb0d35db5fa0658dfd66cbfe88cbd5e3c6e23b59ee284f49179453481973e23cdbaedae536563e9cb0ec8383b1c68c67a1756d37a56b1a9a4f8b6a1d2b4e85454d6b017f44fd5c17b0f620c066175726120b9e87d08000000000452505352884a92d2daf0f346d3fe051b8842ef5ee3ac796feea708ff44e2b35c662698b80e7d010561757261010180278e6ab8cd65e94d8c8264cb34ccac5e2a0fc797fc2d0cf7be8b602ca6061044c440d12404de5c595454bec27de12cb1cd631342e6c4090b556828533b3483").to_vec(), - hex!("8004648031b60c9237ed343094831987f2bec10b211621255ad0b440cf161fa820d30db480f6f6801e4b41e2e6d8ec194dba122bfb9eb33feb2545ef5144cea79551f7cc5280800f085545989f203978befd777d0db4963134effddc31c8d991ed83eff86e598024001dd7f8ab2d65332af5f168e33329c3363d38619ae10579556f7c568d8cfa").to_vec(), - hex!("80ffff80da3b13b6f4d00e78e5b4f9febe6ebdd907cb93f888684ae98beb244b23c2bfe9808eedebcb5207842de9ca534d8417b005715106e4c89481e45436606b0e7a51a2801fec1d90c30b290a110a2e6abdadc8243d13ab9974e64f618478704c3ab3d26180965db03a23a9608d689bc991515dabf5929cf73813cb71a330a84a61465116aa800db60e6cc6a1bf8cfdf30b0898db1e570400f22dd342a2e395e9f65dd322f838808a72642beadb74458557cfac7f0a094f164726efc64a41664f89d1c6676fed4e80792a15dbb3b1a6756b605c0785572dc15de8342c534890665add81be037faae1805b682132c52908705526057f73ab7fccab4af6d72a9805634dd8d3cc53f130d180c2d44d371e5fc1f50227d7491ad65ad049630361cefb4ab1844831237609f08380613ee4da8696b75f4409975f271bc6a2d8a1b4acdfd4dd617af34e1488d4f66b802701a3a8687f58f9de5c4f1fa21fa40d0a731b3954d58b02ea286c83b1a98d4180721c6d88d612c4dd11022fc52ee952342f6ba9630e4be9307dfa00988f22060180294443dd616e0b3e21617f766ba58dac88ce58224d7caa4dae29fea8ae629f7180e0d0559c10499f45c1162c73a5f19228779cc75762b99c7d9266dfd58ac4d4bd806bfdbbf0e0bedcb993b65c9cea1e929a56d78a3b7bc53d1b7ca6fc488e2295ee80c306d51e0505b64fb65c094b1c003c2188145a47acb2c1a3ad7cf3c239cc08b3").to_vec(), - hex!("9e710b30bd2eab0352ddcc26417aa1945f43803b3441f15daa8a53147d69c48eac75356fab581febbb8030520b248c5942a148803efd73d3f24bd2b3ca3916f50072b3cedcec47eb3c61ebb3318d44b7aa9bde3f802e2e0716043a02f2f29fdd52922704af194b98545ce5ca832255e8ec41bcdb64805777400f9579aadc0324691757c92714c245ff336464684b4e1c166ec4fd25eb505f0e7b9012096b41c4eb3aaf947f6ea4290800004c5f03c716fb8fff3de61a883bb76adb34a2040080bfafab45a320864b3a0037065b596599b16bfb6eb2a837e1c4839577045684654c5f0f4993f016e2d2f8e5f43be7bb2594860400801412850013bc8a13c78289220554c9aabb218bd2d3919b9d55a9cc434d337272").to_vec(), - hex!("9f0b3c252fcb29d88eff4f3de5de4476c350008008c8d0b4cf32fddcde0ace00fa1d052669181c9658ddb0a0e8d967edd7766ed680746cb579dee48fc7153d83cca35a07c60b37660b193012a49a85155d252daa0c").to_vec(), + hex!("3703f5a4efb16ffa83d00700007589ffcbe7fe666f76c721443cf633e6ee45a06f439cb3637c7791cf31b0cdf1").to_vec(), + hex!("8004648031b60c9237ed343094831987f2bec10b211621255ad0b440cf161fa820d30db480f6f6801e4b41e2e6d8ec194dba122bfb9eb33feb2545ef5144cea79551f7cc5280a1e39f80557cd7da7aa27045494d8bafc93f1d1fff00b77bfc4dc87078155a248038b7ab2b0c7e94565e832199accca003b74c41e8f4d881d8034ed8b3c1f08e22").to_vec(), + hex!("80ffff80437bee387434e6e8f91a0739adfdc95ad239020339bc3e99e001b88992670b98804982fd732f232253fcaa75c350ef6e2ad7b587b0a9ffcd3c6be95d25f556bee980de36611e633e4f59d89fe9f3f216fa52bc054b56137e8f55a0092ada207377b9803baf41139df1886d135151e6e64604b4405033b62038878c3f7609c5fab69cdc80a1e407fc0eb00a05fde19c35367d5f6f1ed76d36a4630ae73fb964fc19ec4a6e808b4d66a7c2324664d29962ff7930152e708fdef4213acaa76601b99fb55fb3fa80413bb6d7abf53c1bd3d1adef322b493310c67b82ad106001d06a96211802b723805b682132c52908705526057f73ab7fccab4af6d72a9805634dd8d3cc53f130d180c2d44d371e5fc1f50227d7491ad65ad049630361cefb4ab1844831237609f0838027dbae280a97bff856ec780ad629b86a828f8235af6c212963a83e25b143c0ac80af6bf8534d659672b96174d96a90e7ca58acd3fae4141991b953a5c61b5ce8ab80811f63fc4d3997a103105f26e3dbf4c89911a5aa3e47d52f35b8db960d08680a8015ca3a7de67e0f69f05047887eb2da1673bf8952dbb572659713f7a68e381237800802ced193c37d688d8da534e615665a56713e1846eeca9a92d25ed5691ce9e0806bfdbbf0e0bedcb993b65c9cea1e929a56d78a3b7bc53d1b7ca6fc488e2295ee804e2a451dd1bed45187a8b7d21a1c9f8f0093eac2fb5f6a9cede45bfb7b892a53").to_vec(), + hex!("81039cb1953d2d87454e865602d3631099122bacda46587c417641803ef5445e5812090119bd7ebf90604600d62330c172239485aa5d790b6f5b5278b5664f21e8a5e0db342c83b3ac5cea35aff1d4f9490a6d32e68b95455899ca468cb3c6d66548ed990c066175726120ce027e08000000000452505352886b769249b85767f45cf6dd369674daa53edf47b52af36c92166ea0037890ce2bfd02056175726101013288e0ad4796fba9fbcd75e92c4901561a1e8c728585fa8fb1f4fc6e090d0c2c941024b25a4b029871fb1f74cf71ffdc8a0cf3965ef52b208e6f8b5abca6c685").to_vec(), + hex!("9e710b30bd2eab0352ddcc26417aa1945fc3803b3441f15daa8a53147d69c48eac75356fab581febbb8030520b248c5942a14880027bd77389a90d1bacdc428100d19fe4f8cf389277fc9a99a92dcc013e600fe980f9f5f25fa95e76ac835b9c7dc442eddbe86404477019dbe3c451762011638bd28048d16f61bbf0c00dafa9f54513d948c2f6276f3c89f02a3035fde4a2191e60fd505f0e7b9012096b41c4eb3aaf947f6ea4290800004c5f03c716fb8fff3de61a883bb76adb34a20400800f179c5eb0be8c4a17a77d173c53aa48253116c1bbda3440fd89aa60f7225aaa4c5f0f4993f016e2d2f8e5f43be7bb2594860400806c7b0c0ed8ee4ae71865fb04382fe8667ab03884ae1938bee35817f9e48b34bc80f17b86d932260aaa0f44c42fbf77d966025518e043c509542dfb8fadaaa743a1").to_vec(), + hex!("9f0b3c252fcb29d88eff4f3de5de4476c3500080fb95bb5f127efa46e85746ac0fc594c04b183c773ed7ae2dc9799dc614ad582e807f15a6dde1226da17ff9bef88a51fdd844ab6039e2f2de7703d55e7919a38753").to_vec(), ]); let dip_commitment_proof = DipCommitmentStateProof::new(vec![ - hex!("7f24086f0d72fb64cf00aea16625a4c4ad138e416da9a3fa2302a4d0f367029d1784cbc85d226705684e01a12dfa1fa4ab9a00008030957a9ddde54ceb05cf3b96c348b458026e42b05f2159bf35011bc3957717aa").to_vec(), - hex!("800c8080da28793d083b197f8d92fc3e77f5064436f1d8eea0fbea56ddb936aba65445008027c4fa196c2981e3f0e695d6b20f54626eda4c6b7c048b8e78f538c3003fe594804c1639cc5554613cba6090de44badd65709713a9efac68281cd883904507722f").to_vec(), - hex!("80ffff80353e4d164b13c87910044f1b4e76277e404a0ab46a7cd6c33a65aaadc2375ba88007b1390da34b4dce1328430fd924a6e193517a8148dd70a912c0dc2f7f8d2d4c8008a563235f40d290d669842210155bf39823051d55778d15b44285b58b56db468040f42b645208abd84a2f00e27a227d2dcbc04d593d428b8aaf424494ca9fc3898049e4b5d562b41f98388487036c83400c59c09ae23091f6ea2e37f248f409ed5e801ca59f119820510bcd535f508127ca3fe9c38765c143dbb44be9f556ad3e4a4c8014e3e0704c9a07636322335a3c663ec9fd9df8b7bf71d6e8183fefecfbfe0e50808387a771b3f40eeeca915cd56599105120bd236e9da44122032155f9961c69638073f910fc27a7ebad806ebcea959a18debc401163da29832d9e8d87c13fbd270b80450ee2563f72918bfa60fbee9eeb1523b5c0c03ca4dced71d9896fc30c57157680e83c74d69e5cd6dee4cd34bed845929f515fd99ea8b0f2c9f4f41ee1108695e680ecfada42d946722ae4377aa62c262fe1e7e33b300c0eaa0c6d9451defbc740c580369fc68368609c90c18c4378933b282c57c2973beabb7baad0aef61ef09a7ba480f395b7003a2eb1e39c624b9a707a6cb58c3cb6997932fc80662ae19c785a91f580b5e5172489541dfc581e116554b63de15fddf38ffed2b109394749c20b8f6ce380646ba914c6984d5d37b95687a778e2b80628f739ee223273fdc51e179393e581").to_vec(), - hex!("9e75edf06348b4330d1e88564111cb3d3000505f0e7b9012096b41c4eb3aaf947f6ea42908000080f55a9532867b91cdfb7c67084730fa19f121659a7050b9cf3dce004be452bea4").to_vec(), - hex!("9f0bf19e4ed2927982e234d989e812f3f30401809aeada952657ae61b8e86d7c3cf64315e71658d378e1e0d9a418a97e3fe19c4d8028d2665c55ce38abb47566d37912f1947f6d126e68b86a8656d1ab187a82553f").to_vec(), + hex!("7f2403f9d16616f8b2725e4943c7d52ca3f47645d53dadef3a2fff9347958d6c896a9d8c93d2c77b844f01a12dfa1fa4ab9a00008006c5fe6f90767dabc1300511e799824561398773f9e87db30f62c49ad5820d7f").to_vec(), + hex!("800c8080da28793d083b197f8d92fc3e77f5064436f1d8eea0fbea56ddb936aba654450080844045a19371db591cd5a3a2208e48377af097957887812434f9427425d94d72808d726a582260bcfa0bff4b499c80733fd9435e69d1468c58d365e1a09140af00").to_vec(), + hex!("80ffff80353e4d164b13c87910044f1b4e76277e404a0ab46a7cd6c33a65aaadc2375ba88007b1390da34b4dce1328430fd924a6e193517a8148dd70a912c0dc2f7f8d2d4c80f6530c738de13d0b7d40dacd86b60a8208a9ed8b830213897554539a7d0810bf80a7fcb88bab872bcaa970cd9d2d39b374e879824e0386ca22683a7cceef7288df8027d23a487eecbbe30faec61592e3ac212ea5f0f7ed4a4d26a7ebb13c0ea85ad28019604cca6005d5080b81e4a4947bc7342403bb63f0f2710ed797b77da161e5b58014e3e0704c9a07636322335a3c663ec9fd9df8b7bf71d6e8183fefecfbfe0e5080dbb36019911f2e9e4814cdf9f70000801292c80c454ab64e582c360e6f44879e8081844e130a7097df746d0d33f73217d7c593d7cda07cc51611434937a769711480cabbbb0a75f296a2d28581ddce96b140870ae0323da94c391b5d10645c05d1748010ca42e1b971aa31afb2d49feab11453846fb934130207f8d7414f7db080c5c58079e06e2642b7f259494863c940bae5b86cfbe5ce0c072a12f370f422cac257ab80e34bdb523ca7c77cd0250774f9fdc5c93283fd9ddabcd3670ef85d1130ec21ca80f395b7003a2eb1e39c624b9a707a6cb58c3cb6997932fc80662ae19c785a91f580b5e5172489541dfc581e116554b63de15fddf38ffed2b109394749c20b8f6ce3806c855b252bf486677c75b093345eeb02fb689a5de290e94cf3b5c9a6ec04b140").to_vec(), + hex!("9e75edf06348b4330d1e88564111cb3d3000505f0e7b9012096b41c4eb3aaf947f6ea42908000080d215e80254fa4203351180e8847c71d6394706f65d797084e1700776561165a7").to_vec(), + hex!("9f0bf19e4ed2927982e234d989e812f3f320028071027c3ebff96767415d8e07c7140a0153cd58cd756ccfe4379440db4313741680971fd57cff7255f21a73629696972524c89573193928eaf19b6255f3c96c8f16").to_vec(), ]); let dip_proof = DidMerkleProof::new( vec![ - hex!("80f7eb00000000000000000000000000").to_vec(), - hex!("81016d8b000000000000000000").to_vec(), - hex!("7f0005e69aa86ca4ef945c050f71df4018c40043e57994b70f1ce8d30723b52e78f300").to_vec(), - hex!("7f0003125b5671d675e64bf07c911e6aed00eed230bf5d89b4063faf4d8b2738660000").to_vec(), - hex!("8020020000").to_vec(), - hex!("7ec2a225d9f89d836a1a0918ac43ea276717c82e6555dd2d935c77b55e6a2af700").to_vec(), - hex!("7ebaf365662e138e79e9f20d4b811470421fb5456533f27cb9d86f74ff58338500").to_vec(), - hex!("7f00054c64e7c349536628c7b8dc8bd4f69d23f409ab6b8a2586a0441252b6eec13b00").to_vec(), - hex!("7f0003bfdd8989572fafed46db59551a54167229f94e4c399a8a45680e7f716ff7bb00").to_vec(), - hex!("7f000ef8883295cd31bd47965d3d291ae8f4b8b12b2e7c0346f804ac3c87c9fad44c00").to_vec(), - hex!("7f000068f812b08c085e9c13ebdac3e3e02ca5e4d72f825730ce62c1860133af6ed300").to_vec(), - hex!("8002400000").to_vec(), - hex!("7e5e2ec431e7b58042d14f77082c639609873ef15986d7162ecfb8de44e3d28700").to_vec(), - hex!("7eed7077ac0d92683c6200b724fbdc305854691c80a29bdffefb5ec4a40dac3900").to_vec(), - hex!("7f0005cb1d1b41caf49a644faa643ed53235da11e27bb32dea75a997bf519bb24ef300").to_vec(), - hex!("7f020529c46d67b890ac140fb81c80b4db478ed7f6bcef7de075410ff6e418906bb70000").to_vec(), - hex!("7f0208eae731f8e1832afdfbffbdba974985ddc243c4b21a0b26ea491e537d0a8a230000").to_vec(), - hex!("7f02096cf53b2d24cbf261c63666dc5264a223014143eb53b3068b8a22712f027c670000").to_vec(), - hex!("6f0c663831623736356330643338386364666663636537386500").to_vec(), - hex!("7f0202d18e551945503ab4819410b00a03f9d0837b1ec94dadfbed10a329026b15990000").to_vec(), - hex!("7f020e22736773636ca149240d65840a7a9e8f730c7fb49595924160c10a999a133a0000").to_vec(), - hex!("7f040e2e5a8f885d4e9cf36e7b712dccbc02370a1b9832b086f7546b9b19b8e16a76010300").to_vec(), - hex!("7f020bb048fe494d7a31ee94481770cc65b413767310558907cc12da89c63847dd680000").to_vec(), - hex!("7f020ed56fa195ae408557da06b1fda161bbb3d59decbdf8da11b62d94ba4a97a5050000").to_vec(), - hex!("7f0403a9176af554951693286560dff02ac1839fc78dfd541ae5420fe4add3bd651e010100").to_vec(), - hex!("8000420000").to_vec(), - hex!("7f0178b1f175a02e5e32150ae7467eff3364833fecc8a5854c64cd394ca06348320000").to_vec(), - hex!("7f018df100a81fa9c82787ec56d3abc219dba95d49d4bad8339776dc1ab2bcf4560000").to_vec(), - hex!("7f0402b08a60751c017f70c3d006dc34d94210942562bc5b27af012534d9627dc3d8010000").to_vec(), + hex!("80ffff00000000000000000000000000000000").to_vec(), + hex!("81016fe30000000000000000000000").to_vec(), + hex!("8000090000").to_vec(), + hex!("7e57b214552de5fe2406c4cde2ffadc265478d8f8e45dc78868c256a8b4866ea00").to_vec(), + hex!("7edfe406e27bf7ed8f7c4b06f24679a138799a88cf300fd15a052ae2d53c7eb100").to_vec(), + hex!("8000220000").to_vec(), + hex!("7ed5f08f01da4d5d838c3c0c6426436013f75862be45194ab93e70387bf5095b00").to_vec(), + hex!("7e6843609b10ca26da79c387cc536eb690955855ef4f134114ff23285c5982ba00").to_vec(), + hex!("810f02200000").to_vec(), + hex!("7d01993e9f04f1b8e6f18a5601f44e5103224c4d9765947ceba0a3d1346e123500").to_vec(), + hex!("7d0291ae1f08bfade39e5e36051c8cca6e68b750385d07cc53da6428998e602900").to_vec(), + hex!("801022000000").to_vec(), + hex!("7e41ee4a3d7b38791bb0559cd35ee40b2b156f5ff38a1a6ea687a64457c36f7200").to_vec(), + hex!("7e60adecda557e10c2cd0ba412c2e349302ed097d094ffeb16f4701b2aea618700").to_vec(), + hex!("7e34f655e0fbe25baede3a76e3bcdefb3accb2793c743741eabc5d78a745417700").to_vec(), + hex!("8001040000").to_vec(), + hex!("7e565d8afa2d3b25ab6b46dff8bb283f8c6fe06b316c6e0b1ab049953176727c00").to_vec(), + hex!("7e51018a6697855845a053ee9a4a913254a184bc18afe0dc8e7aaad5a9d1583900").to_vec(), + hex!("7f000ec15fc3b3cc3bd5562654d8feccd64f551a2a66c2723851334fd7c85af6934500").to_vec(), + hex!("7f000bad02837aed37702de843a75f8c00e708aa56c9763f940d9836b25f16fdebeb00").to_vec(), + hex!("7f000647b93db48080f756347726a74aa6fefdc21236cc489846288e16526f172a3b00").to_vec(), + hex!("7f00003c45ee0b9ef5c42548a39c82373e2783e0bd1f5eb14cc26f75c3ae29758d0e00").to_vec(), + hex!("801220000000").to_vec(), + hex!("7eb6affef1466702f4a481ce4131b268602bc30abef3707d15be36ad35088fb300").to_vec(), + hex!("7ee57ddc7dbc5fd1c15deaf1bff17a0b71859b1257ab9be7b065f0c256821c9400").to_vec(), + hex!("7e29b0ee6ed03d272cd55547d3caab97737df03e355d5c64f64554852dd1fdb900").to_vec(), + hex!("8000810000").to_vec(), + hex!("7edd1c9a8fcdcffec717722fe5880e22791e6272a8225542cbd6015ba3a6ce1200").to_vec(), + hex!("7ed7820134975ff44fa50fa08a30cf10dbb7a735916abe422bbdfbe9eda6e12a00").to_vec(), + hex!("8010400000").to_vec(), + hex!("7f01ad53785d4ae768679975217fcbd542eda1ff8db297a50ec8dc27898e05049e0000").to_vec(), + hex!("7f0109af0bb791f497f4dfdc13d4dff877003616017d131edea0aefe3e502850b00000").to_vec(), + hex!("8030000000").to_vec(), + hex!("7f0122395d5823abcdfd65e218f72bb0562cd776ebeca015f69ca5c236cc5b6f340000").to_vec(), + hex!("7f01c21c151275046296c998833f0cd4662dd80fc579789efb04aa6bdd70b0c09f0000").to_vec(), + hex!("8024000000").to_vec(), + hex!("7f0185dabb534a1dbac4048505d6a5a08a3dd3588c75216ba69739e81a08e2b0190000").to_vec(), + hex!("7f01e07a74d48fd0c5fea1e0516488c5c008ea5ecb121f9e585120a7cb4910f8790000").to_vec(), + hex!("8000b400000000").to_vec(), + hex!("7f01373b4e8626dd7207c2d63c210e8e77783d2996c3642112bf6c2a4c545af8790000").to_vec(), + hex!("7f015545772ced78f5aca5f79efc23ad4e053052e013a836933afd0b791c1e8b910000").to_vec(), + hex!("7f01f52a574d0309da3f252087e418a38c8a65e8a3f1f1a98410fff133fa3be95a0000").to_vec(), + hex!("7f0196d60c1d3e3852a27b78078ec12231e7ea4d8104b8729e79b345e01affecc80000").to_vec(), + hex!("805010000000").to_vec(), + hex!("7f0139efc9192269ebad118bbffa93357f6bd93f933280f2ad4e5411a735ed53070000").to_vec(), + hex!("7f01f94df3bfae48938b90ceabff13739ba295fa629ee05b694d310f33f98aa9fa0000").to_vec(), + hex!("8040400000").to_vec(), + hex!("8008800000").to_vec(), + hex!("6c3764623339376438353366633061376437316334633400").to_vec(), + hex!("7e73b5d2054d1db7c4ba5e6249535ab732df806eb8a2d08008e8a452b449260000").to_vec(), + hex!("7f00032aa8e1e570c1affae398a770a1337273742b171dd68a67b9ffc7aba0bf850000").to_vec(), + hex!("8009000000").to_vec(), + hex!("7f032057470eb4fe7c5db309eb60252683b20a50812bf10287dc9aad50af6e2d8b010000").to_vec(), + hex!("7f01d6f6a7d1cce502c8a89b1d8f6b80e96233f5e9238362873fd2f2c64d141c440000").to_vec(), + hex!("8014000000").to_vec(), + hex!("7f01c13b2eae63f486d514d13f5cf0bffc7c6855135fb9b2a9830747f216b59b0b0000").to_vec(), + hex!("7f01254d7ae15cf0c2716ba93140763e2d376b1b3393e7b3ca7432b35f811ceaaa0000").to_vec(), + hex!("802500000000").to_vec(), + hex!("80e000000000").to_vec(), + hex!("8080200000").to_vec(), + hex!("7e65a65164ae787d2cd7a0427ee7877949f7faa361134fccee205205566f360000").to_vec(), + hex!("7e4b0216d27ebace4c78e9f6ef667fc461d17ba3ca17eb772cd6ff107913690000").to_vec(), + hex!("7f0009c44e121b255dfb2d555718f7a57813cc7a2d0d9ac8759771f01ef7e6af150000").to_vec(), + hex!("7f00019f07b226114d1f46beee265ae1d353ddcd089a7ca5de6543bdf83458b37d0000").to_vec(), + hex!("7f01dda56493aac9445d47d3bcf1cd41caed3155d177bec6f13c058d5358a95df00000").to_vec(), + hex!("7f0190a4f5d159310e40a12ec4e537d2dcfe8888a4a00a6552813aaaf50ef34e850000").to_vec(), + hex!("802014000000").to_vec(), + hex!("7f0146e967c30f86f51eccceef9a80b7296467433dd5498162a9a4b163b6d1560d0000").to_vec(), + hex!("7f01fdf7bc3f9ebadd02ccfefb9ec43b4224a45aa09a78ccb045f1dde5152a87c60000").to_vec(), + hex!("8000500000").to_vec(), + hex!("7f00097f45183745a2380e1617eb8b28408676557162610b83dce4b58e3f2d78110000").to_vec(), + hex!("7f000f6e2304900b1fe24a34364ee86cd8fb538deb341b38b7664dad4e1a98752a0000").to_vec(), + hex!("80a21000000000").to_vec(), + hex!("7f0105c3bf07b7576c64cf1b9badadb7369288be3199d5704b0c234082b7e99ca40000").to_vec(), + hex!("8002200000").to_vec(), + hex!("7f0008c7c53f036b88ff2bf3a34cc3787d4e821180ea4ebcb925223e065b4eeb6c0000").to_vec(), + hex!("7f000fe34120b267f1ed19b878e2b1b638ae8e686a31b8c18c31d3f0444f0156a30000").to_vec(), + hex!("7f01b03baef5dfddc8a288f54cfd0950ee1517d9825f04d3e0fd5fc284453393520000").to_vec(), + hex!("7f0146d945efbc4811794e5d0f6a1c9a650d7edea807053095ab1c164cc00d51410000").to_vec(), + hex!("8010800000").to_vec(), + hex!("7f010932bdb2cc79743bf17dc42d23db09ee707e727282f45e4e2cd690e12c03810000").to_vec(), + hex!("7f017db1acaaa2340dcf5e35319168afc89254ed996b09cd4dfebdeccbba82d8770000").to_vec(), + hex!("800c130000000000").to_vec(), + hex!("7f010b5cded04e606f5c22c9fc5a0493e431932b3bae31ec202e4d4ac95a1303e80000").to_vec(), + hex!("7f014835eb41231b08afbbc0ee552e6a5a9c6e4acec73b9a86b790d3e7e1b89dc80000").to_vec(), + hex!("7f01a3c84cb233a90760bbf2e38cd37d0a84e7c8c17f4a2f473edb492746f536080000").to_vec(), + hex!("7f010e7019faab3641dca2868a4e7dcab49b57b29c681f291d796c798bf6f841540000").to_vec(), + hex!("7f0153282ed059a09a60806750a25da29e2b36456c87493f3db0b5ce0cc28a08f10000").to_vec(), + hex!("806c0000000000").to_vec(), + hex!("7f03a11be47d883068a1e29c68fcbd9a73a6662c8ab530e076d64120482aa54774010300").to_vec(), + hex!("7f013f6c1c5c18136d873c6e13c4f0f750f038bee17f5743dd84a56d02ec4720910000").to_vec(), + hex!("7f019aa42ff358de40f6124c2ee7bd9b81abcf91542f372685c7bb5bf8882dd7740000").to_vec(), + hex!("7f0130fd748ce3e1d64895244625a084f9b978cac67e3625c791283348a11f50220000").to_vec(), + hex!("802110000000").to_vec(), + hex!("7f03ba0c668b63f955f65585f2986a049582d3e4ae1ac5e55a95907b61ca91c4e5010100").to_vec(), + hex!("7f01c35c1674360f8a969b42fa1e7df3cacdb0266dfb8f95a5b88f61ed576fe7120000").to_vec(), + hex!("8000900000").to_vec(), + hex!("7f00053320f8f37ffb3d441f24b416a3275c304e6fde6ecda2831e951deb94e7c50000").to_vec(), + hex!("7f000183acf9f02c4f1493bb81621d8b2d62a2afd0f4e80b4479bc7a6ea1ee2f4c0000").to_vec(), + hex!("80442800000000").to_vec(), + hex!("7f014ccca248d7952f3f007f42b2e6cb436db45c2bb929668249eac79868039eed0000").to_vec(), + hex!("7f01a63ade95a0104c3b77b7becdcb6d4c0a3de7de703a774988cd38a8ca3d6a420000").to_vec(), + hex!("7f015cd198788a5625ee35d32eb0d51e9f18e8f7ee520bf4cb587a813b2802506d0000").to_vec(), + hex!("8000840000").to_vec(), + hex!("7f0007cdc5272176810379f1ef7c49cc15cf5493a2d41a1d0110bf9a96127c44720000").to_vec(), + hex!("7f000914ff74aff344cd0891c27000c06d83be335175e86586ccf3b8d0dc513c830000").to_vec(), ], vec![ RevealedDidKey { - id: hex!("f2b08a60751c017f70c3d006dc34d94210942562bc5b27af012534d9627dc3d8").into(), + id: hex!("602057470eb4fe7c5db309eb60252683b20a50812bf10287dc9aad50af6e2d8b").into(), relationship: DidVerificationKeyRelationship::Authentication.into(), details: DidPublicKeyDetails { key: DidVerificationKey::Sr25519(sr25519::Public(hex!( - "aea16625a4c4ad138e416da9a3fa2302a4d0f367029d1784cbc85d226705684e" + "5e4943c7d52ca3f47645d53dadef3a2fff9347958d6c896a9d8c93d2c77b844f" ))) .into(), - block_number: 26, + block_number: 65, }, } .into(), RevealedDidKey { - id: hex!("0123125b5671d675e64bf07c911e6aed00eed230bf5d89b4063faf4d8b273866").into(), + id: hex!("14ad53785d4ae768679975217fcbd542eda1ff8db297a50ec8dc27898e05049e").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "01588da8661499cdcdcdd8cb2cad3f025ccfd81dc68e89ea271a72f4a2632a74" + "b592fcc2bfb5e53dbd40a9997dbf0e0842e4d2487764fbae065656d2a39cf602" )) .into(), - block_number: 26, + block_number: 65, }, } .into(), RevealedDidKey { - id: hex!("1529c46d67b890ac140fb81c80b4db478ed7f6bcef7de075410ff6e418906bb7").into(), + id: hex!("1e09af0bb791f497f4dfdc13d4dff877003616017d131edea0aefe3e502850b0").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "6dbf487eb115549616188f18b065ed0b8250eec0932b6dc12af47365215e833d" + "40c406ffa3475fa5b52446b4b94232aca86e9c50daef7dbc5a4b96a64337df38" )) .into(), - block_number: 26, + block_number: 65, }, } .into(), RevealedDidKey { - id: hex!("28eae731f8e1832afdfbffbdba974985ddc243c4b21a0b26ea491e537d0a8a23").into(), + id: hex!("2422395d5823abcdfd65e218f72bb0562cd776ebeca015f69ca5c236cc5b6f34").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "7a6c0ad3cf5f3121f8ee1dfb98543c8e39e1a71bda6ca8b94af9f384d7bfb44f" + "3f18b1e4225bb527981502dc337a2966f73541bef4fe9975a2a285bc192bc61f" )) .into(), - block_number: 26, + block_number: 65, }, } .into(), RevealedDidKey { - id: hex!("496cf53b2d24cbf261c63666dc5264a223014143eb53b3068b8a22712f027c67").into(), + id: hex!("25c21c151275046296c998833f0cd4662dd80fc579789efb04aa6bdd70b0c09f").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "143cdc8c7ac305ca85385d1fd47277775b9a6d5a3595a98cfc8676a9d2274449" + "14a576035c1b71c705f1158bea900e5317dd140b64d161fbe9b9f849b3e38647" )) .into(), - block_number: 26, + block_number: 65, }, } .into(), RevealedDidKey { - id: hex!("62d18e551945503ab4819410b00a03f9d0837b1ec94dadfbed10a329026b1599").into(), + id: hex!("3285dabb534a1dbac4048505d6a5a08a3dd3588c75216ba69739e81a08e2b019").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "e2d9f974b8d5483ca6c2f82750889bcde7c7c5b1f5ed5c871dab09c2518fd75c" + "449e1d268626a9b3abd8a09077a0fc2414af2e33bc88e5a13f6cd4e487ef8359" )) .into(), - block_number: 26, + block_number: 65, }, } .into(), RevealedDidKey { - id: hex!("7e22736773636ca149240d65840a7a9e8f730c7fb49595924160c10a999a133a").into(), + id: hex!("35e07a74d48fd0c5fea1e0516488c5c008ea5ecb121f9e585120a7cb4910f879").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "095de33b750ba03738cc2ca30920b1758318145e7f96b6ce952177b1f5714229" + "979b9f342464eb32b53ad5471020e5476d798b23fa48c8ead7d8a2e63adee276" )) .into(), - block_number: 26, + block_number: 65, }, } .into(), RevealedDidKey { - id: hex!("9bb048fe494d7a31ee94481770cc65b413767310558907cc12da89c63847dd68").into(), + id: hex!("4a373b4e8626dd7207c2d63c210e8e77783d2996c3642112bf6c2a4c545af879").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "014154bcc7195582e2ad289604082a3b0f23af6ba70bc24ddbc36c5e9c622f21" + "f5e7dd973db0ebd5669e5c9d83ec8bd55043df5abc0eb9a7c34ae96e29dcda6f" )) .into(), - block_number: 26, + block_number: 65, }, } .into(), RevealedDidKey { - id: hex!("bed56fa195ae408557da06b1fda161bbb3d59decbdf8da11b62d94ba4a97a505").into(), + id: hex!("4c5545772ced78f5aca5f79efc23ad4e053052e013a836933afd0b791c1e8b91").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "6922c04846b47fcc23a1936e95457183ed3c4f155624a23f50bfeb14e8647466" + "fc96617a9f5e81e0b5c03edc321247909c39e8d7ffaac7635b8e39110faea061" )) .into(), - block_number: 26, + block_number: 65, }, } .into(), RevealedDidKey { - id: hex!("e978b1f175a02e5e32150ae7467eff3364833fecc8a5854c64cd394ca0634832").into(), + id: hex!("4df52a574d0309da3f252087e418a38c8a65e8a3f1f1a98410fff133fa3be95a").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "f5437452eef8fa791b1bd66c24ad01bae3da4f04ec93a7525f5d1100d3cb4e14" + "27777600efa700166c1055649db55c6a87afeb5f2edf4800e9f81815c3108d50" )) .into(), - block_number: 26, + block_number: 65, }, } .into(), RevealedDidKey { - id: hex!("ee8df100a81fa9c82787ec56d3abc219dba95d49d4bad8339776dc1ab2bcf456").into(), + id: hex!("4f96d60c1d3e3852a27b78078ec12231e7ea4d8104b8729e79b345e01affecc8").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "72225bb468e6dfead4afe19d7b5971c6934896fb0563e9a03224c27c5c12ca72" + "24acf15ac6929d13fe510e1758a39d685533e4c95761339420584c4565be1875" )) .into(), - block_number: 26, + block_number: 65, }, } .into(), RevealedDidKey { - id: hex!("d3a9176af554951693286560dff02ac1839fc78dfd541ae5420fe4add3bd651e").into(), + id: hex!("5439efc9192269ebad118bbffa93357f6bd93f933280f2ad4e5411a735ed5307").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "aa6650e9d42479acb868e673bc129321548a2eed3f9a70304dfbd03e74e0640d" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("56f94df3bfae48938b90ceabff13739ba295fa629ee05b694d310f33f98aa9fa").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "fd49a178ab2711d9b9954334eafca36f21c8eb703a45a776efa9b2d15540c92c" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("5c6f73b5d2054d1db7c4ba5e6249535ab732df806eb8a2d08008e8a452b44926").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "96ac75cb8b69d3914a729e80093b178614057a8c69ccf35a96b091703391e978" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("5ce32aa8e1e570c1affae398a770a1337273742b171dd68a67b9ffc7aba0bf85").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "38671bfbe4da1c55cca5efadbfdeede7e67c801a99f8eff995fdf734d3d39a37" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("63d6f6a7d1cce502c8a89b1d8f6b80e96233f5e9238362873fd2f2c64d141c44").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "dbe3fc55ce46b8e0e41bbfd9ec9e33fd62bfc838ad03e5d17042f83d88305e77" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("72c13b2eae63f486d514d13f5cf0bffc7c6855135fb9b2a9830747f216b59b0b").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "bcbddd68269c2172e242837cc587bd95b7d6326ba1a21507777cc5cbf81ebf52" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("74254d7ae15cf0c2716ba93140763e2d376b1b3393e7b3ca7432b35f811ceaaa").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "f9b0e62da4bc84bd266b90ff4b5d00aa5d1c910eab72f4a401e4db64d6aef614" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("805765a65164ae787d2cd7a0427ee7877949f7faa361134fccee205205566f36").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "1ce9eacca63e71090633182e317781fc4ce24e4a07e884da787eabbc52f90c5d" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("805d4b0216d27ebace4c78e9f6ef667fc461d17ba3ca17eb772cd6ff10791369").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "a117665f28ede7a0df6cdefb9c33753d667d5b65909611bd576798fe3de35360" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("8069c44e121b255dfb2d555718f7a57813cc7a2d0d9ac8759771f01ef7e6af15").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "8507c4a02f173edc4f85317e9b765ac4c15a682cde800e5d853adf8c345aba3e" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("80719f07b226114d1f46beee265ae1d353ddcd089a7ca5de6543bdf83458b37d").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "b4b3f9dd5fe448cd31a1cc2276f02934c5b4b3287bf2cb0ba466be4db0e41656" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("82dda56493aac9445d47d3bcf1cd41caed3155d177bec6f13c058d5358a95df0").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "7b88d2a3a7dd19a4c2a2ef766facbc59136c77744c9a7625b80446a1ee63770f" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("8590a4f5d159310e40a12ec4e537d2dcfe8888a4a00a6552813aaaf50ef34e85").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "2cc6176fecee453f1403277b5b4c56597f8b1d585f970243249c17b3b2b61038" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("9546e967c30f86f51eccceef9a80b7296467433dd5498162a9a4b163b6d1560d").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "f3daf4c51548d0542efa8880e5ea7ff0a6669d02cf7910c576cdfcd9ee278115" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("9afdf7bc3f9ebadd02ccfefb9ec43b4224a45aa09a78ccb045f1dde5152a87c6").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "6c146a8d09e29c042a1790ae2a26e1d59d6ba9f43d130008db58347fc3284453" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("9cc97f45183745a2380e1617eb8b28408676557162610b83dce4b58e3f2d7811").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "01da52dfd25f59f1938974e127ab6a61f3f66b64c4d47e2a1bd1e4db45a8fc5a" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("9cef6e2304900b1fe24a34364ee86cd8fb538deb341b38b7664dad4e1a98752a").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "c93aa6c996c80f74195b7b32b79f4b33668857ef477b29f9e60ee9531ab85800" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("a105c3bf07b7576c64cf1b9badadb7369288be3199d5704b0c234082b7e99ca4").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "0326177df0d4a3a0b520682e8a1f07a3c1bdc05d102744e31a7ef16c4224b36a" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("a518c7c53f036b88ff2bf3a34cc3787d4e821180ea4ebcb925223e065b4eeb6c").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "73bd63787af4bd759b9705fe0427bdffa9213c0ea7ec6ea6441e6ce2a2f1aa33" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("a5dfe34120b267f1ed19b878e2b1b638ae8e686a31b8c18c31d3f0444f0156a3").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "97592a0630ba772ff25d8e44f0923e74a407e20588faac07e2e99f3fc7569f40" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("a7b03baef5dfddc8a288f54cfd0950ee1517d9825f04d3e0fd5fc28445339352").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "99b5d7f045c444f5c7b10d9a8c4a35e9fcf570e9dac2a313ec719ad10182b838" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("ac46d945efbc4811794e5d0f6a1c9a650d7edea807053095ab1c164cc00d5141").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "0bd02dcc95c971dd82e0df2ef093b6dd35dba13b87de1f784e2ecdbd6f0b4018" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("b40932bdb2cc79743bf17dc42d23db09ee707e727282f45e4e2cd690e12c0381").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "0aeea7d0d826cf245427cae46e9936cd980676a9e7a67c8f2c6abe44ecd15031" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("bf7db1acaaa2340dcf5e35319168afc89254ed996b09cd4dfebdeccbba82d877").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "86544d9dc2e9e040fa863c2931b9cf19bf2ccfdea0763b0b43c10d9b315a7a07" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("c20b5cded04e606f5c22c9fc5a0493e431932b3bae31ec202e4d4ac95a1303e8").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "b33918a4bd6691a2fdcc5851ad098a096eed6037c60fd2b7744973fc0362475a" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("c34835eb41231b08afbbc0ee552e6a5a9c6e4acec73b9a86b790d3e7e1b89dc8").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "5cb3d63b83b81bb32beb7812207838df72e251d51546f1f1aedd8b5eeefae301" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("c8a3c84cb233a90760bbf2e38cd37d0a84e7c8c17f4a2f473edb492746f53608").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "aa4d43c1816f8f31cbdb669449917779b38249bf554fc76cec25316b33f5aa26" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("c90e7019faab3641dca2868a4e7dcab49b57b29c681f291d796c798bf6f84154").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "daf05f0523aa08837a2ca4697bef006c0a361813db80061f9d75d7607036e90b" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("cc53282ed059a09a60806750a25da29e2b36456c87493f3db0b5ce0cc28a08f1").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "1e382ba8ead527d8377e5ebf3a3bee6b3d4b6fee2f71f1381be79148c2b8457a" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("d33f6c1c5c18136d873c6e13c4f0f750f038bee17f5743dd84a56d02ec472091").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "b75d34b52629725ca611f05c92e7b8ab2c012081d83ba2b493cec265a23c5b5d" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("d59aa42ff358de40f6124c2ee7bd9b81abcf91542f372685c7bb5bf8882dd774").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "50e9d2ba03660e5386263c25b68a35222d450677e9faab7245f0981455345c21" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("d630fd748ce3e1d64895244625a084f9b978cac67e3625c791283348a11f5022").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "a89fd540aa526d06c4217cc503664c9e8d8b668634befc304f0b455234cee73f" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("e5c35c1674360f8a969b42fa1e7df3cacdb0266dfb8f95a5b88f61ed576fe712").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "546bca48d552ee30e75384a891fb0a0fad3c0508c0488d3e274152d1cd1b8f7e" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("ecc53320f8f37ffb3d441f24b416a3275c304e6fde6ecda2831e951deb94e7c5").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "994b26c2282d4fa54257dd772c7946099b484be85447a86e000ac9e8955b9013" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("ecf183acf9f02c4f1493bb81621d8b2d62a2afd0f4e80b4479bc7a6ea1ee2f4c").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "5da8b96bd0dfc4309ab0bedfe81d026c7737cd1af648004abd621e6b17578228" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("f24ccca248d7952f3f007f42b2e6cb436db45c2bb929668249eac79868039eed").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "3f3fa3a63df3a1ca6d1669f5d08e5f036cb7a8b0f6b51b82e55c921f85a9ee32" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("f6a63ade95a0104c3b77b7becdcb6d4c0a3de7de703a774988cd38a8ca3d6a42").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "433cde68cf1af4785decf8e6c8c2caccc9ec2c3386d7fd9bc94368a7f8d4453f" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("fb5cd198788a5625ee35d32eb0d51e9f18e8f7ee520bf4cb587a813b2802506d").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "bc9db68c0ef1feb18ae9d4cb129a6af40308d9eb134e1c27fa3ed37ac836b15b" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("fda7cdc5272176810379f1ef7c49cc15cf5493a2d41a1d0110bf9a96127c4472").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "05806aed54131797a26027561c3a4932cf03f1fe55fd26371bf696029ad88e38" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("fdf914ff74aff344cd0891c27000c06d83be335175e86586ccf3b8d0dc513c83").into(), + relationship: DidKeyRelationship::Encryption, + details: DidPublicKeyDetails { + key: DidEncryptionKey::X25519(hex!( + "5d68a6b1cf91e0e69a17c2e2a8151f65bbb1f0594c879dfc1a86c0a7d6274f6e" + )) + .into(), + block_number: 65, + }, + } + .into(), + RevealedDidKey { + id: hex!("e0ba0c668b63f955f65585f2986a049582d3e4ae1ac5e55a95907b61ca91c4e5").into(), relationship: DidVerificationKeyRelationship::CapabilityDelegation.into(), details: DidPublicKeyDetails { key: DidVerificationKey::Ed25519(ed25519::Public(hex!( - "d790fd1b9eb633be20d16d381fdecf6cc826357164059a0fa2e44a4964551088" + "fe08d9dfaf751d9bc1ab6d38884055f913680f1bf5e9cd4ed118b7534ce89a13" ))) .into(), - block_number: 26, + block_number: 65, }, } .into(), RevealedDidKey { - id: hex!("8e2e5a8f885d4e9cf36e7b712dccbc02370a1b9832b086f7546b9b19b8e16a76").into(), + id: hex!("d2a11be47d883068a1e29c68fcbd9a73a6662c8ab530e076d64120482aa54774").into(), relationship: DidVerificationKeyRelationship::AssertionMethod.into(), details: DidPublicKeyDetails { key: DidVerificationKey::Ed25519(ed25519::Public(hex!( - "71b66f3e5594cff1df7373e7795739219a0acdeebe6bd7f691783fee120b5747" + "b3d80300165e3b9d46528c0c0f37edcd1d80e0c31c3ce2b2f248765b755292b7" ))) .into(), - block_number: 26, + block_number: 65, }, } .into(), RevealedAccountId( - AccountId32::new(hex!("9068f812b08c085e9c13ebdac3e3e02ca5e4d72f825730ce62c1860133af6ed3")).into(), + AccountId32::new(hex!("6ec15fc3b3cc3bd5562654d8feccd64f551a2a66c2723851334fd7c85af69345")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("e4e57ddc7dbc5fd1c15deaf1bff17a0b71859b1257ab9be7b065f0c256821c94")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("2f11993e9f04f1b8e6f18a5601f44e5103224c4d9765947ceba0a3d1346e1235")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("19d5f08f01da4d5d838c3c0c6426436013f75862be45194ab93e70387bf5095b")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("9647b93db48080f756347726a74aa6fefdc21236cc489846288e16526f172a3b")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("50565d8afa2d3b25ab6b46dff8bb283f8c6fe06b316c6e0b1ab049953176727c")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("0bdfe406e27bf7ed8f7c4b06f24679a138799a88cf300fd15a052ae2d53c7eb1")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("3960adecda557e10c2cd0ba412c2e349302ed097d094ffeb16f4701b2aea6187")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("1d6843609b10ca26da79c387cc536eb690955855ef4f134114ff23285c5982ba")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("f8dd1c9a8fcdcffec717722fe5880e22791e6272a8225542cbd6015ba3a6ce12")).into(), + ) + .into(), + RevealedAccountId( + AccountId32::new(hex!("ed29b0ee6ed03d272cd55547d3caab97737df03e355d5c64f64554852dd1fdb9")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("554c64e7c349536628c7b8dc8bd4f69d23f409ab6b8a2586a0441252b6eec13b")).into(), + AccountId32::new(hex!("ffd7820134975ff44fa50fa08a30cf10dbb7a735916abe422bbdfbe9eda6e12a")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("8ef8883295cd31bd47965d3d291ae8f4b8b12b2e7c0346f804ac3c87c9fad44c")).into(), + AccountId32::new(hex!("e1b6affef1466702f4a481ce4131b268602bc30abef3707d15be36ad35088fb3")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("63bfdd8989572fafed46db59551a54167229f94e4c399a8a45680e7f716ff7bb")).into(), + AccountId32::new(hex!("0857b214552de5fe2406c4cde2ffadc265478d8f8e45dc78868c256a8b4866ea")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("b15e2ec431e7b58042d14f77082c639609873ef15986d7162ecfb8de44e3d287")).into(), + AccountId32::new(hex!("2fd291ae1f08bfade39e5e36051c8cca6e68b750385d07cc53da6428998e6029")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("39baf365662e138e79e9f20d4b811470421fb5456533f27cb9d86f74ff583385")).into(), + AccountId32::new(hex!("3441ee4a3d7b38791bb0559cd35ee40b2b156f5ff38a1a6ea687a64457c36f72")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("beed7077ac0d92683c6200b724fbdc305854691c80a29bdffefb5ec4a40dac39")).into(), + AccountId32::new(hex!("8bad02837aed37702de843a75f8c00e708aa56c9763f940d9836b25f16fdebeb")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("f5cb1d1b41caf49a644faa643ed53235da11e27bb32dea75a997bf519bb24ef3")).into(), + AccountId32::new(hex!("5a51018a6697855845a053ee9a4a913254a184bc18afe0dc8e7aaad5a9d15839")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("05e69aa86ca4ef945c050f71df4018c40043e57994b70f1ce8d30723b52e78f3")).into(), + AccountId32::new(hex!("d03c45ee0b9ef5c42548a39c82373e2783e0bd1f5eb14cc26f75c3ae29758d0e")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("35c2a225d9f89d836a1a0918ac43ea276717c82e6555dd2d935c77b55e6a2af7")).into(), + AccountId32::new(hex!("3d34f655e0fbe25baede3a76e3bcdefb3accb2793c743741eabc5d78a7454177")).into(), ) .into(), RevealedWeb3Name { - web3_name: b"f81b765c0d388cdffcce78e".to_vec().try_into().unwrap(), - claimed_at: 26, + web3_name: b"c7db397d853fc0a7d71c4c4".to_vec().try_into().unwrap(), + claimed_at: 65, } .into(), ], ); - let signature = TimeBoundDidSignature::new(DidSignature::Sr25519(sr25519::Signature(hex!("804e4e48dc9dc920e14edb8d3590c1bbc3523c60088d7a71250c3e30a265b77704d7e244bfed86a42126a326c7ed15ae707c888b788202c8e9c488071859228a"))), 79 as BlockNumberFor); + let signature = TimeBoundDidSignature::new(DidSignature::Sr25519(sr25519::Signature(hex!("3004ba5f86d048439a9abdf36eeaea90decf5391d9ad4a2b4c4ba11137c7447c92f841018defc2ffa1054e5da6656ad1ddd7ac015fdec902bf98fd4f707b4b80"))), 57 as BlockNumberFor); let proof = ParachainDipDidProof::new(provider_head_state_proof, dip_commitment_proof, dip_proof, signature); BlockHash::insert( 0, - H256(hex!("8704d60f04d95d6cd6b774a84582b251a3129bb8f88b5c564447a76f31d0857b")), + H256(hex!("c4a31d219fa5fe2dfa9160a2e664f33965f019732f2dd5249168066c1bfb6aae")), ); LatestRelayHeads::insert( - 97, + PROOF_RELAY_BLOCK, RelayParentInfo { relay_parent_storage_root: H256(hex!( - "5977f2b96c1982d205055cfd1ce41592e9cd435770f62d7e11b9583d25fa67a8" + "baab06b3fca8881e14a954e81fac724bd3967e30f24a0eb234602180516cb164" )), }, ); @@ -395,10 +992,10 @@ impl kilt_support::traits::GetWorstCase for ProviderTemplateProofVerifierWrapper text: b"Hello, world!".to_vec().try_into().unwrap(), } .into(), - // 4rs36nx5DuPgvJMs5bd2C8X8ySnGnc8KLsP2BUuJbxtYWEBn - subject: DidIdentifier::new(hex!("aea16625a4c4ad138e416da9a3fa2302a4d0f367029d1784cbc85d226705684e")), - // 4pMywUEABML35y2feheNsQDJFqYVTrUZbCww7XLRMkZxfmbm - submitter: AccountId::new(hex!("40002ce6270685b06ea56b9f5594efc9422ae8e498ee202ef3d886d84c4b343e")), + // 4q3h66CC45jSL5dpcY4B9BWUeJtPFgwVQr4BAW7HEEmy5iZp + subject: DidIdentifier::new(hex!("5e4943c7d52ca3f47645d53dadef3a2fff9347958d6c896a9d8c93d2c77b844f")), + // 4oq393G4AHrbTR33D4t45HXm4myUYiXJwiSXQZETAsFiJqYW + submitter: AccountId::new(hex!("286656971deb16389ba37da9d8dd8ee331ccfb8780f05c705c2c938f1f6b030b")), } } } From dfe812fb90f8b34c24712774cdbc958253557679 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Wed, 6 Mar 2024 10:15:20 +0100 Subject: [PATCH 12/14] Fix compilation issues --- .../src/verifier/relaychain/mod.rs | 49 ++++++++++++++++++- dip-template/runtimes/dip-consumer/src/dip.rs | 5 +- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs b/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs index 4702ca5167..e3d98bd74c 100644 --- a/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs +++ b/crates/kilt-dip-primitives/src/verifier/relaychain/mod.rs @@ -32,7 +32,7 @@ use crate::{ merkle_proofs::v0::RevealedDidKey, traits::{DipCallOriginFilter, GetWithArg, GetWithoutArg, Incrementable}, utils::OutputOf, - DipOriginInfo, + DipOriginInfo, RelayDipDidProof, }; pub mod v0; @@ -55,7 +55,7 @@ pub enum VersionedRelaychainStateProof< KiltLinkableAccountId, > { V0( - crate::merkle_proofs::v0::RelayDipDidProof< + RelayDipDidProof< ConsumerBlockNumber, ConsumerBlockHasher, KiltDidKeyId, @@ -67,6 +67,51 @@ pub enum VersionedRelaychainStateProof< ), } +impl< + ConsumerBlockNumber: Copy + Into + TryFrom, + ConsumerBlockHasher: Hash, + KiltDidKeyId, + KiltAccountId, + KiltBlockNumber, + KiltWeb3Name, + KiltLinkableAccountId, + > + From< + RelayDipDidProof< + ConsumerBlockNumber, + ConsumerBlockHasher, + KiltDidKeyId, + KiltAccountId, + KiltBlockNumber, + KiltWeb3Name, + KiltLinkableAccountId, + >, + > + for VersionedRelaychainStateProof< + ConsumerBlockNumber, + ConsumerBlockHasher, + KiltDidKeyId, + KiltAccountId, + KiltBlockNumber, + KiltWeb3Name, + KiltLinkableAccountId, + > +{ + fn from( + value: RelayDipDidProof< + ConsumerBlockNumber, + ConsumerBlockHasher, + KiltDidKeyId, + KiltAccountId, + KiltBlockNumber, + KiltWeb3Name, + KiltLinkableAccountId, + >, + ) -> Self { + Self::V0(value) + } +} + pub const DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_COUNT: u32 = 128; pub const DEFAULT_MAX_PROVIDER_HEAD_PROOF_LEAVE_SIZE: u32 = 1024; pub const DEFAULT_MAX_DIP_COMMITMENT_PROOF_LEAVE_COUNT: u32 = 128; diff --git a/dip-template/runtimes/dip-consumer/src/dip.rs b/dip-template/runtimes/dip-consumer/src/dip.rs index b48ca75a43..6dae64d40d 100644 --- a/dip-template/runtimes/dip-consumer/src/dip.rs +++ b/dip-template/runtimes/dip-consumer/src/dip.rs @@ -60,7 +60,8 @@ pub type ProviderTemplateProofVerifier = KiltVersionedParachainVerifier< pub type MerkleProofVerifierInput = >::Proof; pub type MerkleProofVerifierOutput = >::VerificationResult; -// Wrapper around the verifier to implement the `GetWorstCase` trait. +// Wrapper around the verifier to implement the `GetWorstCase` trait (required +// due to orphan rule). pub struct ProviderTemplateProofVerifierWrapper; // Delegate verification logic to the specialized version of @@ -1008,6 +1009,8 @@ mod worst_case_tests { use crate::{dip::MAX_PROVIDER_REVEALABLE_KEYS_COUNT, ProviderTemplateProofVerifierWrapper}; + // Test that the worst case actually refers to the worst case that the provider + // can generate. #[test] fn worst_case_max_limits() { sp_io::TestExternalities::default().execute_with(|| { From bfc7ae5bad1512be37e0b357e0626bb285cbc162 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Thu, 7 Mar 2024 14:37:56 +0100 Subject: [PATCH 13/14] Post-rebase fixes --- .../merkle_proofs/v0/provider_state/mod.rs | 33 ------------------- .../merkle_proofs/v0/provider_state/tests.rs | 8 ++--- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs index 8e91c1cbc2..c4e2fe271c 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/mod.rs @@ -128,39 +128,6 @@ impl< } } -#[cfg(test)] -impl< - RelayBlockNumber, - KiltDidKeyId, - KiltAccountId, - KiltBlockNumber, - KiltWeb3Name, - KiltLinkableAccountId, - ConsumerBlockNumber, - > - ParachainDipDidProof< - RelayBlockNumber, - KiltDidKeyId, - KiltAccountId, - KiltBlockNumber, - KiltWeb3Name, - KiltLinkableAccountId, - ConsumerBlockNumber, - > where - KiltDidKeyId: Default, - KiltBlockNumber: Default, - ConsumerBlockNumber: Default, -{ - pub(crate) fn with_provider_head_proof(provider_head_proof: ProviderHeadStateProof) -> Self { - Self { - provider_head_proof, - dip_commitment_proof: Default::default(), - dip_proof: Default::default(), - signature: Default::default(), - } - } -} - impl< RelayBlockNumber, KiltDidKeyId, diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/tests.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/tests.rs index 1790c8b0ad..7b8182c3e9 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/tests.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/tests.rs @@ -168,7 +168,7 @@ mod parachain_dip_did_proof { // Remove last part of the blinded component to get an invalid proof let (_, invalid_blinded_proof) = provider_head_proof.proof.split_last().unwrap(); let invalid_provider_head_proof = ProviderHeadStateProof { - proof: invalid_blinded_proof.iter().cloned().into(), + proof: invalid_blinded_proof.to_owned(), ..provider_head_proof }; let proof = @@ -384,7 +384,7 @@ mod dip_did_proof_with_verified_relay_state_root { let (parachain_state_root, dip_commitment_proof) = get_dip_commitment_proof(); // Remove last part of the blinded component to get an invalid proof. let (_, invalid_blinded_proof) = dip_commitment_proof.0.split_last().unwrap(); - let invalid_dip_commitment_proof = DipCommitmentStateProof(invalid_blinded_proof.iter().cloned().into()); + let invalid_dip_commitment_proof = DipCommitmentStateProof(invalid_blinded_proof.to_owned()); let proof = DipDidProofWithVerifiedStateRoot::<_, (), (), (), (), (), ()>::with_state_root_and_dip_commitment_proof( parachain_state_root, @@ -534,9 +534,9 @@ mod dip_did_proof_with_verified_subject_commitment { fn verify_dip_proof_invalid_proof() { let proof = DipDidProofWithVerifiedSubjectCommitment::<_, (), (), (), (), (), ()>::with_commitment_and_dip_proof( - H256::default(), + H256([100; 32]), DidMerkleProof { - blinded: Default::default(), + blinded: vec![vec![100; 32]], revealed: Default::default(), }, ); From f4a94f0edb452a53a0ff42b8ddd1710e61f6a248 Mon Sep 17 00:00:00 2001 From: Antonio Date: Thu, 28 Mar 2024 08:31:31 +0100 Subject: [PATCH 14/14] fix: change DIP components storage hashers (#613) Changing the storage hasher before we deploy on production, otherwise we would then need a migration strategy. I think we can disregard any migrations on our testnets, as the effort is not justified. I also lowered the limits of the DIP provider template, which were higher than Peregrine, so that it is faster to generate the benchmark worst case. Related to https://github.com/KILTprotocol/kilt-node/pull/601, based on top of https://github.com/KILTprotocol/kilt-node/pull/612. --- .../merkle_proofs/v0/provider_state/tests.rs | 51 +- crates/kilt-dip-primitives/src/utils.rs | 2 +- .../src/verifier/parachain/v0/mock.rs | 54 +- dip-template/runtimes/dip-consumer/src/dip.rs | 764 +++--------------- dip-template/runtimes/dip-provider/src/dip.rs | 2 +- dip-template/runtimes/dip-provider/src/lib.rs | 7 +- pallets/pallet-deposit-storage/src/lib.rs | 10 +- pallets/pallet-dip-consumer/src/lib.rs | 3 +- pallets/pallet-dip-provider/src/lib.rs | 2 +- 9 files changed, 200 insertions(+), 695 deletions(-) diff --git a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/tests.rs b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/tests.rs index 7b8182c3e9..cf3fdf8ab5 100644 --- a/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/tests.rs +++ b/crates/kilt-dip-primitives/src/merkle_proofs/v0/provider_state/tests.rs @@ -275,17 +275,16 @@ mod dip_did_proof_with_verified_relay_state_root { type WeightInfo = (); } - // Storage proof generated at Peregrine block `5_258_991` with hash - // `0xd83da28e40d6e193af832916d2741252955d438c9d17a9f441279085db3e8daf` for - // storage key - // `0xb375edf06348b4330d1e88564111cb3d5bf19e4ed2927982e234d989e812f3f30d1c9ddb0ba4c0507243fb24936031b342ed12d34ad897938af6739bf519bdc2f101d67bf7dac85501a12dfa1fa4ab9a0000` - // (`dipProvider::identityCommitments(4qVtUbkD2xqp9cqGDjViPpFPesJNdfoJvGeSUgturBxAPyBK, 0)`) + // Storage proof generated at local Peregrine instance (with new storage hasher) + // for storage key + // `0xb375edf06348b4330d1e88564111cb3d5bf19e4ed2927982e234d989e812f3f366a25a7fa9282d4c8e07cfeb5ec4b0f44cec8bb650a6e6ff111f30916b9ca56a4542f70764e95d7ceb6736d981b2d95d01a12dfa1fa4ab9a0000` + // (`dipProvider::identityCommitments(4pevjN6chwUqWPVaoUF6naRmZyrA4XWfdK8nLQLEjufgW55c, 0)`) fn get_dip_commitment_proof() -> (H256, DipCommitmentStateProof) { - (hex!("3a27f8d59c8bcc51bf3735ecdc0ce1304127a5b9e707e956e22633179493d55c").into(), DipCommitmentStateProof(vec![ - hex!("7f240d1c9ddb0ba4c0507243fb24936031b342ed12d34ad897938af6739bf519bdc2f101d67bf7dac85501a12dfa1fa4ab9a0000804aba9a5555257d6477fc5a74aaad1eaa24543e7eb1b4ac5ff1c00a50f6e63b3e").to_vec(), - hex!("800c808052d9b1ca86bf39ca4b7d574a5bcea35625200b5ff30c4517f7f361c67376e7fd8003ab0887cbb70c4e0d8d0f738e4b05732fd8cb5da24fa5f1112e20ba3603d58a80873d542c3a85337b597f63fc7a89837909196a9f0823625af4e2c18cc5274b56").to_vec(), - hex!("80ffff808a66c19052add13a202bcd73b546ae0cb70544f166c4a469672c666f0a5f9d8a80b84c2df313e2e749ff7e47eee888d9a023ba0a14a59852f4526b3e4b93b6dcbc807310fd50a0ae630c15e9eb07bda831d6d0cb6044d53a3dafb68e3fdb199fffdf80015ecd5e8af66e3d72ee5cc828c25989ca848e55396cccd9c196a4df1349fb9980a2ec48e449c43cc34954836cc14af398695f6569e301cef5a13eb88a16aa395580fd068d1339506db2893ba54a00a85aa712d68ff98ceeb5f4632f4e53618bb77880a3f173abac33e571e2a66f13127eeec3fb31bb1ae6f4b0fca8e658bbfbb5e52a803084ef6eaf38b821c59b3de92c4679117509b0b031e52ef5a80fdcff72e498ec804f36b8fb07a75463165f1714181009c86a2790685e78abd43220f5ecb194c887802559300c82eef4b21724bba2706cc2815e98cac3993c8d8dc9057b1aaf45ae8d8006571e929d492077d682dbc911934874ec00335029a90bd39e37d6d641e11873800397abe2ea62a374e5f0650c54fb99e8ef825066da798b0f4d729a7281f3575880b35cfb12f77988e1305ba651db7a8efbd43e4e8b057a56736cf6485f3033f481809ab1e406503e3ce63425a294f3f37aa4827b6a4ab38cf7e960a0d3335d79234e80be7c96632aa67491005e607a53bc1ab725fa465e29797bc29973d4cf5f64239b8037fe2a92c86d4c38ff38570b071e994ab86214e43e095dfb6ed142170fdac430").to_vec(), - hex!("be75edf06348b4330d1e88564111cb3d5bf19e4ed2927982e234d989e812f3f3010880ffe3135a9ee019dbfe4143608c9f4a4291ab827d7d9d055028d556d9cea2fce180eb5d42e7c6f84ac20e0d5ab42008c631b3e87f36d55d0d5053c9fb4f944ef97c").to_vec(), + (hex!("0757487b9dda09be65eae2e4ffeff8de52e66d5187d064f31e24fac44be9f4f7").into(), DipCommitmentStateProof(vec![ + hex!("7f540bf19e4ed2927982e234d989e812f3f366a25a7fa9282d4c8e07cfeb5ec4b0f44cec8bb650a6e6ff111f30916b9ca56a4542f70764e95d7ceb6736d981b2d95d01a12dfa1fa4ab9a00008051b175db0cd3a4071aaa1cdde8f3cc562b9618961d8a80ed77981ec98b91da45").to_vec(), + hex!("800c8080da28793d083b197f8d92fc3e77f5064436f1d8eea0fbea56ddb936aba654450080667f196f66a258b7e851925a9fca0e787fa2080ade3ec203fe940a85a4ef68b080b2aafe11c416356c5a97e233670962facb2a18944c3bdc4b9e27f1fa67a5bafe").to_vec(), + hex!("80ffff80353e4d164b13c87910044f1b4e76277e404a0ab46a7cd6c33a65aaadc2375ba88007b1390da34b4dce1328430fd924a6e193517a8148dd70a912c0dc2f7f8d2d4c803d402a5fdb0bf83f4f6da28178dc3d3b61d639a4c5733d8eaa79b3a159d9a79f80303acb9eafad3fe6028cf2abca4c824bf48af2b7241920ddf31b37d7921ee932802fd5e075dd0ae75eb64c49c178294214311140bc7c62763c839bedfac51cfa3180048fcfdbc81e0bb059327959a95b003093bf9b04e3918eebe0ac05aae2af93bb8014e3e0704c9a07636322335a3c663ec9fd9df8b7bf71d6e8183fefecfbfe0e50808e788bf3aaaea24abc0ee6d00eb102be955c07bd2b134e24cde6bdfbd922fdcf80deb1dbe09dc8972faeb0de3f080bfbb9d688dcf63906c91db762cc20cbf1e761804ee6ab85272b59bf8715509ccdcdbc038eb7ab7c13552f0eedbdc64bb1ccbacf808d42b27ca13475581cb35914e531fc84820bac04a5c6260b18adc6403c9d78d3807282321f53526da2c8f33500a0c90c75f95972c3c28366033c3f2c38beaaadc2804b74323792921a9cd34cd56a233f5768e3732bb41c157789371b110c5248446f80f395b7003a2eb1e39c624b9a707a6cb58c3cb6997932fc80662ae19c785a91f580b5e5172489541dfc581e116554b63de15fddf38ffed2b109394749c20b8f6ce3805a64908ec1ee443f9cff1793aa18d683308ae1bbd100498b5420e34c9a3c59de").to_vec(), + hex!("9e75edf06348b4330d1e88564111cb3d3000505f0e7b9012096b41c4eb3aaf947f6ea429080000806ad99dcfd0f2738b39c05d53a22890f969ba700ab74676cde1b3658e6a1d3b28").to_vec(), ])) } @@ -301,30 +300,30 @@ mod dip_did_proof_with_verified_relay_state_root { ); let proof_verification_result = proof .verify_dip_commitment_proof_for_subject::( - &AccountId32::from_ss58check("4qVtUbkD2xqp9cqGDjViPpFPesJNdfoJvGeSUgturBxAPyBK").unwrap(), + &AccountId32::from_ss58check("4pevjN6chwUqWPVaoUF6naRmZyrA4XWfdK8nLQLEjufgW55c").unwrap(), ) .unwrap(); assert_eq!( proof_verification_result.dip_commitment, - hex!("4aba9a5555257d6477fc5a74aaad1eaa24543e7eb1b4ac5ff1c00a50f6e63b3e").into() + hex!("51b175db0cd3a4071aaa1cdde8f3cc562b9618961d8a80ed77981ec98b91da45").into() ); } #[test] fn verify_dip_commitment_proof_for_subject_multi_storage() { - // Storage proof generated at Peregrine block `5_264_068` with hash - // `0x44635397de0fd0f4e6329064bd2c8500a6ca2283d904e7f2fbe271cd362224cb` for - // storage keys - // [`0xb375edf06348b4330d1e88564111cb3d5bf19e4ed2927982e234d989e812f3f30d1c9ddb0ba4c0507243fb24936031b342ed12d34ad897938af6739bf519bdc2f101d67bf7dac85501a12dfa1fa4ab9a0000`, '0xb375edf06348b4330d1e88564111cb3d5bf19e4ed2927982e234d989e812f3f346802a0d131133fa4cac8e6332f14ad28fe8b2ccb9e339f1c36798e918846726e6e983b59dd4fa3101a12dfa1fa4ab9a0000] - // ([`dipProvider::identityCommitments(4qVtUbkD2xqp9cqGDjViPpFPesJNdfoJvGeSUgturBxAPyBK, 0)`, `dipProvider::identityCommitments(4pebirGcQAJ4nyd5137VuK8TPVW9RXprWvZLQK1wcw2qJvnM, 0)`]) + // Storage proof generated at local Peregrine instance (with new storage hasher) + // for storage keys + // [`0xb375edf06348b4330d1e88564111cb3d5bf19e4ed2927982e234d989e812f3f366a25a7fa9282d4c8e07cfeb5ec4b0f44cec8bb650a6e6ff111f30916b9ca56a4542f70764e95d7ceb6736d981b2d95d01a12dfa1fa4ab9a0000`, '0xb375edf06348b4330d1e88564111cb3d5bf19e4ed2927982e234d989e812f3f3324b39c02c5b89191d516a1cb2438497d68f8ab82a2af4df66983a1fd0992711686c0fbf8ff8437552365e26f488c17c01a12dfa1fa4ab9a0000] + // ([`dipProvider::identityCommitments(4pevjN6chwUqWPVaoUF6naRmZyrA4XWfdK8nLQLEjufgW55c, 0)`, `dipProvider::identityCommitments(4smPiDNt9eLaJCe6uq1hGG3kWEmB3ooMpbGbSp1VF9D2vwEg, 0)`]) let parachain_state_root: H256 = - hex!("886585d3c600c51e36e5e9b09c981abdee80fb0f3e5ce127a6de659b8684f168").into(); + hex!("506f0aa6af2e04874ab94835b359ab97a9cca1d1773777b5004da93ffd08a088").into(); let dip_commitment_proof = DipCommitmentStateProof(vec![ - hex!("7f2406802a0d131133fa4cac8e6332f14ad28fe8b2ccb9e339f1c36798e918846726e6e983b59dd4fa3101a12dfa1fa4ab9a000080dbf7e051929e3be2b6ded6fa9f4827a6bb080092487482c581e4e154d4a8f78f").to_vec(), - hex!("7f240d1c9ddb0ba4c0507243fb24936031b342ed12d34ad897938af6739bf519bdc2f101d67bf7dac85501a12dfa1fa4ab9a0000804aba9a5555257d6477fc5a74aaad1eaa24543e7eb1b4ac5ff1c00a50f6e63b3e").to_vec(), - hex!("800c808052d9b1ca86bf39ca4b7d574a5bcea35625200b5ff30c4517f7f361c67376e7fd80ccbd1321b25f59f4de9cd943c7322b8f2b943e30e510e7f32571250f651015bc80873d542c3a85337b597f63fc7a89837909196a9f0823625af4e2c18cc5274b56").to_vec(), - hex!("80ffff808a66c19052add13a202bcd73b546ae0cb70544f166c4a469672c666f0a5f9d8a80b84c2df313e2e749ff7e47eee888d9a023ba0a14a59852f4526b3e4b93b6dcbc80e2f12a87d30577bc3586e4684c34438a779df39f6bee51b098193f1484e7b20f80015ecd5e8af66e3d72ee5cc828c25989ca848e55396cccd9c196a4df1349fb99808587812cb707ea395adbd624fba27708a8b734dd26c75febf4d79f30f775d31f80cf4fdd2b7ee898fa3de2063d08ca5488a65e49b4f21969be56dd22b79729f4ce80f77d231bea6c289f8d969c0a2cc81ec8447efa0747845799e7bc635626801605806830b9c8dadb45b721c323e66aaf4417dd1f2a3b0315c17c7e9bc3a75312677d807368afb2a07ba2ca0ceec6c88e0e3040a39d4c86408f97d2fa0006c39531b4ca802559300c82eef4b21724bba2706cc2815e98cac3993c8d8dc9057b1aaf45ae8d808c1f6312826116f8e9aa52506bfc8b3b4583998f8858213044dac52f3ac1138c803e008fcbfb660c563e9eb278cf78fe3988027713cd9077898c351c41844fefc480002990139706fe0a03fcfc41614c9cec1ae13ddafba4de0630af0b87503d8312809ab1e406503e3ce63425a294f3f37aa4827b6a4ab38cf7e960a0d3335d79234e80be7c96632aa67491005e607a53bc1ab725fa465e29797bc29973d4cf5f64239b8003bce13d1847862ce6f26f6b420ffda9cd9b635c2ec8533f23c7b2d454d66b29").to_vec(), - hex!("be75edf06348b4330d1e88564111cb3d5bf19e4ed2927982e234d989e812f3f3110880ffe3135a9ee019dbfe4143608c9f4a4291ab827d7d9d055028d556d9cea2fce1804276317882ff464bb21f7fb6b9e20ccee7a1e414608ecb3c8c349dfa286dfd7480eb5d42e7c6f84ac20e0d5ab42008c631b3e87f36d55d0d5053c9fb4f944ef97c").to_vec(), + hex!("7f34024b39c02c5b89191d516a1cb2438497d68f8ab82a2af4df66983a1fd0992711686c0fbf8ff8437552365e26f488c17c01a12dfa1fa4ab9a0000806e5f8a286a025f2631fc7e903f16f4732de04623a411da2abda7c81eb7a42e31").to_vec(), + hex!("7f3406a25a7fa9282d4c8e07cfeb5ec4b0f44cec8bb650a6e6ff111f30916b9ca56a4542f70764e95d7ceb6736d981b2d95d01a12dfa1fa4ab9a00008051b175db0cd3a4071aaa1cdde8f3cc562b9618961d8a80ed77981ec98b91da45").to_vec(), + hex!("800c8080da28793d083b197f8d92fc3e77f5064436f1d8eea0fbea56ddb936aba6544500802ac01dbcb6bbdd9e784796b03fa804e22e6c7d552e6432d2e782c78f1fd62ed080b2aafe11c416356c5a97e233670962facb2a18944c3bdc4b9e27f1fa67a5bafe").to_vec(), + hex!("80ffff80353e4d164b13c87910044f1b4e76277e404a0ab46a7cd6c33a65aaadc2375ba88007b1390da34b4dce1328430fd924a6e193517a8148dd70a912c0dc2f7f8d2d4c8056524aa90f9d9955e0f11cb65a3301b3feec8236f6c506f60851cd9182f6dabe809ce9739227a80b74d58ca2731bb7c95fef30c44badeaed70d4cae8ece37b875180f42657aef3c7a9da89d7fa2ead23197e6c7a0d9a56224c30a23d5e72af213b568011c66e7235c652b25a2599a23850ab0b2c45aa6adc8d0340956aeb06f677780e8014e3e0704c9a07636322335a3c663ec9fd9df8b7bf71d6e8183fefecfbfe0e50801f8da04e41cb0e58c2899f258c3606a4f8a9029ce7dd2831fe2f18748714e1b08063a92863797f3ff47d446998ab380abf3e19f9ad052378a890c969e3665ccfc480ac8fc0b324e4a48b6995b1ace16c16896f31a7d342fdd8c2812aebc74b3b1b2080f567d19109fd00674a7d71a364d5036670bd8413170968a2cd7e204ee9762b1d809183d04fbdc18d7dd79fe20d07131563bef1b21aa5cb6861a2dab4fb6173cbe3802588aac7065dd9e759283fcbf53a0c3696e5669564f92ee17d0ea9fabfe9e82880f395b7003a2eb1e39c624b9a707a6cb58c3cb6997932fc80662ae19c785a91f580b5e5172489541dfc581e116554b63de15fddf38ffed2b109394749c20b8f6ce38019dd7bc351b0ddab367f9c10a27d0dad1669e16af8a8a58c577ce0b2fb26ce8d").to_vec(), + hex!("9e75edf06348b4330d1e88564111cb3d3000505f0e7b9012096b41c4eb3aaf947f6ea429080000803cfa8887e3f3605330a40b74e99d031b21aeba65d2ef7f35c24a5cefab5291f1").to_vec(), + hex!("9f0bf19e4ed2927982e234d989e812f3f3480080f3fd8dffe32bd8f539044baf30efd07801d87ea5280154588c3abd3e325f578d8048f06290dfec2596fa70eaca62ea496d3dc0cd2f51fd40c61b58d7e5b476eebd").to_vec(), ]); // Only interested in the DIP commitment verification part, we skip everything // else. @@ -335,12 +334,12 @@ mod dip_did_proof_with_verified_relay_state_root { ); let proof_verification_result = proof .verify_dip_commitment_proof_for_subject::( - &AccountId32::from_ss58check("4qVtUbkD2xqp9cqGDjViPpFPesJNdfoJvGeSUgturBxAPyBK").unwrap(), + &AccountId32::from_ss58check("4pevjN6chwUqWPVaoUF6naRmZyrA4XWfdK8nLQLEjufgW55c").unwrap(), ) .unwrap(); assert_eq!( proof_verification_result.dip_commitment, - hex!("4aba9a5555257d6477fc5a74aaad1eaa24543e7eb1b4ac5ff1c00a50f6e63b3e").into() + hex!("51b175db0cd3a4071aaa1cdde8f3cc562b9618961d8a80ed77981ec98b91da45").into() ); } @@ -373,7 +372,7 @@ mod dip_did_proof_with_verified_relay_state_root { ); assert_err!( proof.verify_dip_commitment_proof_for_subject::( - &AccountId32::from_ss58check("4pebirGcQAJ4nyd5137VuK8TPVW9RXprWvZLQK1wcw2qJvnM").unwrap(), + &AccountId32::from_ss58check("4smPiDNt9eLaJCe6uq1hGG3kWEmB3ooMpbGbSp1VF9D2vwEg").unwrap(), ), Error::DipCommitmentMerkleProof(MerkleProofError::RequiredLeafNotRevealed) ); diff --git a/crates/kilt-dip-primitives/src/utils.rs b/crates/kilt-dip-primitives/src/utils.rs index 1e5c37b534..2ceca62e8d 100644 --- a/crates/kilt-dip-primitives/src/utils.rs +++ b/crates/kilt-dip-primitives/src/utils.rs @@ -82,7 +82,7 @@ mod calculate_dip_identity_commitment_storage_key_for_runtime { assert_eq!( calculate_dip_identity_commitment_storage_key_for_runtime::(&DidIdentifierOf::::from_ss58check("4s3jpR7pzrUdhVUqHHdWoBN6oNQHBC7WRo7zsXdjAzQPT7Cf").unwrap(), 0).0, - hex_literal::hex!("b375edf06348b4330d1e88564111cb3d5bf19e4ed2927982e234d989e812f3f34edc5f456255d7c2b6caebbe9e3adeaaf693a2d198f2881d0b504fc72ed4ac0a7ed24a025fc228ce01a12dfa1fa4ab9a0000") + hex_literal::hex!("b375edf06348b4330d1e88564111cb3d5bf19e4ed2927982e234d989e812f3f314c9211b34c8b43b2a18d67d5c96de9cb6caebbe9e3adeaaf693a2d198f2881d0b504fc72ed4ac0a7ed24a025fc228ce01a12dfa1fa4ab9a0000") .to_vec() ); } diff --git a/crates/kilt-dip-primitives/src/verifier/parachain/v0/mock.rs b/crates/kilt-dip-primitives/src/verifier/parachain/v0/mock.rs index 289bdeb600..2c852981ab 100644 --- a/crates/kilt-dip-primitives/src/verifier/parachain/v0/mock.rs +++ b/crates/kilt-dip-primitives/src/verifier/parachain/v0/mock.rs @@ -153,25 +153,25 @@ impl pallet_dip_consumer::Config for TestRuntime { type WeightInfo = (); } -pub(crate) const RELAY_BLOCK: u32 = 21; +pub(crate) const RELAY_BLOCK: u32 = 421; pub(crate) const RELAY_STATE_ROOT: H256 = - H256(hex!("23ed6624753dfc87f0721c867abfa77361636314a60d24e8e85b44072b89c3f6")); -pub(crate) const GENESIS_HASH: H256 = H256(hex!("fe0821e1c03846bdff40df39019205b2dce56dd0ccbff6f042d68832a56d358f")); + H256(hex!("6adf8dbf20e1b78f85f6ffe4775640f935d0d8ed38acab327be81089fd90d82d")); +pub(crate) const GENESIS_HASH: H256 = H256(hex!("74f8cd2f3764f676a5e67c45a641ce1025548c6cddcf524a663a9c0aaf7fbee2")); pub(crate) const WRONG_GENESIS_HASH: H256 = H256([0; 32]); pub(crate) const IDENTITY_DETAILS: Option = None; pub(crate) const WRONG_IDENTITY_DETAILS: Option = Some(u32::MAX); -pub(crate) const SIGNATURE_VALID_UNTIL: BlockNumberFor = 56; -pub(crate) const WRONG_SIGNATURE_VALID_UNTIL: BlockNumberFor = 55; +pub(crate) const SIGNATURE_VALID_UNTIL: BlockNumberFor = 199; +pub(crate) const WRONG_SIGNATURE_VALID_UNTIL: BlockNumberFor = 198; pub(crate) fn submitter() -> AccountId32 { - AccountId32::from_ss58check("4qbGXy3VNCxRywCooPHBCiqqC8eBCi8R61FhKMhQgfe6Pi7M").unwrap() + AccountId32::from_ss58check("4qgGXhqTwQmi5CaAhR5s2QpsiUzwrdeksoZG5AusPMpaYqP2").unwrap() } pub(crate) fn wrong_submitter() -> AccountId32 { AccountId32::from_ss58check("4pnAJ41mGHGDKCGBGY2zzu1hfvPasPkGAKDgPeprSkxnUmGM").unwrap() } pub(crate) fn subject() -> DidIdentifierOf { - DidIdentifierOf::::from_ss58check("4p9S4FrPp4HATybUu6FoBaveQynGWzp8oTpJ5KYyfmYZ9RH4").unwrap() + DidIdentifierOf::::from_ss58check("4rTs9KCbLf28yUVsMo5t39ssfW4rPsaqq2UqeZi3hwYLpg3Q").unwrap() } pub(crate) fn call() -> RuntimeCall { @@ -197,35 +197,37 @@ pub(crate) fn cross_chain_proof_with_authentication_key_and_web3_name() -> Parac BlockNumberFor, > { ParachainDipDidProof { provider_head_proof: ProviderHeadStateProof { relay_block_number: RELAY_BLOCK, proof: vec![ - hex!("3703f5a4efb16ffa83d00700005c5197306d02680fa1d14a3b19ba0fa41b17e8949911dda103b1b0476bfc980e").to_vec(), - hex!("790309fd7e1fbcde7136109a7c9d435fac9bd912d8857a7eb6b5a02ada5eef14effd14c9d5f469ad91a7ce17998925ed087b1b0e82d2b213eacdf87eda9bd14bafc7bbbdcd2a3423d2648d844f668a1de5f409dbfbe1c529b6fdf8efa5b8b94c919dcd0c0661757261201d607d080000000004525053528484b480424aa62b5ec40d592c52a3f36bc06afa6b1e8fcf6806dd50c6147304944c05617572610101f4a4dc233d8ddd805ae2e53f987926dd55609fce234019e60bb2b0cd8b70805c5888f3f408cd7c5e39385adef76223445e2473ddeb23760b1863d592281c7182").to_vec(), - hex!("80046480a1736fb82eeef3ae99c2d1dfc79ca72de61d32d379e5accb53bf99203c9c3b2880f6f6801e4b41e2e6d8ec194dba122bfb9eb33feb2545ef5144cea79551f7cc5280d8416fa071a12a1632a04f2cfe01cd9c7beeacc9d90f647cb93d235dd8870e73808c2f1b77b9294abc1a55fc8432f862b4abfa90f9af3a47f138e4d8dfdfee9468").to_vec(), - hex!("80ffff80e4b470c8e610803be35fb30c2297c88daefe2fb9984db06c45b68c441d989f6680fce4c77e35ddc74b02c611a5436c98b6d2fec67ef1d9eb0c706ac06570913aa580594aafb93d9618327a4d0723e4e6ae1c34de455716c3205e665493a88303e3c4809d3100527438cdc0c7b8a19b932fc76e25d7e22b5ef9ca0a0dbcdfeefec9e9238085ab5177d435d816c3143c5a7ffc4bd8929328ec3ec9a8fb6b8ad1ff9eaf08aa80739be177872c5beb6da57440ce6941849b20f0bc344170a48312fa761fa45b3280275ba9412df014f6c2bd421a42b64052417d01defc479406b157ef5733dbf280805b682132c52908705526057f73ab7fccab4af6d72a9805634dd8d3cc53f130d180c2d44d371e5fc1f50227d7491ad65ad049630361cefb4ab1844831237609f08380134bd63183fb7e62530dd82964c89077ec083b5117f24842f8453f6f9fe3d83080afddf55b94871699b66eb154e0b6495121e88337c7b80f86058ddf54ad9e25c3804b438f963950b0230a6bdbe6664bf5a492d1c05a62343dabf14b377024995a1880490ee6b2b446a32bf0bd68d8cdc905688bdc036a5f349ee84deb700f0bcc95a9803b225accc70e19d48fd9b2e3fdec7b185a451556cf50362b056951abf2df89f4806bfdbbf0e0bedcb993b65c9cea1e929a56d78a3b7bc53d1b7ca6fc488e2295ee80d6513cd4e03e5d4dfda76ba48fefe60422081e4f885128b01400ae254fbc48a1").to_vec(), - hex!("9e710b30bd2eab0352ddcc26417aa1945f43803b3441f15daa8a53147d69c48eac75356fab581febbb8030520b248c5942a148801f09f47c0d4767dc1ff9ae54ba8f174d9e5fa06b8242368a39481f5fe5a078f3802e2e0716043a02f2f29fdd52922704af194b98545ce5ca832255e8ec41bcdb6480935f8561d684b40c45e36088c7daa1575cc60b54080e3e023ae43db4092287ba505f0e7b9012096b41c4eb3aaf947f6ea4290800004c5f03c716fb8fff3de61a883bb76adb34a204008092e3fee779c209e5562dd0679d5fcb3876ce9ea0b126e14f1f801a50d8c1d8a44c5f0f4993f016e2d2f8e5f43be7bb259486040080cfad4870b13343cea64432d5dc64a59f0a5c6da43817f25d8a72a3900c9cee17").to_vec(), - hex!("9f0b3c252fcb29d88eff4f3de5de4476c350008072c23a8d4d26e772d0e0e0877b3fa481025ba0f8695a5537b7771587bbe5ca60808e11df642368fb86db2a9cd579f9a3bedf50546a1a325f3c4052c037683e3656").to_vec(), + hex!("3703f5a4efb16ffa83d0070000da00d3541403539d4256de2db65d713afc8aedc8abede84d5dc4014019605d94").to_vec(), + hex!("8004648031b60c9237ed343094831987f2bec10b211621255ad0b440cf161fa820d30db480f6f6801e4b41e2e6d8ec194dba122bfb9eb33feb2545ef5144cea79551f7cc52801287b410de904c199ac477f0d317d3a4b9a45b5424236719bbe2b2f0736a505a80c2160c2830b22a1eb05c14f6a9e20639de8f9e21dcd0e621ca18540027f89ba5").to_vec(), + hex!("80ffff80d8655205caee5e0a6b74cdf5b1adc20aea610833ad71da05d3143031b5744be58015f6db81af2768203cf235fa69602e86dd51d963cbaf2e93e3d08a7a71436ac280f48da460759e201ca3c3b9127a366e235ecdbb721c7fdd02673544b39c1a0e7180095af3328f28eb7c21cf96129f628930323efd14acb42e674600f4542a2347e980e277a338d70d91f2da9e3fcdd516aadfaa1e9aa3c91080a74d1580bf033d524d80eb47b9f01723d00dbf42a4227b4b217f2bf928240d54e2f57b32b73f088158fa80c8b5d1d00527c8ba24530642a1f9049ee21ccd7d2923158e31bdb16b1e16b9ed805b682132c52908705526057f73ab7fccab4af6d72a9805634dd8d3cc53f130d180c2d44d371e5fc1f50227d7491ad65ad049630361cefb4ab1844831237609f08380a6a172370370c5b197e769e205270d4e0a36d5d8c300384ad3a04b97f7167a188036f5935fe1e0440c815666c5d68304f0723de7be305845935ab7220dd222ef868040f4d528d1dcbfb62dbc70e0c242402975b6b4009001aec75a1239f23d5650b9809d95d41f288555f74a76e2d8ec9691d240a8d9a9a57851c85e2e390d0fba659780f5528af32ddc75ed1e91e25b644e0d9fc506d1828fe5876beca37860c51b884a806bfdbbf0e0bedcb993b65c9cea1e929a56d78a3b7bc53d1b7ca6fc488e2295ee80e9810f66374c83abcac91f2c4e0b6592dab9bea79e432c469a65efc0488e93d0").to_vec(), + hex!("8103bc05984bd8e93876468ac91f85d3a6afca02e9729db00c0214032d745bcf0d5a4502b7819c39bf85ecf59d380c6b36e0542d8f5f587756fdadc94058c345804ef2f92f35250cbd9abe38f049145ec553be0b232b6b705a7bd95fe6f0134106e0b5440c0661757261209c1e7e0800000000045250535288dba69c63177375777ef2360d7023a05e5af585aa6a1be07aac94cfb0c3979cc88d0605617572610101266c2da415cf67bc39e13f754f212eaba3839d7d5aea0c42376e00e3c376572c1ba3cb1e156ea8b3a3a6dae589a1d62a861f0247487391452b2d0f10862ea780").to_vec(), + hex!("9e710b30bd2eab0352ddcc26417aa1945f43803b3441f15daa8a53147d69c48eac75356fab581febbb8030520b248c5942a14880ec1d5ee4349a9c6f534ce103adef97bc85a794ba786d51bd75d2fe2bc9826134802e2e0716043a02f2f29fdd52922704af194b98545ce5ca832255e8ec41bcdb6480a0718fee6fd849f63aebd00a6e9d09e984d70549c0b5475b16c244090876e628505f0e7b9012096b41c4eb3aaf947f6ea4290800004c5f03c716fb8fff3de61a883bb76adb34a20400808aefdc67024312a782a33b24ee2d1bfa728e3842db64274191fa9a4f0f7a56744c5f0f4993f016e2d2f8e5f43be7bb259486040080949e352413ff8a43f35e73a6077d7a87a2de45fb6ce9bc40ad3717bdbf7a5708").to_vec(), + hex!("9f0b3c252fcb29d88eff4f3de5de4476c3500080680174266144346b8929a369c75acac037ac3b4edfde15b308cddfa28b7def8e805e009b7041665711ae523d4eab10f4cc0b3c7d8f0283381899b208aa42435ba3").to_vec(), ] }, dip_commitment_proof: DipCommitmentStateProof(vec![ - hex!("7f440bf19e4ed2927982e234d989e812f3f32da9da135714ded7366de71f9a6bd6620f03ac92421fea3539e7b80a01bc14cc200265029563162101a12dfa1fa4ab9a00008032e9f6961b6f2915ebb3b3fff7ecdee4d11c1dc7c326c7890cd098498da51df1").to_vec(), - hex!("800c8080da28793d083b197f8d92fc3e77f5064436f1d8eea0fbea56ddb936aba6544500806105b92c7c2c540155c67a2782607dace59d3093432f81564d5ada8bff4be04180b2aafe11c416356c5a97e233670962facb2a18944c3bdc4b9e27f1fa67a5bafe").to_vec(), - hex!("80ffff80353e4d164b13c87910044f1b4e76277e404a0ab46a7cd6c33a65aaadc2375ba88007b1390da34b4dce1328430fd924a6e193517a8148dd70a912c0dc2f7f8d2d4c80ade4fe11f1179c11ffdcbfa22755ecb2b1a904b42a8e61838ac5d61b50527e5180e12d12e0e160241a582c5068f11f66364c4421b3444fc3a69da31576a46e93d180e32fd413c5f3f35cf140619d01c260348df629c9581ddb2ffa3ed3a4454611bc80e73af1cd43b13af0d4726e252583bfc4b0e4f159cacfbedeb14669fec54f16d28014e3e0704c9a07636322335a3c663ec9fd9df8b7bf71d6e8183fefecfbfe0e508089e0d83f324b3a94a57e6c9ca7517f7829acf273e063c3b86e876f5f5000dfad808237efee33d7cbf612b36cf8e72b49b7a7ee4d48085dcaf5ffa8b163261a495b80591a4868cf7eafa20b043d709923044e17e7cde25ee7a35b9732af83d346ddf8808ddf2174553f85bc1836060e6ed175ba06730cecc706a30493e8bcfd9823eeca80e36ae624a00ef6eed407fd4d97dfe9980549cc00adeb2f9454c79d73032e10e48085c95ba8d0c7c8734e14270f873eefada04c1c71d6d99d9236772f890c8a74fa80f395b7003a2eb1e39c624b9a707a6cb58c3cb6997932fc80662ae19c785a91f580b5e5172489541dfc581e116554b63de15fddf38ffed2b109394749c20b8f6ce3805256998e8d08896289d5756f1f96ec6d8f4be237654682f91f559a511bf50a75").to_vec(), - hex!("9e75edf06348b4330d1e88564111cb3d3000505f0e7b9012096b41c4eb3aaf947f6ea429080000801109e5a50d25358a1bcff63c57103c8eb73b80885bb28ba9b666503b8669953e").to_vec(), + hex!("7f3200658e5d6cfde41fac5eadc5b800e29cf53cf19360e5cac6055254c77d91a79701381c47e03e17c3284aa85edc851e01a12dfa1fa4ab9a0000802e1cdab36fe7e9ffaa624f5d86fa18b9809536271f60d4363b0bbf672c240f68").to_vec(), + hex!("800c8080da28793d083b197f8d92fc3e77f5064436f1d8eea0fbea56ddb936aba654450080738fe375d48815633f8040a1f7c6311aba813d535b0f23b37e5139c85c6b4f0880b2aafe11c416356c5a97e233670962facb2a18944c3bdc4b9e27f1fa67a5bafe").to_vec(), + hex!("80ffff80353e4d164b13c87910044f1b4e76277e404a0ab46a7cd6c33a65aaadc2375ba88007b1390da34b4dce1328430fd924a6e193517a8148dd70a912c0dc2f7f8d2d4c806322b31235b002ea35614d4eaa1282246a5cefe4a625e5265170d93f2adb9a64802407df9dc8f440a6f8ee7cde4b162e5406ffb5c2a4c99de693bcd20350cc74e0806b313ff9ef1a351bfcc5351cc3b42f8a4fdf1b4a612c350a970677ab3adc91308077be4f344b7438aec6d87a6a29089d64db3dcab9fcec7b91ee4eb37b8afc56c98014e3e0704c9a07636322335a3c663ec9fd9df8b7bf71d6e8183fefecfbfe0e508021d9b25eb4eb0be974f964ba45a39182e42c74034baa38b7499bf7eab8253533804d54f9f6624640788154e78f39dd9b535ba37be663a4ff7b9423bc28637c9f0c8035f638d2e64e75369bba87d0c8aaecf3374294d77818a299ce98dd7d7ff208ee8070de6b035f859c70b5df439f7793eaeca3d858b04dfe70d0a08b1ca06571e87d804aaaff272d09c1b5593870282b1f09e12e8ad325794662edc4a12c02bfd853a880f341940454f25e0b2c93b674eaca644f4ecdd9ace1c3955197f222fda677eebf80f395b7003a2eb1e39c624b9a707a6cb58c3cb6997932fc80662ae19c785a91f580b5e5172489541dfc581e116554b63de15fddf38ffed2b109394749c20b8f6ce3801c763d73cb3d67092a0f18f421080b782403b0a95b6c92bd8dc60e80baf2b1a5").to_vec(), + hex!("810210108082cadebddb74d7ea90430a7205294eedaafa180228e73bd9849228dbabbf32698025b425162cc535f40a255ba9be090e12d1b50aa8a6ec0b108acb60ec048268da").to_vec(), + hex!("9e75edf06348b4330d1e88564111cb3d3000505f0e7b9012096b41c4eb3aaf947f6ea429080000803e5de95874c4bbe730354a3a777b39be54d6141653673cda856be1d5a8893c78").to_vec(), + hex!("9f0bf19e4ed2927982e234d989e812f3f348008028e4e828a83fd632d6d17fa940bb289ef8d04c1c154ecbf583d677460bef22128048f06290dfec2596fa70eaca62ea496d3dc0cd2f51fd40c61b58d7e5b476eebd").to_vec(), ]), dip_proof: crate::DidMerkleProof { blinded: vec![ - hex!("8022000000").to_vec(), - hex!("7f04069d06a63af2662632789148708798b64f753eb007f162a641efbbe572f20e33010000").to_vec(), - hex!("6f0c623964373239616630626365346664303738313630393800").to_vec(), + hex!("8020040000").to_vec(), + hex!("6f0c396636316435353033376335383836623033393636633900").to_vec(), + hex!("7f04099e99fc7ce5529bc72a0846778d0f62137ddcbab51a1af2d3e91752962d91b4010000").to_vec(), ], revealed: vec![ RevealedDidKey { - id: hex!("169d06a63af2662632789148708798b64f753eb007f162a641efbbe572f20e33").into(), + id: hex!("a99e99fc7ce5529bc72a0846778d0f62137ddcbab51a1af2d3e91752962d91b4").into(), relationship: DidVerificationKeyRelationship::Authentication.into(), details: DidPublicKeyDetails { - key: DidVerificationKey::Sr25519(sr25519::Public(hex!("366de71f9a6bd6620f03ac92421fea3539e7b80a01bc14cc2002650295631621"))).into(), - block_number: 4 + key: DidVerificationKey::Sr25519(sr25519::Public(hex!("9cf53cf19360e5cac6055254c77d91a79701381c47e03e17c3284aa85edc851e"))).into(), + block_number: 144 } }.into(), RevealedWeb3Name { - web3_name: b"b9d729af0bce4fd07816098".to_vec().try_into().unwrap(), - claimed_at: 4 + web3_name: b"9f61d55037c5886b03966c9".to_vec().try_into().unwrap(), + claimed_at: 144 }.into() - ] }, signature: TimeBoundDidSignature::new(did::DidSignature::Sr25519(sr25519::Signature(hex!("faf3508b0075d8570bb1a79f7aeba4b08e9ae88f16bb9fc44eaf6f203bad842f75dfc17b114e015c7ccdaa672c359bb066961ba2cbaccf3308dc44e0fee3b28c"))), SIGNATURE_VALID_UNTIL) } + ] }, signature: TimeBoundDidSignature::new(did::DidSignature::Sr25519(sr25519::Signature(hex!("3cd5e72f04d248e5155bfdabb94c308a88368db63a8a0cafc15fb3204a709b07da028cf85bd450d9a2bdb6679f2b07ac69188101185ab3acd9f41419cbfb3c81"))), SIGNATURE_VALID_UNTIL) } } // Aliases requires because the pallet does not expose anything public. diff --git a/dip-template/runtimes/dip-consumer/src/dip.rs b/dip-template/runtimes/dip-consumer/src/dip.rs index 6dae64d40d..91a0dbbfab 100644 --- a/dip-template/runtimes/dip-consumer/src/dip.rs +++ b/dip-template/runtimes/dip-consumer/src/dip.rs @@ -121,868 +121,366 @@ impl kilt_support::traits::GetWorstCase for ProviderTemplateProofVerifierWrapper #[storage_alias] type LatestRelayHeads = StorageMap>; - const PROOF_RELAY_BLOCK: u32 = 193; + const PROOF_RELAY_BLOCK: u32 = 589; let provider_head_state_proof = ProviderHeadStateProof::new(PROOF_RELAY_BLOCK, vec![ - hex!("3703f5a4efb16ffa83d00700007589ffcbe7fe666f76c721443cf633e6ee45a06f439cb3637c7791cf31b0cdf1").to_vec(), - hex!("8004648031b60c9237ed343094831987f2bec10b211621255ad0b440cf161fa820d30db480f6f6801e4b41e2e6d8ec194dba122bfb9eb33feb2545ef5144cea79551f7cc5280a1e39f80557cd7da7aa27045494d8bafc93f1d1fff00b77bfc4dc87078155a248038b7ab2b0c7e94565e832199accca003b74c41e8f4d881d8034ed8b3c1f08e22").to_vec(), - hex!("80ffff80437bee387434e6e8f91a0739adfdc95ad239020339bc3e99e001b88992670b98804982fd732f232253fcaa75c350ef6e2ad7b587b0a9ffcd3c6be95d25f556bee980de36611e633e4f59d89fe9f3f216fa52bc054b56137e8f55a0092ada207377b9803baf41139df1886d135151e6e64604b4405033b62038878c3f7609c5fab69cdc80a1e407fc0eb00a05fde19c35367d5f6f1ed76d36a4630ae73fb964fc19ec4a6e808b4d66a7c2324664d29962ff7930152e708fdef4213acaa76601b99fb55fb3fa80413bb6d7abf53c1bd3d1adef322b493310c67b82ad106001d06a96211802b723805b682132c52908705526057f73ab7fccab4af6d72a9805634dd8d3cc53f130d180c2d44d371e5fc1f50227d7491ad65ad049630361cefb4ab1844831237609f0838027dbae280a97bff856ec780ad629b86a828f8235af6c212963a83e25b143c0ac80af6bf8534d659672b96174d96a90e7ca58acd3fae4141991b953a5c61b5ce8ab80811f63fc4d3997a103105f26e3dbf4c89911a5aa3e47d52f35b8db960d08680a8015ca3a7de67e0f69f05047887eb2da1673bf8952dbb572659713f7a68e381237800802ced193c37d688d8da534e615665a56713e1846eeca9a92d25ed5691ce9e0806bfdbbf0e0bedcb993b65c9cea1e929a56d78a3b7bc53d1b7ca6fc488e2295ee804e2a451dd1bed45187a8b7d21a1c9f8f0093eac2fb5f6a9cede45bfb7b892a53").to_vec(), - hex!("81039cb1953d2d87454e865602d3631099122bacda46587c417641803ef5445e5812090119bd7ebf90604600d62330c172239485aa5d790b6f5b5278b5664f21e8a5e0db342c83b3ac5cea35aff1d4f9490a6d32e68b95455899ca468cb3c6d66548ed990c066175726120ce027e08000000000452505352886b769249b85767f45cf6dd369674daa53edf47b52af36c92166ea0037890ce2bfd02056175726101013288e0ad4796fba9fbcd75e92c4901561a1e8c728585fa8fb1f4fc6e090d0c2c941024b25a4b029871fb1f74cf71ffdc8a0cf3965ef52b208e6f8b5abca6c685").to_vec(), - hex!("9e710b30bd2eab0352ddcc26417aa1945fc3803b3441f15daa8a53147d69c48eac75356fab581febbb8030520b248c5942a14880027bd77389a90d1bacdc428100d19fe4f8cf389277fc9a99a92dcc013e600fe980f9f5f25fa95e76ac835b9c7dc442eddbe86404477019dbe3c451762011638bd28048d16f61bbf0c00dafa9f54513d948c2f6276f3c89f02a3035fde4a2191e60fd505f0e7b9012096b41c4eb3aaf947f6ea4290800004c5f03c716fb8fff3de61a883bb76adb34a20400800f179c5eb0be8c4a17a77d173c53aa48253116c1bbda3440fd89aa60f7225aaa4c5f0f4993f016e2d2f8e5f43be7bb2594860400806c7b0c0ed8ee4ae71865fb04382fe8667ab03884ae1938bee35817f9e48b34bc80f17b86d932260aaa0f44c42fbf77d966025518e043c509542dfb8fadaaa743a1").to_vec(), - hex!("9f0b3c252fcb29d88eff4f3de5de4476c3500080fb95bb5f127efa46e85746ac0fc594c04b183c773ed7ae2dc9799dc614ad582e807f15a6dde1226da17ff9bef88a51fdd844ab6039e2f2de7703d55e7919a38753").to_vec(), + hex!("3703f5a4efb16ffa83d007000088e2fdf5c9b8f94277579ae683ead98aae1e06facab1d301144a0271157399ee").to_vec(), + hex!("8004648031b60c9237ed343094831987f2bec10b211621255ad0b440cf161fa820d30db480f6f6801e4b41e2e6d8ec194dba122bfb9eb33feb2545ef5144cea79551f7cc5280bfc5f17f5701ebcd8a25d9e08a90343321779f9c335471d0b22c2686bd57d9c0800ad654b674c2cd45843018e4083f71d892f9463aab9920f166d47499aecc3e1d").to_vec(), + hex!("80ffff8002af9d53d0fe38d916e77086562a2af535ec94a36494384d66273d2339604f2380c5801068e98806370ad5939ba17df962ca6c5e7a7b06b34def0bd9a286f3349780173d3299944e3f85dac5b2c2ecb3f1f13f26df47f38c25d937077d0f344caa0780521bb76b6b176fa67e1f40de0f8cdf439ef8dc3e6ca5e483055eeba380bc7b7a809a6d265f539abd682eb0f593cd3c0006367a48bc4a4bd7eb6b755bc48b187c9f8039c39d126632e3b9af053befe643119111fb627077145ebf8ab8277f4e791f6a80646452cc2e74ebf3311ffcdfcaa4bdbd0b31c19d6fc777be9f7a4f5808d96cc2805b682132c52908705526057f73ab7fccab4af6d72a9805634dd8d3cc53f130d180c2d44d371e5fc1f50227d7491ad65ad049630361cefb4ab1844831237609f08380fe93a2a86fd60f3c6b30051cec7e5e72d331b6f4b6fc142834eac567e6a3aca1808b058239988689d9aa6cb8721760371dce42f384ec0f95771555e195320d3e18800ff113df26dc01f6916caf9728ad8ddf2d278362ab63312ec47e40e63ac7ac9880603666dff2710c1262571a56902a9bae2066026f57a9499c98ef56a700abf94c808c1356abbbc74f6009a7b95604976482b2b4573ba58a14072283b5ca5b37bafa806bfdbbf0e0bedcb993b65c9cea1e929a56d78a3b7bc53d1b7ca6fc488e2295ee801f25bd16505bdd55875b871aa63dc73faff8929e8010ca2b535868849af770ed").to_vec(), + hex!("810338345b941f7b5396da7c8a8ee4a561ea107105bc488887d68344fa716bc271a691030290b49b480f77d69ceb87a8b854012d2f704508d735c7a5e03df7a098869e2b6391949b5d132b311d09614c6bcf46b282c8dee37128faef7f10353ec1f310c40c066175726120f01e7e0800000000045250535288db2cb81d66fb9974bab34f6375abcb3531524bec8f7f20c09cea921e9eae84092d09056175726101017a967f2b9621cdaaf8860e8887f82f950580bd90f366382092452b019a71217039afdf809b48809cfe00b68a958ff74bb38b070216f90d10ffad2d1aa665bc82").to_vec(), + hex!("9e710b30bd2eab0352ddcc26417aa1945f43803b3441f15daa8a53147d69c48eac75356fab581febbb8030520b248c5942a148804dbeecdd4792782a820b4f713c58dece06bd69e8fcb9b506fe052a24eb7eb0eb802e2e0716043a02f2f29fdd52922704af194b98545ce5ca832255e8ec41bcdb6480a0718fee6fd849f63aebd00a6e9d09e984d70549c0b5475b16c244090876e628505f0e7b9012096b41c4eb3aaf947f6ea4290800004c5f03c716fb8fff3de61a883bb76adb34a20400808aefdc67024312a782a33b24ee2d1bfa728e3842db64274191fa9a4f0f7a56744c5f0f4993f016e2d2f8e5f43be7bb259486040080949e352413ff8a43f35e73a6077d7a87a2de45fb6ce9bc40ad3717bdbf7a5708").to_vec(), + hex!("9f0b3c252fcb29d88eff4f3de5de4476c3500080d94a128016b9dd6dce1aca270b09fa36eeb8227e134f24b89ca7bde76723c44c808f4595bab11d5f07ca595107dbae994cd82279c9b5e437230d387e2be69c49bd").to_vec(), ]); let dip_commitment_proof = DipCommitmentStateProof::new(vec![ - hex!("7f2403f9d16616f8b2725e4943c7d52ca3f47645d53dadef3a2fff9347958d6c896a9d8c93d2c77b844f01a12dfa1fa4ab9a00008006c5fe6f90767dabc1300511e799824561398773f9e87db30f62c49ad5820d7f").to_vec(), - hex!("800c8080da28793d083b197f8d92fc3e77f5064436f1d8eea0fbea56ddb936aba654450080844045a19371db591cd5a3a2208e48377af097957887812434f9427425d94d72808d726a582260bcfa0bff4b499c80733fd9435e69d1468c58d365e1a09140af00").to_vec(), - hex!("80ffff80353e4d164b13c87910044f1b4e76277e404a0ab46a7cd6c33a65aaadc2375ba88007b1390da34b4dce1328430fd924a6e193517a8148dd70a912c0dc2f7f8d2d4c80f6530c738de13d0b7d40dacd86b60a8208a9ed8b830213897554539a7d0810bf80a7fcb88bab872bcaa970cd9d2d39b374e879824e0386ca22683a7cceef7288df8027d23a487eecbbe30faec61592e3ac212ea5f0f7ed4a4d26a7ebb13c0ea85ad28019604cca6005d5080b81e4a4947bc7342403bb63f0f2710ed797b77da161e5b58014e3e0704c9a07636322335a3c663ec9fd9df8b7bf71d6e8183fefecfbfe0e5080dbb36019911f2e9e4814cdf9f70000801292c80c454ab64e582c360e6f44879e8081844e130a7097df746d0d33f73217d7c593d7cda07cc51611434937a769711480cabbbb0a75f296a2d28581ddce96b140870ae0323da94c391b5d10645c05d1748010ca42e1b971aa31afb2d49feab11453846fb934130207f8d7414f7db080c5c58079e06e2642b7f259494863c940bae5b86cfbe5ce0c072a12f370f422cac257ab80e34bdb523ca7c77cd0250774f9fdc5c93283fd9ddabcd3670ef85d1130ec21ca80f395b7003a2eb1e39c624b9a707a6cb58c3cb6997932fc80662ae19c785a91f580b5e5172489541dfc581e116554b63de15fddf38ffed2b109394749c20b8f6ce3806c855b252bf486677c75b093345eeb02fb689a5de290e94cf3b5c9a6ec04b140").to_vec(), - hex!("9e75edf06348b4330d1e88564111cb3d3000505f0e7b9012096b41c4eb3aaf947f6ea42908000080d215e80254fa4203351180e8847c71d6394706f65d797084e1700776561165a7").to_vec(), - hex!("9f0bf19e4ed2927982e234d989e812f3f320028071027c3ebff96767415d8e07c7140a0153cd58cd756ccfe4379440db4313741680971fd57cff7255f21a73629696972524c89573193928eaf19b6255f3c96c8f16").to_vec(), + hex!("7f340f4ac20413f4e00f0a9eaae0343e8e56e68a94309d0adee950b6a63a0a141a3166c15e8ef25c301531f75e25086fe05a01a12dfa1fa4ab9a000080dc96078e1aa097ade1ee470e32ebdd2e6f5808cbfa62f1a625cc21b88677c272").to_vec(), + hex!("800c8080da28793d083b197f8d92fc3e77f5064436f1d8eea0fbea56ddb936aba654450080a1588f087b233f3494cdc5cdf5147d6dbfa9651bd2974f5e82b3b00dcbfdc0f18081acf868c884e3bbeb26e53acb3a2e4eca7bd36b22d30e0cffb36ed0c48305bb").to_vec(), + hex!("80ffff80353e4d164b13c87910044f1b4e76277e404a0ab46a7cd6c33a65aaadc2375ba88007b1390da34b4dce1328430fd924a6e193517a8148dd70a912c0dc2f7f8d2d4c80f0a8aefb3eb62ec86937a4e49657b03d7de0588ad6bb795a4ebb0b5654d9e63880fef940f449f15a0e6fa92eeac30b55e5a69d939d85dfc9e6b75545ea5fb5b6f680048e707e1b93570f4506833da06205a54a4e7ff36092237904359e7461fd44d38020f7b28bc23361dcfa7b988a30f92202a9fd05d783f27b89f304c41eeca500958014e3e0704c9a07636322335a3c663ec9fd9df8b7bf71d6e8183fefecfbfe0e5080259cb4cd05acf09d7a9d7e9935585ff95670dc498cfc365c25b217d66b985f28802943cf2440d02afc0e2a7fb7567af93eba7d83bba93e8e8d7dc4abe20544cb53802b320a7ee167d52bd32ffcd3d94312f8d17c0eadeb2840c0b448de09ac54e3e7803ee8e59b8b261a960b3d00106c36cecfa42b5f72dac70d37530f1958a080da8080b6d9076aa2cd7e8700fb5a5b3ef182975c6515077195c911748da5d21434220e800eaec11c028f926112839db018f6de72c505168b910bbe589d8c83ebdc4fca8d80f395b7003a2eb1e39c624b9a707a6cb58c3cb6997932fc80662ae19c785a91f580b5e5172489541dfc581e116554b63de15fddf38ffed2b109394749c20b8f6ce380949007eae7367a82ee80988be32c8f8f6d936593122a6576d186ba6be490b5bb").to_vec(), + hex!("9e75edf06348b4330d1e88564111cb3d3000505f0e7b9012096b41c4eb3aaf947f6ea42908000080f20e8f088dd913ee6a53e72e9de980ad8256cb48c3718f8080c0efeeb43e64cd").to_vec(), + hex!("9f0bf19e4ed2927982e234d989e812f3f348408028e4e828a83fd632d6d17fa940bb289ef8d04c1c154ecbf583d677460bef22128048f06290dfec2596fa70eaca62ea496d3dc0cd2f51fd40c61b58d7e5b476eebd80c898c636c42ebafd67de87f4ebe2e79a6de88441d420e423dba761169752355b").to_vec(), ]); let dip_proof = DidMerkleProof::new( vec![ - hex!("80ffff00000000000000000000000000000000").to_vec(), - hex!("81016fe30000000000000000000000").to_vec(), - hex!("8000090000").to_vec(), - hex!("7e57b214552de5fe2406c4cde2ffadc265478d8f8e45dc78868c256a8b4866ea00").to_vec(), - hex!("7edfe406e27bf7ed8f7c4b06f24679a138799a88cf300fd15a052ae2d53c7eb100").to_vec(), - hex!("8000220000").to_vec(), - hex!("7ed5f08f01da4d5d838c3c0c6426436013f75862be45194ab93e70387bf5095b00").to_vec(), - hex!("7e6843609b10ca26da79c387cc536eb690955855ef4f134114ff23285c5982ba00").to_vec(), - hex!("810f02200000").to_vec(), - hex!("7d01993e9f04f1b8e6f18a5601f44e5103224c4d9765947ceba0a3d1346e123500").to_vec(), - hex!("7d0291ae1f08bfade39e5e36051c8cca6e68b750385d07cc53da6428998e602900").to_vec(), - hex!("801022000000").to_vec(), - hex!("7e41ee4a3d7b38791bb0559cd35ee40b2b156f5ff38a1a6ea687a64457c36f7200").to_vec(), - hex!("7e60adecda557e10c2cd0ba412c2e349302ed097d094ffeb16f4701b2aea618700").to_vec(), - hex!("7e34f655e0fbe25baede3a76e3bcdefb3accb2793c743741eabc5d78a745417700").to_vec(), - hex!("8001040000").to_vec(), - hex!("7e565d8afa2d3b25ab6b46dff8bb283f8c6fe06b316c6e0b1ab049953176727c00").to_vec(), - hex!("7e51018a6697855845a053ee9a4a913254a184bc18afe0dc8e7aaad5a9d1583900").to_vec(), - hex!("7f000ec15fc3b3cc3bd5562654d8feccd64f551a2a66c2723851334fd7c85af6934500").to_vec(), - hex!("7f000bad02837aed37702de843a75f8c00e708aa56c9763f940d9836b25f16fdebeb00").to_vec(), - hex!("7f000647b93db48080f756347726a74aa6fefdc21236cc489846288e16526f172a3b00").to_vec(), - hex!("7f00003c45ee0b9ef5c42548a39c82373e2783e0bd1f5eb14cc26f75c3ae29758d0e00").to_vec(), - hex!("801220000000").to_vec(), - hex!("7eb6affef1466702f4a481ce4131b268602bc30abef3707d15be36ad35088fb300").to_vec(), - hex!("7ee57ddc7dbc5fd1c15deaf1bff17a0b71859b1257ab9be7b065f0c256821c9400").to_vec(), - hex!("7e29b0ee6ed03d272cd55547d3caab97737df03e355d5c64f64554852dd1fdb900").to_vec(), - hex!("8000810000").to_vec(), - hex!("7edd1c9a8fcdcffec717722fe5880e22791e6272a8225542cbd6015ba3a6ce1200").to_vec(), - hex!("7ed7820134975ff44fa50fa08a30cf10dbb7a735916abe422bbdfbe9eda6e12a00").to_vec(), - hex!("8010400000").to_vec(), - hex!("7f01ad53785d4ae768679975217fcbd542eda1ff8db297a50ec8dc27898e05049e0000").to_vec(), - hex!("7f0109af0bb791f497f4dfdc13d4dff877003616017d131edea0aefe3e502850b00000").to_vec(), - hex!("8030000000").to_vec(), - hex!("7f0122395d5823abcdfd65e218f72bb0562cd776ebeca015f69ca5c236cc5b6f340000").to_vec(), - hex!("7f01c21c151275046296c998833f0cd4662dd80fc579789efb04aa6bdd70b0c09f0000").to_vec(), - hex!("8024000000").to_vec(), - hex!("7f0185dabb534a1dbac4048505d6a5a08a3dd3588c75216ba69739e81a08e2b0190000").to_vec(), - hex!("7f01e07a74d48fd0c5fea1e0516488c5c008ea5ecb121f9e585120a7cb4910f8790000").to_vec(), - hex!("8000b400000000").to_vec(), - hex!("7f01373b4e8626dd7207c2d63c210e8e77783d2996c3642112bf6c2a4c545af8790000").to_vec(), - hex!("7f015545772ced78f5aca5f79efc23ad4e053052e013a836933afd0b791c1e8b910000").to_vec(), - hex!("7f01f52a574d0309da3f252087e418a38c8a65e8a3f1f1a98410fff133fa3be95a0000").to_vec(), - hex!("7f0196d60c1d3e3852a27b78078ec12231e7ea4d8104b8729e79b345e01affecc80000").to_vec(), - hex!("805010000000").to_vec(), - hex!("7f0139efc9192269ebad118bbffa93357f6bd93f933280f2ad4e5411a735ed53070000").to_vec(), - hex!("7f01f94df3bfae48938b90ceabff13739ba295fa629ee05b694d310f33f98aa9fa0000").to_vec(), - hex!("8040400000").to_vec(), - hex!("8008800000").to_vec(), - hex!("6c3764623339376438353366633061376437316334633400").to_vec(), - hex!("7e73b5d2054d1db7c4ba5e6249535ab732df806eb8a2d08008e8a452b449260000").to_vec(), - hex!("7f00032aa8e1e570c1affae398a770a1337273742b171dd68a67b9ffc7aba0bf850000").to_vec(), - hex!("8009000000").to_vec(), - hex!("7f032057470eb4fe7c5db309eb60252683b20a50812bf10287dc9aad50af6e2d8b010000").to_vec(), - hex!("7f01d6f6a7d1cce502c8a89b1d8f6b80e96233f5e9238362873fd2f2c64d141c440000").to_vec(), - hex!("8014000000").to_vec(), - hex!("7f01c13b2eae63f486d514d13f5cf0bffc7c6855135fb9b2a9830747f216b59b0b0000").to_vec(), - hex!("7f01254d7ae15cf0c2716ba93140763e2d376b1b3393e7b3ca7432b35f811ceaaa0000").to_vec(), - hex!("802500000000").to_vec(), - hex!("80e000000000").to_vec(), - hex!("8080200000").to_vec(), - hex!("7e65a65164ae787d2cd7a0427ee7877949f7faa361134fccee205205566f360000").to_vec(), - hex!("7e4b0216d27ebace4c78e9f6ef667fc461d17ba3ca17eb772cd6ff107913690000").to_vec(), - hex!("7f0009c44e121b255dfb2d555718f7a57813cc7a2d0d9ac8759771f01ef7e6af150000").to_vec(), - hex!("7f00019f07b226114d1f46beee265ae1d353ddcd089a7ca5de6543bdf83458b37d0000").to_vec(), - hex!("7f01dda56493aac9445d47d3bcf1cd41caed3155d177bec6f13c058d5358a95df00000").to_vec(), - hex!("7f0190a4f5d159310e40a12ec4e537d2dcfe8888a4a00a6552813aaaf50ef34e850000").to_vec(), - hex!("802014000000").to_vec(), - hex!("7f0146e967c30f86f51eccceef9a80b7296467433dd5498162a9a4b163b6d1560d0000").to_vec(), - hex!("7f01fdf7bc3f9ebadd02ccfefb9ec43b4224a45aa09a78ccb045f1dde5152a87c60000").to_vec(), - hex!("8000500000").to_vec(), - hex!("7f00097f45183745a2380e1617eb8b28408676557162610b83dce4b58e3f2d78110000").to_vec(), - hex!("7f000f6e2304900b1fe24a34364ee86cd8fb538deb341b38b7664dad4e1a98752a0000").to_vec(), - hex!("80a21000000000").to_vec(), - hex!("7f0105c3bf07b7576c64cf1b9badadb7369288be3199d5704b0c234082b7e99ca40000").to_vec(), - hex!("8002200000").to_vec(), - hex!("7f0008c7c53f036b88ff2bf3a34cc3787d4e821180ea4ebcb925223e065b4eeb6c0000").to_vec(), - hex!("7f000fe34120b267f1ed19b878e2b1b638ae8e686a31b8c18c31d3f0444f0156a30000").to_vec(), - hex!("7f01b03baef5dfddc8a288f54cfd0950ee1517d9825f04d3e0fd5fc284453393520000").to_vec(), - hex!("7f0146d945efbc4811794e5d0f6a1c9a650d7edea807053095ab1c164cc00d51410000").to_vec(), - hex!("8010800000").to_vec(), - hex!("7f010932bdb2cc79743bf17dc42d23db09ee707e727282f45e4e2cd690e12c03810000").to_vec(), - hex!("7f017db1acaaa2340dcf5e35319168afc89254ed996b09cd4dfebdeccbba82d8770000").to_vec(), - hex!("800c130000000000").to_vec(), - hex!("7f010b5cded04e606f5c22c9fc5a0493e431932b3bae31ec202e4d4ac95a1303e80000").to_vec(), - hex!("7f014835eb41231b08afbbc0ee552e6a5a9c6e4acec73b9a86b790d3e7e1b89dc80000").to_vec(), - hex!("7f01a3c84cb233a90760bbf2e38cd37d0a84e7c8c17f4a2f473edb492746f536080000").to_vec(), - hex!("7f010e7019faab3641dca2868a4e7dcab49b57b29c681f291d796c798bf6f841540000").to_vec(), - hex!("7f0153282ed059a09a60806750a25da29e2b36456c87493f3db0b5ce0cc28a08f10000").to_vec(), - hex!("806c0000000000").to_vec(), - hex!("7f03a11be47d883068a1e29c68fcbd9a73a6662c8ab530e076d64120482aa54774010300").to_vec(), - hex!("7f013f6c1c5c18136d873c6e13c4f0f750f038bee17f5743dd84a56d02ec4720910000").to_vec(), - hex!("7f019aa42ff358de40f6124c2ee7bd9b81abcf91542f372685c7bb5bf8882dd7740000").to_vec(), - hex!("7f0130fd748ce3e1d64895244625a084f9b978cac67e3625c791283348a11f50220000").to_vec(), - hex!("802110000000").to_vec(), - hex!("7f03ba0c668b63f955f65585f2986a049582d3e4ae1ac5e55a95907b61ca91c4e5010100").to_vec(), - hex!("7f01c35c1674360f8a969b42fa1e7df3cacdb0266dfb8f95a5b88f61ed576fe7120000").to_vec(), - hex!("8000900000").to_vec(), - hex!("7f00053320f8f37ffb3d441f24b416a3275c304e6fde6ecda2831e951deb94e7c50000").to_vec(), - hex!("7f000183acf9f02c4f1493bb81621d8b2d62a2afd0f4e80b4479bc7a6ea1ee2f4c0000").to_vec(), - hex!("80442800000000").to_vec(), - hex!("7f014ccca248d7952f3f007f42b2e6cb436db45c2bb929668249eac79868039eed0000").to_vec(), - hex!("7f01a63ade95a0104c3b77b7becdcb6d4c0a3de7de703a774988cd38a8ca3d6a420000").to_vec(), - hex!("7f015cd198788a5625ee35d32eb0d51e9f18e8f7ee520bf4cb587a813b2802506d0000").to_vec(), - hex!("8000840000").to_vec(), - hex!("7f0007cdc5272176810379f1ef7c49cc15cf5493a2d41a1d0110bf9a96127c44720000").to_vec(), - hex!("7f000914ff74aff344cd0891c27000c06d83be335175e86586ccf3b8d0dc513c830000").to_vec(), + hex!("80bf2f000000000000000000000000").to_vec(), + hex!("800281000000").to_vec(), + hex!("809697000000000000000000").to_vec(), + hex!("7f000207da77a11b67f17653408a8d6cf85d10b3f366c7e7be82f3b30a8eb935c66c00").to_vec(), + hex!("7f0000acfd57871165f2330ca49a4ddafabc52698bc894c899d6368107056ee90c2200").to_vec(), + hex!("7f000afc8c7501fd42bd62db9953e4c54bdf154ff9f5255ebd362b2b795a271b3a7b00").to_vec(), + hex!("8002020000").to_vec(), + hex!("7edb492c2503f35d8b783e6d077875aedf473c502c3f641c5c87dad957e3f98b00").to_vec(), + hex!("7e1dfe90617727b1c2c2d4a570b6e7d042b228c62eba1aeb0f1d43a99d2ee88300").to_vec(), + hex!("7f0006ad76d64191ec2a4bfee79fadbb7085fa8ccfb7a590cb91b0f3ebd7ec943df900").to_vec(), + hex!("7f0008fd1a85f17803a48501005e8fc59bb69ede7407062f83f1a950b917951f9bba00").to_vec(), + hex!("7f0007beb4c2f6b8b2143dcec8771011006b6380ab3a65530ebc849a6a518e4f586000").to_vec(), + hex!("7f000ceb4ca89584fa1bbb95318204596d8f883101dfeb6b8ebfa61f3a2d081789fe00").to_vec(), + hex!("7f0007a3e3a7ffb4e10170a73b41039e7298b67ae2fe1d7b8cbfbcb9a19122c51e4b00").to_vec(), + hex!("7f01c204f1ff9fb3da19442271d014cf3fafa761d4f624d718e729efba11065e300000").to_vec(), + hex!("7f014c3e671d00ed67683177268a1aae0f7faf290e4754730bb8b0fff18243cc600000").to_vec(), + hex!("802120000000").to_vec(), + hex!("7f036e6b1fa2d0ac6b81387fce6eb985b760f70a43a6d8e0c3f9e78c8a9d9e548e010100").to_vec(), + hex!("7f01ffb682b21cd48217b4010102721378f80e0463cbfbd5a39b0f08b4801d57520000").to_vec(), + hex!("7f01bf0e5f1c3a6536b9b6c7cd2da10e0dfaba631f50ed16a115b6dc53ba1ff2060000").to_vec(), + hex!("7f020af4abba9639e828f74df06a5729504ac2ab50e417065f717ed66ee85d1ff88f0000").to_vec(), + hex!("8000110000").to_vec(), + hex!("7f01ca9fef5649916accf658e00f703dc2d66bca2fe39b3daa24bbbb096a18bdbf0000").to_vec(), + hex!("7f017939667bd5080dd837a5187381b02e5944960f73a364fc3499d39ed10ba47d0000").to_vec(), + hex!("7f020f5333e95049a79201ad8be14bc94440590a41402384ee141b4f17be5b94e57f0000").to_vec(), + hex!("800250000000").to_vec(), + hex!("7f010abbb2522022332bec89495323df12567b5abe2f8fcc2e3da40756bfbb7b5e0000").to_vec(), + hex!("6e353639396133633537343834316234653335336433373700").to_vec(), + hex!("7f0314c0826d524d79a17cb5bc5fd61f9b2d364c9af73a5db87408f389e83afcdf010300").to_vec(), + hex!("8000030000").to_vec(), + hex!("7f03e54fc7807f8c1cbd6e3dac9f3291096e7a2d8ab879934edb402f320a3d46a0010000").to_vec(), + hex!("7f0194423645f905c2ecc8d07b89babe374ebf761c2b4676c95a749ae7f3f840720000").to_vec(), + hex!("7f02058867de4a252085d0a8a1078b6d72b8adf1912565bac7733be05b4bf3cbb4ae0000").to_vec(), + hex!("805800000000").to_vec(), + hex!("7f0131acdacf05ed4d81448e501ff82a979ddfe90342b62c2d439df8b2bdf6f56a0000").to_vec(), + hex!("7f0198d9c99157dc9b19fbe30fa8057f0337cfa0b2e23181081b20137f0a2bba5d0000").to_vec(), + hex!("7f01091a1d3dbf3b1f12c41cf1b4e9c7cf59039aa6407e3010f32d5079ceba07a30000").to_vec(), + hex!("7f020e59e300e930fa773ef7b8ed42a07c77c2913650a8323caa2fd143ecbb75bfac0000").to_vec(), + hex!("7f020a4664e1571d22e18e0d45969da0479cbfb8b2bc5fb37850719f7f7fa506267d0000").to_vec(), + hex!("7f020522e1a7e2ae92f98383e9ff7eb0fbb5baaf09999db7c4161652d3e233af0d140000").to_vec(), ], vec![ RevealedDidKey { - id: hex!("602057470eb4fe7c5db309eb60252683b20a50812bf10287dc9aad50af6e2d8b").into(), + id: hex!("78e54fc7807f8c1cbd6e3dac9f3291096e7a2d8ab879934edb402f320a3d46a0").into(), relationship: DidVerificationKeyRelationship::Authentication.into(), details: DidPublicKeyDetails { key: DidVerificationKey::Sr25519(sr25519::Public(hex!( - "5e4943c7d52ca3f47645d53dadef3a2fff9347958d6c896a9d8c93d2c77b844f" + "e68a94309d0adee950b6a63a0a141a3166c15e8ef25c301531f75e25086fe05a" ))) .into(), - block_number: 65, + block_number: 227u64, }, } .into(), RevealedDidKey { - id: hex!("14ad53785d4ae768679975217fcbd542eda1ff8db297a50ec8dc27898e05049e").into(), + id: hex!("08c204f1ff9fb3da19442271d014cf3fafa761d4f624d718e729efba11065e30").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "b592fcc2bfb5e53dbd40a9997dbf0e0842e4d2487764fbae065656d2a39cf602" + "bd09a314a5f66ad2c56639140862bfaad56071044c78e41ba4756ab21147b824" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("1e09af0bb791f497f4dfdc13d4dff877003616017d131edea0aefe3e502850b0").into(), + id: hex!("0f4c3e671d00ed67683177268a1aae0f7faf290e4754730bb8b0fff18243cc60").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "40c406ffa3475fa5b52446b4b94232aca86e9c50daef7dbc5a4b96a64337df38" + "e503588f6016e08c7ff79c7e74817ecd264b2a97707998748527ef7766819e27" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("2422395d5823abcdfd65e218f72bb0562cd776ebeca015f69ca5c236cc5b6f34").into(), + id: hex!("15ffb682b21cd48217b4010102721378f80e0463cbfbd5a39b0f08b4801d5752").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "3f18b1e4225bb527981502dc337a2966f73541bef4fe9975a2a285bc192bc61f" + "ac95eb8c17f951bb9ae41d19fa9dac75342c6b9b901be6da6a5f42265b491635" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("25c21c151275046296c998833f0cd4662dd80fc579789efb04aa6bdd70b0c09f").into(), + id: hex!("1dbf0e5f1c3a6536b9b6c7cd2da10e0dfaba631f50ed16a115b6dc53ba1ff206").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "14a576035c1b71c705f1158bea900e5317dd140b64d161fbe9b9f849b3e38647" + "c102dfa2aa8b9ed85e5a67c0612bcf6a3b702ad10fab937881bf57e8a344eb5c" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("3285dabb534a1dbac4048505d6a5a08a3dd3588c75216ba69739e81a08e2b019").into(), + id: hex!("2af4abba9639e828f74df06a5729504ac2ab50e417065f717ed66ee85d1ff88f").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "449e1d268626a9b3abd8a09077a0fc2414af2e33bc88e5a13f6cd4e487ef8359" + "89d45b096b0cd8163dc18bd0bf74399c933116f9de79bda845f00d27b3f2c657" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("35e07a74d48fd0c5fea1e0516488c5c008ea5ecb121f9e585120a7cb4910f879").into(), + id: hex!("38ca9fef5649916accf658e00f703dc2d66bca2fe39b3daa24bbbb096a18bdbf").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "979b9f342464eb32b53ad5471020e5476d798b23fa48c8ead7d8a2e63adee276" + "5ce39370f803bea2f945a82e97a06bdea1d340a210dba62f865077018c45cb16" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("4a373b4e8626dd7207c2d63c210e8e77783d2996c3642112bf6c2a4c545af879").into(), + id: hex!("3c7939667bd5080dd837a5187381b02e5944960f73a364fc3499d39ed10ba47d").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "f5e7dd973db0ebd5669e5c9d83ec8bd55043df5abc0eb9a7c34ae96e29dcda6f" + "f675a09e224219c63b3e33b067ff0b2dc1584c504f1908ed2518d5cceae20347" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("4c5545772ced78f5aca5f79efc23ad4e053052e013a836933afd0b791c1e8b91").into(), + id: hex!("4f5333e95049a79201ad8be14bc94440590a41402384ee141b4f17be5b94e57f").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "fc96617a9f5e81e0b5c03edc321247909c39e8d7ffaac7635b8e39110faea061" + "7849c1371c98d2bc940df61b22b5094124eaa82151c85068b97f2a37e5abd713" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("4df52a574d0309da3f252087e418a38c8a65e8a3f1f1a98410fff133fa3be95a").into(), + id: hex!("510abbb2522022332bec89495323df12567b5abe2f8fcc2e3da40756bfbb7b5e").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "27777600efa700166c1055649db55c6a87afeb5f2edf4800e9f81815c3108d50" + "581f2d1e3988a7cf7a695bf77485aa06473b9a67b077df3171dcc15e4d88f521" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("4f96d60c1d3e3852a27b78078ec12231e7ea4d8104b8729e79b345e01affecc8").into(), + id: hex!("7994423645f905c2ecc8d07b89babe374ebf761c2b4676c95a749ae7f3f84072").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "24acf15ac6929d13fe510e1758a39d685533e4c95761339420584c4565be1875" + "82545402deeffdc4a6c8d53f8b2442f54e4ec5ed0c26f59d8089300699b7a40a" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("5439efc9192269ebad118bbffa93357f6bd93f933280f2ad4e5411a735ed5307").into(), + id: hex!("858867de4a252085d0a8a1078b6d72b8adf1912565bac7733be05b4bf3cbb4ae").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "aa6650e9d42479acb868e673bc129321548a2eed3f9a70304dfbd03e74e0640d" + "f201c6ca5bb324698e6e1fcebeef42f34f66fd62cd183df1149892a7dcf7cb48" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("56f94df3bfae48938b90ceabff13739ba295fa629ee05b694d310f33f98aa9fa").into(), + id: hex!("9331acdacf05ed4d81448e501ff82a979ddfe90342b62c2d439df8b2bdf6f56a").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "fd49a178ab2711d9b9954334eafca36f21c8eb703a45a776efa9b2d15540c92c" + "baa2ab5a4663e440b13417864b043ce18af6990f5d1563afdb0e2fec040aed3f" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("5c6f73b5d2054d1db7c4ba5e6249535ab732df806eb8a2d08008e8a452b44926").into(), + id: hex!("9498d9c99157dc9b19fbe30fa8057f0337cfa0b2e23181081b20137f0a2bba5d").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "96ac75cb8b69d3914a729e80093b178614057a8c69ccf35a96b091703391e978" + "3f6fb782a6809668998634e264abe3ecc97f15b8f726b86c6a5024fec1d39e53" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("5ce32aa8e1e570c1affae398a770a1337273742b171dd68a67b9ffc7aba0bf85").into(), + id: hex!("96091a1d3dbf3b1f12c41cf1b4e9c7cf59039aa6407e3010f32d5079ceba07a3").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "38671bfbe4da1c55cca5efadbfdeede7e67c801a99f8eff995fdf734d3d39a37" + "de2f7b17ca8a01055027dc2d424ef9b01c0df98ae42fea41a462f84e447ca230" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("63d6f6a7d1cce502c8a89b1d8f6b80e96233f5e9238362873fd2f2c64d141c44").into(), + id: hex!("ae59e300e930fa773ef7b8ed42a07c77c2913650a8323caa2fd143ecbb75bfac").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "dbe3fc55ce46b8e0e41bbfd9ec9e33fd62bfc838ad03e5d17042f83d88305e77" + "755bdbb3dc4f43d8b3a8c8b19f07bc362ab9015fe3276b3f64439f9ec67e8b0f" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("72c13b2eae63f486d514d13f5cf0bffc7c6855135fb9b2a9830747f216b59b0b").into(), + id: hex!("ba4664e1571d22e18e0d45969da0479cbfb8b2bc5fb37850719f7f7fa506267d").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "bcbddd68269c2172e242837cc587bd95b7d6326ba1a21507777cc5cbf81ebf52" + "bdeaf31cab91d67cea1c6b3f64fa9e9e66826e271e01690f181851d8831e4317" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("74254d7ae15cf0c2716ba93140763e2d376b1b3393e7b3ca7432b35f811ceaaa").into(), + id: hex!("d522e1a7e2ae92f98383e9ff7eb0fbb5baaf09999db7c4161652d3e233af0d14").into(), relationship: DidKeyRelationship::Encryption, details: DidPublicKeyDetails { key: DidEncryptionKey::X25519(hex!( - "f9b0e62da4bc84bd266b90ff4b5d00aa5d1c910eab72f4a401e4db64d6aef614" + "cb7cb8c59b2784b87d2270ab4e41f661b4626590954dbd3400208eb1f958f77e" )) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("805765a65164ae787d2cd7a0427ee7877949f7faa361134fccee205205566f36").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "1ce9eacca63e71090633182e317781fc4ce24e4a07e884da787eabbc52f90c5d" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("805d4b0216d27ebace4c78e9f6ef667fc461d17ba3ca17eb772cd6ff10791369").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "a117665f28ede7a0df6cdefb9c33753d667d5b65909611bd576798fe3de35360" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("8069c44e121b255dfb2d555718f7a57813cc7a2d0d9ac8759771f01ef7e6af15").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "8507c4a02f173edc4f85317e9b765ac4c15a682cde800e5d853adf8c345aba3e" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("80719f07b226114d1f46beee265ae1d353ddcd089a7ca5de6543bdf83458b37d").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "b4b3f9dd5fe448cd31a1cc2276f02934c5b4b3287bf2cb0ba466be4db0e41656" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("82dda56493aac9445d47d3bcf1cd41caed3155d177bec6f13c058d5358a95df0").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "7b88d2a3a7dd19a4c2a2ef766facbc59136c77744c9a7625b80446a1ee63770f" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("8590a4f5d159310e40a12ec4e537d2dcfe8888a4a00a6552813aaaf50ef34e85").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "2cc6176fecee453f1403277b5b4c56597f8b1d585f970243249c17b3b2b61038" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("9546e967c30f86f51eccceef9a80b7296467433dd5498162a9a4b163b6d1560d").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "f3daf4c51548d0542efa8880e5ea7ff0a6669d02cf7910c576cdfcd9ee278115" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("9afdf7bc3f9ebadd02ccfefb9ec43b4224a45aa09a78ccb045f1dde5152a87c6").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "6c146a8d09e29c042a1790ae2a26e1d59d6ba9f43d130008db58347fc3284453" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("9cc97f45183745a2380e1617eb8b28408676557162610b83dce4b58e3f2d7811").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "01da52dfd25f59f1938974e127ab6a61f3f66b64c4d47e2a1bd1e4db45a8fc5a" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("9cef6e2304900b1fe24a34364ee86cd8fb538deb341b38b7664dad4e1a98752a").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "c93aa6c996c80f74195b7b32b79f4b33668857ef477b29f9e60ee9531ab85800" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("a105c3bf07b7576c64cf1b9badadb7369288be3199d5704b0c234082b7e99ca4").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "0326177df0d4a3a0b520682e8a1f07a3c1bdc05d102744e31a7ef16c4224b36a" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("a518c7c53f036b88ff2bf3a34cc3787d4e821180ea4ebcb925223e065b4eeb6c").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "73bd63787af4bd759b9705fe0427bdffa9213c0ea7ec6ea6441e6ce2a2f1aa33" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("a5dfe34120b267f1ed19b878e2b1b638ae8e686a31b8c18c31d3f0444f0156a3").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "97592a0630ba772ff25d8e44f0923e74a407e20588faac07e2e99f3fc7569f40" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("a7b03baef5dfddc8a288f54cfd0950ee1517d9825f04d3e0fd5fc28445339352").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "99b5d7f045c444f5c7b10d9a8c4a35e9fcf570e9dac2a313ec719ad10182b838" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("ac46d945efbc4811794e5d0f6a1c9a650d7edea807053095ab1c164cc00d5141").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "0bd02dcc95c971dd82e0df2ef093b6dd35dba13b87de1f784e2ecdbd6f0b4018" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("b40932bdb2cc79743bf17dc42d23db09ee707e727282f45e4e2cd690e12c0381").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "0aeea7d0d826cf245427cae46e9936cd980676a9e7a67c8f2c6abe44ecd15031" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("bf7db1acaaa2340dcf5e35319168afc89254ed996b09cd4dfebdeccbba82d877").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "86544d9dc2e9e040fa863c2931b9cf19bf2ccfdea0763b0b43c10d9b315a7a07" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("c20b5cded04e606f5c22c9fc5a0493e431932b3bae31ec202e4d4ac95a1303e8").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "b33918a4bd6691a2fdcc5851ad098a096eed6037c60fd2b7744973fc0362475a" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("c34835eb41231b08afbbc0ee552e6a5a9c6e4acec73b9a86b790d3e7e1b89dc8").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "5cb3d63b83b81bb32beb7812207838df72e251d51546f1f1aedd8b5eeefae301" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("c8a3c84cb233a90760bbf2e38cd37d0a84e7c8c17f4a2f473edb492746f53608").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "aa4d43c1816f8f31cbdb669449917779b38249bf554fc76cec25316b33f5aa26" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("c90e7019faab3641dca2868a4e7dcab49b57b29c681f291d796c798bf6f84154").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "daf05f0523aa08837a2ca4697bef006c0a361813db80061f9d75d7607036e90b" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("cc53282ed059a09a60806750a25da29e2b36456c87493f3db0b5ce0cc28a08f1").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "1e382ba8ead527d8377e5ebf3a3bee6b3d4b6fee2f71f1381be79148c2b8457a" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("d33f6c1c5c18136d873c6e13c4f0f750f038bee17f5743dd84a56d02ec472091").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "b75d34b52629725ca611f05c92e7b8ab2c012081d83ba2b493cec265a23c5b5d" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("d59aa42ff358de40f6124c2ee7bd9b81abcf91542f372685c7bb5bf8882dd774").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "50e9d2ba03660e5386263c25b68a35222d450677e9faab7245f0981455345c21" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("d630fd748ce3e1d64895244625a084f9b978cac67e3625c791283348a11f5022").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "a89fd540aa526d06c4217cc503664c9e8d8b668634befc304f0b455234cee73f" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("e5c35c1674360f8a969b42fa1e7df3cacdb0266dfb8f95a5b88f61ed576fe712").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "546bca48d552ee30e75384a891fb0a0fad3c0508c0488d3e274152d1cd1b8f7e" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("ecc53320f8f37ffb3d441f24b416a3275c304e6fde6ecda2831e951deb94e7c5").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "994b26c2282d4fa54257dd772c7946099b484be85447a86e000ac9e8955b9013" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("ecf183acf9f02c4f1493bb81621d8b2d62a2afd0f4e80b4479bc7a6ea1ee2f4c").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "5da8b96bd0dfc4309ab0bedfe81d026c7737cd1af648004abd621e6b17578228" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("f24ccca248d7952f3f007f42b2e6cb436db45c2bb929668249eac79868039eed").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "3f3fa3a63df3a1ca6d1669f5d08e5f036cb7a8b0f6b51b82e55c921f85a9ee32" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("f6a63ade95a0104c3b77b7becdcb6d4c0a3de7de703a774988cd38a8ca3d6a42").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "433cde68cf1af4785decf8e6c8c2caccc9ec2c3386d7fd9bc94368a7f8d4453f" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("fb5cd198788a5625ee35d32eb0d51e9f18e8f7ee520bf4cb587a813b2802506d").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "bc9db68c0ef1feb18ae9d4cb129a6af40308d9eb134e1c27fa3ed37ac836b15b" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("fda7cdc5272176810379f1ef7c49cc15cf5493a2d41a1d0110bf9a96127c4472").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "05806aed54131797a26027561c3a4932cf03f1fe55fd26371bf696029ad88e38" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("fdf914ff74aff344cd0891c27000c06d83be335175e86586ccf3b8d0dc513c83").into(), - relationship: DidKeyRelationship::Encryption, - details: DidPublicKeyDetails { - key: DidEncryptionKey::X25519(hex!( - "5d68a6b1cf91e0e69a17c2e2a8151f65bbb1f0594c879dfc1a86c0a7d6274f6e" - )) - .into(), - block_number: 65, - }, - } - .into(), - RevealedDidKey { - id: hex!("e0ba0c668b63f955f65585f2986a049582d3e4ae1ac5e55a95907b61ca91c4e5").into(), + id: hex!("106e6b1fa2d0ac6b81387fce6eb985b760f70a43a6d8e0c3f9e78c8a9d9e548e").into(), relationship: DidVerificationKeyRelationship::CapabilityDelegation.into(), details: DidPublicKeyDetails { key: DidVerificationKey::Ed25519(ed25519::Public(hex!( - "fe08d9dfaf751d9bc1ab6d38884055f913680f1bf5e9cd4ed118b7534ce89a13" + "39985b639d8d21629190f2a310b0e2b935894a6261e45ba58f0fbf2bd6c0c832" ))) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedDidKey { - id: hex!("d2a11be47d883068a1e29c68fcbd9a73a6662c8ab530e076d64120482aa54774").into(), + id: hex!("5e14c0826d524d79a17cb5bc5fd61f9b2d364c9af73a5db87408f389e83afcdf").into(), relationship: DidVerificationKeyRelationship::AssertionMethod.into(), details: DidPublicKeyDetails { key: DidVerificationKey::Ed25519(ed25519::Public(hex!( - "b3d80300165e3b9d46528c0c0f37edcd1d80e0c31c3ce2b2f248765b755292b7" + "6c89991144954da6d916f88e59ce0c52bc2dcea2e7edd065e750234ebbb8d8eb" ))) .into(), - block_number: 65, + block_number: 227, }, } .into(), RevealedAccountId( - AccountId32::new(hex!("6ec15fc3b3cc3bd5562654d8feccd64f551a2a66c2723851334fd7c85af69345")).into(), - ) - .into(), - RevealedAccountId( - AccountId32::new(hex!("e4e57ddc7dbc5fd1c15deaf1bff17a0b71859b1257ab9be7b065f0c256821c94")).into(), - ) - .into(), - RevealedAccountId( - AccountId32::new(hex!("2f11993e9f04f1b8e6f18a5601f44e5103224c4d9765947ceba0a3d1346e1235")).into(), - ) - .into(), - RevealedAccountId( - AccountId32::new(hex!("19d5f08f01da4d5d838c3c0c6426436013f75862be45194ab93e70387bf5095b")).into(), - ) - .into(), - RevealedAccountId( - AccountId32::new(hex!("9647b93db48080f756347726a74aa6fefdc21236cc489846288e16526f172a3b")).into(), - ) - .into(), - RevealedAccountId( - AccountId32::new(hex!("50565d8afa2d3b25ab6b46dff8bb283f8c6fe06b316c6e0b1ab049953176727c")).into(), - ) - .into(), - RevealedAccountId( - AccountId32::new(hex!("0bdfe406e27bf7ed8f7c4b06f24679a138799a88cf300fd15a052ae2d53c7eb1")).into(), - ) - .into(), - RevealedAccountId( - AccountId32::new(hex!("3960adecda557e10c2cd0ba412c2e349302ed097d094ffeb16f4701b2aea6187")).into(), - ) - .into(), - RevealedAccountId( - AccountId32::new(hex!("1d6843609b10ca26da79c387cc536eb690955855ef4f134114ff23285c5982ba")).into(), - ) - .into(), - RevealedAccountId( - AccountId32::new(hex!("f8dd1c9a8fcdcffec717722fe5880e22791e6272a8225542cbd6015ba3a6ce12")).into(), - ) - .into(), - RevealedAccountId( - AccountId32::new(hex!("ed29b0ee6ed03d272cd55547d3caab97737df03e355d5c64f64554852dd1fdb9")).into(), + AccountId32::new(hex!("a7beb4c2f6b8b2143dcec8771011006b6380ab3a65530ebc849a6a518e4f5860")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("ffd7820134975ff44fa50fa08a30cf10dbb7a735916abe422bbdfbe9eda6e12a")).into(), + AccountId32::new(hex!("86ad76d64191ec2a4bfee79fadbb7085fa8ccfb7a590cb91b0f3ebd7ec943df9")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("e1b6affef1466702f4a481ce4131b268602bc30abef3707d15be36ad35088fb3")).into(), + AccountId32::new(hex!("791dfe90617727b1c2c2d4a570b6e7d042b228c62eba1aeb0f1d43a99d2ee883")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("0857b214552de5fe2406c4cde2ffadc265478d8f8e45dc78868c256a8b4866ea")).into(), + AccountId32::new(hex!("71db492c2503f35d8b783e6d077875aedf473c502c3f641c5c87dad957e3f98b")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("2fd291ae1f08bfade39e5e36051c8cca6e68b750385d07cc53da6428998e6029")).into(), + AccountId32::new(hex!("f7a3e3a7ffb4e10170a73b41039e7298b67ae2fe1d7b8cbfbcb9a19122c51e4b")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("3441ee4a3d7b38791bb0559cd35ee40b2b156f5ff38a1a6ea687a64457c36f72")).into(), + AccountId32::new(hex!("20acfd57871165f2330ca49a4ddafabc52698bc894c899d6368107056ee90c22")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("8bad02837aed37702de843a75f8c00e708aa56c9763f940d9836b25f16fdebeb")).into(), + AccountId32::new(hex!("1207da77a11b67f17653408a8d6cf85d10b3f366c7e7be82f3b30a8eb935c66c")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("5a51018a6697855845a053ee9a4a913254a184bc18afe0dc8e7aaad5a9d15839")).into(), + AccountId32::new(hex!("98fd1a85f17803a48501005e8fc59bb69ede7407062f83f1a950b917951f9bba")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("d03c45ee0b9ef5c42548a39c82373e2783e0bd1f5eb14cc26f75c3ae29758d0e")).into(), + AccountId32::new(hex!("cceb4ca89584fa1bbb95318204596d8f883101dfeb6b8ebfa61f3a2d081789fe")).into(), ) .into(), RevealedAccountId( - AccountId32::new(hex!("3d34f655e0fbe25baede3a76e3bcdefb3accb2793c743741eabc5d78a7454177")).into(), + AccountId32::new(hex!("4afc8c7501fd42bd62db9953e4c54bdf154ff9f5255ebd362b2b795a271b3a7b")).into(), ) .into(), RevealedWeb3Name { - web3_name: b"c7db397d853fc0a7d71c4c4".to_vec().try_into().unwrap(), - claimed_at: 65, + web3_name: b"5699a3c574841b4e353d377".to_vec().try_into().unwrap(), + claimed_at: 227, } .into(), ], ); - let signature = TimeBoundDidSignature::new(DidSignature::Sr25519(sr25519::Signature(hex!("3004ba5f86d048439a9abdf36eeaea90decf5391d9ad4a2b4c4ba11137c7447c92f841018defc2ffa1054e5da6656ad1ddd7ac015fdec902bf98fd4f707b4b80"))), 57 as BlockNumberFor); + let signature = TimeBoundDidSignature::new(DidSignature::Sr25519(sr25519::Signature(hex!("1ca20d39357dba602862e6b6371887c6b1ec46c86ead3c92178cca814e3ff45f7fd6a58395d422b53b6e1d1ab7be5944dbc2c6e640ecfac67c02a218607cc881"))), 282 as BlockNumberFor); let proof = ParachainDipDidProof::new(provider_head_state_proof, dip_commitment_proof, dip_proof, signature); BlockHash::insert( 0, - H256(hex!("c4a31d219fa5fe2dfa9160a2e664f33965f019732f2dd5249168066c1bfb6aae")), + H256(hex!("74f8cd2f3764f676a5e67c45a641ce1025548c6cddcf524a663a9c0aaf7fbee2")), ); LatestRelayHeads::insert( PROOF_RELAY_BLOCK, RelayParentInfo { relay_parent_storage_root: H256(hex!( - "baab06b3fca8881e14a954e81fac724bd3967e30f24a0eb234602180516cb164" + "29575e65f298648588bc53a45346098e89a99c7330f53d93a899efbb24ddfb69" )), }, ); @@ -993,10 +491,10 @@ impl kilt_support::traits::GetWorstCase for ProviderTemplateProofVerifierWrapper text: b"Hello, world!".to_vec().try_into().unwrap(), } .into(), - // 4q3h66CC45jSL5dpcY4B9BWUeJtPFgwVQr4BAW7HEEmy5iZp - subject: DidIdentifier::new(hex!("5e4943c7d52ca3f47645d53dadef3a2fff9347958d6c896a9d8c93d2c77b844f")), - // 4oq393G4AHrbTR33D4t45HXm4myUYiXJwiSXQZETAsFiJqYW - submitter: AccountId::new(hex!("286656971deb16389ba37da9d8dd8ee331ccfb8780f05c705c2c938f1f6b030b")), + // 4t8M197K3r1xygdVNoRLRBCpWf6G58VcWTKQUiv5kbJiQhvs + subject: DidIdentifier::new(hex!("e68a94309d0adee950b6a63a0a141a3166c15e8ef25c301531f75e25086fe05a")), + // 4rBcMBgT7HzH9NaTpgcBT8AfDUmJjRWiiYGpsqa19CJTSHL3 + submitter: AccountId::new(hex!("908f818bebf2db6d64d86cce811d2133e2d9c9ac447c6c5cc61b23ab04e1fc30")), } } } diff --git a/dip-template/runtimes/dip-provider/src/dip.rs b/dip-template/runtimes/dip-provider/src/dip.rs index 0eac34638f..72f8998de3 100644 --- a/dip-template/runtimes/dip-provider/src/dip.rs +++ b/dip-template/runtimes/dip-provider/src/dip.rs @@ -34,7 +34,7 @@ use crate::{ weights, AccountId, Balances, DidIdentifier, Runtime, RuntimeEvent, RuntimeHoldReason, }; -pub const MAX_REVEALABLE_LINKED_ACCOUNTS: u32 = 20; +pub const MAX_REVEALABLE_LINKED_ACCOUNTS: u32 = 10; pub mod runtime_api { use super::*; diff --git a/dip-template/runtimes/dip-provider/src/lib.rs b/dip-template/runtimes/dip-provider/src/lib.rs index f23dbc18a4..d312f55149 100644 --- a/dip-template/runtimes/dip-provider/src/lib.rs +++ b/dip-template/runtimes/dip-provider/src/lib.rs @@ -376,12 +376,13 @@ impl did::DeriveDidCallAuthorizationVerificationKeyRelationship for RuntimeCall } } -pub const MAX_PUBLIC_KEYS_PER_DID: u32 = 53; +pub const MAX_PUBLIC_KEYS_PER_DID: u32 = 20; +const MAX_TOTAL_KEY_AGREEMENT_KEYS: u32 = MAX_PUBLIC_KEYS_PER_DID - 1; parameter_types! { #[derive(Debug, Clone, Eq, PartialEq)] - pub const MaxTotalKeyAgreementKeys: u32 = 50; + pub const MaxTotalKeyAgreementKeys: u32 = MAX_TOTAL_KEY_AGREEMENT_KEYS; #[derive(Debug, Clone, Eq, PartialEq, TypeInfo, Encode, Decode)] - pub const MaxNewKeyAgreementKeys: u32 = 50; + pub const MaxNewKeyAgreementKeys: u32 = MAX_TOTAL_KEY_AGREEMENT_KEYS; } impl did::Config for Runtime { diff --git a/pallets/pallet-deposit-storage/src/lib.rs b/pallets/pallet-deposit-storage/src/lib.rs index 0e05c2bcbf..4953223a38 100644 --- a/pallets/pallet-deposit-storage/src/lib.rs +++ b/pallets/pallet-deposit-storage/src/lib.rs @@ -149,8 +149,14 @@ pub mod pallet { /// deposit instance. #[pallet::storage] #[pallet::getter(fn deposits)] - pub(crate) type Deposits = - StorageDoubleMap<_, Twox64Concat, ::Namespace, Twox64Concat, DepositKeyOf, DepositEntryOf>; + pub(crate) type Deposits = StorageDoubleMap< + _, + Blake2_128Concat, + ::Namespace, + Blake2_128Concat, + DepositKeyOf, + DepositEntryOf, + >; #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] diff --git a/pallets/pallet-dip-consumer/src/lib.rs b/pallets/pallet-dip-consumer/src/lib.rs index 5122e0b7ff..ab72c18e7b 100644 --- a/pallets/pallet-dip-consumer/src/lib.rs +++ b/pallets/pallet-dip-consumer/src/lib.rs @@ -44,7 +44,6 @@ pub mod pallet { dispatch::{Dispatchable, GetDispatchInfo, PostDispatchInfo}, pallet_prelude::*, traits::{Contains, EnsureOriginWithArg}, - Twox64Concat, }; use frame_system::pallet_prelude::*; use parity_scale_codec::{FullCodec, MaxEncodedLen}; @@ -111,7 +110,7 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn identity_proofs)] pub(crate) type IdentityEntries = - StorageMap<_, Twox64Concat, ::Identifier, ::LocalIdentityInfo>; + StorageMap<_, Blake2_128Concat, ::Identifier, ::LocalIdentityInfo>; #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] diff --git a/pallets/pallet-dip-provider/src/lib.rs b/pallets/pallet-dip-provider/src/lib.rs index 75ad0e4c51..311649319d 100644 --- a/pallets/pallet-dip-provider/src/lib.rs +++ b/pallets/pallet-dip-provider/src/lib.rs @@ -91,7 +91,7 @@ pub mod pallet { #[pallet::getter(fn identity_commitments)] pub type IdentityCommitments = StorageDoubleMap< _, - Twox64Concat, + Blake2_128Concat, ::Identifier, Twox64Concat, IdentityCommitmentVersion,