Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
2c2d8b5
feat: initial commit
ntn-x2 Jul 8, 2021
b07bf96
feat: pallet compiling
ntn-x2 Jul 9, 2021
fde4a99
wip: fixing test cases
ntn-x2 Jul 9, 2021
7249e29
wip: refactoring test cases
ntn-x2 Jul 12, 2021
7c9e8e8
test: unit tests passing again
ntn-x2 Jul 13, 2021
5c8dc90
benchmark tests passing
ntn-x2 Jul 13, 2021
080bb41
test: attestation unit tests passing
ntn-x2 Jul 13, 2021
626c23b
chore: clippy fixes
ntn-x2 Jul 13, 2021
16c8e01
chore: fmt fixes
ntn-x2 Jul 13, 2021
b292231
bench: re-execute benchmarks for delegation and attestation + tempora…
ntn-x2 Jul 13, 2021
9f11e2d
fix: adjust pre-condition for an attestation unit test
ntn-x2 Jul 13, 2021
cf43f9e
Merge branch 'develop' of github.com:KILTprotocol/mashnet-node into a…
ntn-x2 Jul 13, 2021
9bf1119
wip: add initial support for delegation storage migrations
ntn-x2 Jul 14, 2021
badcb0f
delegation storage migrator compiling
ntn-x2 Jul 14, 2021
2dd672f
wip: storage migrator working, now writing unit tests for it
ntn-x2 Jul 14, 2021
ce7c8c7
test: unit tests passing
ntn-x2 Jul 14, 2021
18955fb
chore: clippy hints
ntn-x2 Jul 14, 2021
82b2c13
chore: further clippy fixes
ntn-x2 Jul 14, 2021
3122b26
chore: fmt
ntn-x2 Jul 14, 2021
9730fc4
wip: adjusting last things before possible to review
ntn-x2 Jul 14, 2021
86fa9f2
Merge branch 'develop' of github.com:KILTprotocol/mashnet-node into a…
ntn-x2 Jul 14, 2021
e51b478
chore: clippy + fmt
ntn-x2 Jul 15, 2021
cbc29eb
fix: address part of PR review comments
ntn-x2 Jul 15, 2021
ad732b3
fix: more comments from PR review
ntn-x2 Jul 15, 2021
91cfc82
wip: change vector of versions to enum
ntn-x2 Jul 15, 2021
429076d
test: unit tests refactor for the new storage migrator version
ntn-x2 Jul 16, 2021
29db043
chore: refactor
ntn-x2 Jul 16, 2021
25a01bd
test: unit tests passing again
ntn-x2 Jul 16, 2021
0040f2d
chore: move deprecated type to deprecated.rs
ntn-x2 Jul 16, 2021
b260519
chore: refactor import/export
ntn-x2 Jul 16, 2021
c68e3f3
doc: refine documentation
ntn-x2 Jul 16, 2021
dc92d95
chore: fmt + clippy
ntn-x2 Jul 16, 2021
93265d6
test: add TODO to improve post_migration tests
ntn-x2 Jul 16, 2021
cc96873
feat: remove test feature from traits
ntn-x2 Jul 19, 2021
37fb969
test: add checks during migration in try-runtime
ntn-x2 Jul 19, 2021
d9506a7
bench: add spiritnet benchmarks for delegation and attestation
ntn-x2 Jul 19, 2021
3dc973e
feat: additional logs for count of migrated nodes
ntn-x2 Jul 19, 2021
48d51d3
chore: fmt
ntn-x2 Jul 19, 2021
135facf
chore: removed useless file
ntn-x2 Jul 19, 2021
13030f7
chore: bump runtime version
ntn-x2 Jul 19, 2021
78ea8b5
fix: PR comments
ntn-x2 Jul 19, 2021
310cad8
fix: re-introduce root_id in delegation creation hash
ntn-x2 Jul 21, 2021
ef941d3
chore: capitalize storage version enum
ntn-x2 Jul 21, 2021
e96bc31
chore: move migrations in their own module
ntn-x2 Jul 21, 2021
234571c
chore: move migrations.rs out of the migrations folder
ntn-x2 Jul 21, 2021
1e6b436
fix: add check for parent revocation status when creating a delegation
ntn-x2 Jul 21, 2021
364c7a8
chore: fmt
ntn-x2 Jul 21, 2021
11bcc2d
feat: remove revoke_hierarchy extrinsic
ntn-x2 Jul 21, 2021
cf550eb
bench: add peregrine benchmarks
ntn-x2 Jul 21, 2021
05fac68
bench: re-run delegation and attestation default benchmarks
ntn-x2 Jul 21, 2021
dc25b86
Merge branch 'develop' of github.com:KILTprotocol/mashnet-node into a…
ntn-x2 Jul 22, 2021
78d2bcf
Merge branch 'develop' of github.com:KILTprotocol/mashnet-node into a…
ntn-x2 Jul 27, 2021
879e194
chore: fmt
ntn-x2 Jul 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 21 additions & 26 deletions pallets/attestation/src/default_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,24 @@
//! Autogenerated weights for attestation
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-06-11, STEPS: {{cmd.steps}}\, REPEAT: {{cmd.repeat}}\, LOW RANGE: {{cmd.lowest_range_values}}\, HIGH RANGE: {{cmd.highest_range_values}}\
//! DATE: 2021-07-21, STEPS: {{cmd.steps}}\, REPEAT: {{cmd.repeat}}\, LOW RANGE: {{cmd.lowest_range_values}}\, HIGH RANGE: {{cmd.highest_range_values}}\
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// ./kilt-parachain
// target/release/kilt-parachain
// benchmark
// --chain
// dev
// --execution
// wasm
// --wasm-execution
// compiled
// --pallet
// attestation
// --extrinsic
// *
// --steps
// 1
// --repeat
// 10
// --chain=dev
// --execution=wasm
// --wasm-execution=Compiled
// --heap-pages=4096
// --output=../../pallets/attestation/src/default_weights.rs
// --template=../../.maintain/weight-template.hbs
// --extrinsic=*
// --pallet=attestation
// --steps=1
// --repeat=20
// --template
// .maintain/weight-template.hbs
// --output
// pallets/attestation/src/default_weights.rs


#![cfg_attr(rustfmt, rustfmt_skip)]
Expand All @@ -61,14 +56,14 @@ pub trait WeightInfo {
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn add() -> Weight {
(37_981_000_u64)
(38_091_000_u64)
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(2_u64))
}
fn revoke(d: u32, ) -> Weight {
(23_806_000_u64)
// Standard Error: 20_000
.saturating_add((4_670_000_u64).saturating_mul(d as Weight))
(25_042_000_u64)
// Standard Error: 28_000
.saturating_add((4_866_000_u64).saturating_mul(d as Weight))
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(d as Weight)))
.saturating_add(T::DbWeight::get().writes(1_u64))
Expand All @@ -78,14 +73,14 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// For backwards compatibility and tests
impl WeightInfo for () {
fn add() -> Weight {
(37_981_000_u64)
(38_091_000_u64)
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(2_u64))
}
fn revoke(d: u32, ) -> Weight {
(23_806_000_u64)
// Standard Error: 20_000
.saturating_add((4_670_000_u64).saturating_mul(d as Weight))
(25_042_000_u64)
// Standard Error: 28_000
.saturating_add((4_866_000_u64).saturating_mul(d as Weight))
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(d as Weight)))
.saturating_add(RocksDbWeight::get().writes(1_u64))
Expand Down
13 changes: 7 additions & 6 deletions pallets/attestation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,21 +224,22 @@ pub mod pallet {

// Check for validity of the delegation node if specified.
if let Some(delegation_id) = delegation_id {
let delegation = <delegation::Delegations<T>>::get(delegation_id)
let delegation = <delegation::DelegationNodes<T>>::get(delegation_id)
.ok_or(delegation::Error::<T>::DelegationNotFound)?;

ensure!(!delegation.revoked, Error::<T>::DelegationRevoked);
ensure!(!delegation.details.revoked, Error::<T>::DelegationRevoked);

ensure!(delegation.owner == attester, Error::<T>::NotDelegatedToAttester);
ensure!(delegation.details.owner == attester, Error::<T>::NotDelegatedToAttester);

ensure!(
(delegation.permissions & delegation::Permissions::ATTEST) == delegation::Permissions::ATTEST,
(delegation.details.permissions & delegation::Permissions::ATTEST)
== delegation::Permissions::ATTEST,
Error::<T>::DelegationUnauthorizedToAttest
);

// Check if the CType of the delegation is matching the CType of the attestation
let root =
<delegation::Roots<T>>::get(delegation.root_id).ok_or(delegation::Error::<T>::RootNotFound)?;
let root = <delegation::DelegationHierarchies<T>>::get(delegation.hierarchy_root_id)
.ok_or(delegation::Error::<T>::HierarchyNotFound)?;
ensure!(root.ctype_hash == ctype_hash, Error::<T>::CTypeMismatch);

// If the attestation is based on a delegation, store separately
Expand Down
Loading