Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: benchmarks #585

Merged
merged 75 commits into from
Dec 6, 2023
Merged

feat: benchmarks #585

merged 75 commits into from
Dec 6, 2023

Conversation

Ad96el
Copy link
Member

@Ad96el Ad96el commented Nov 22, 2023

fixes KILTProtocol/ticket#2551

This pull request introduces benchmark logic for the DIP templates. To calculate default weights, a dummy implementation of the pallets in the Peregrine runtime is defined. After the PR is approved, I will remove the dummy implementation.

Leftover tasks

  • Make the provider and consumer binaries compiles for benchmarking. Currently the VersionedSiblingParachainDipStateProof type does not implement the WorstCase trait, which is a blocker to use it in benchmarks
  • Adjust the DipProofVerifier logic to allow any calls to be dispatched when being benchmarked
  • Make sure everything compiles
  • Make sure benchmarks can actually be run for both provider and consumer runtimes

@Ad96el Ad96el changed the title Ag dip benchmarks feat: benchmarks Nov 22, 2023
@ntn-x2 ntn-x2 mentioned this pull request Nov 23, 2023
30 tasks
@ntn-x2 ntn-x2 force-pushed the ag-dip-benchmarks branch from d0e5609 to 69ad8e4 Compare December 1, 2023 16:37
Copy link
Member Author

@Ad96el Ad96el left a comment

Choose a reason for hiding this comment

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

LGTM. I have one concern, which may not be related to this PR. I believe the benchmarks might not currently work for the template. The dip-consumer template is currently using KiltVersionedSiblingProviderVerifier as ProofVerifier. The derive_verification_key_relationship function would return None for the call defined in the benchmark (frame_support::call::remark). As a result, the check_call_origin_info returns an error.

I would argue that the template should demonstrate how to benchmark the consumer pallet. In the pallet-dip-consumer pallet, the call is currently excluded based on feature guidance. So maybe adding a feature guided match arm in derive_verification_key_relationship is for the moment a good solution? If it is not important, ignore this comment.

Comment on lines 437 to 460
#[cfg(feature = "runtime-benchmarks")]
mod benches {
frame_benchmarking::define_benchmarks!(
[frame_system, SystemBench::<Runtime>]
[cumulus_pallet_parachain_system, ParachainSystem]
[pallet_timestamp, Timestamp]
[pallet_sudo, Sudo]
[pallet_utility, Utility]
[pallet_balances, Balances]
[pallet_transaction_payment, TransactionPayment]
[pallet_authorship, Authorship]
[pallet_collator_selection, CollatorSelection]
[pallet_session, Session]
[pallet_aura, Aura]
[cumulus_pallet_aura_ext, AuraExt]
[did, Did]
[pallet_did_lookup, DidLookup]
[pallet_web3_names, Web3Names]
[pallet_deposit_storage, DepositStorage]
[pallet_dip_provider, DipProvider]
[frame_benchmarking::baseline, Baseline::<Runtime>]
);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps I made a mistake. I compiled the branch using: cargo build --features runtime-benchmarks.

When I run: ./target/debug/dip-provider-node-template -h, the benchmark command is not appearing.

Copy link
Member

Choose a reason for hiding this comment

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

Mhh, I might have missed some dependency when the benchmark feature is enabled. I will investigate that

@ntn-x2
Copy link
Member

ntn-x2 commented Dec 4, 2023

I would argue that the template should demonstrate how to benchmark the consumer pallet. In the pallet-dip-consumer pallet, the call is currently excluded based on feature guidance. So maybe adding a feature guided match arm in derive_verification_key_relationship is for the moment a good solution? If it is not important, ignore this comment.

Yes, you are correct. I feel this PR needs some further polishing. The feature in the pallet is for now good enough, since the call never needs to be included in the computed weight. As for the benchmarks, I will probably add a feature flag that returns true if the verifier is being called upon benchmarks. We would have caught this issue if the benchmarking command would actually work for the templates. But since that is not the case, the tests are not run for that. Fixing the benchmarking command first will highlight this issue, which can then be fixed accordingly.

@ntn-x2 ntn-x2 merged commit 5afb750 into aa/dip Dec 6, 2023
5 checks passed
@ntn-x2 ntn-x2 deleted the ag-dip-benchmarks branch December 6, 2023 10:38
ntn-x2 added a commit that referenced this pull request Dec 14, 2023
Feature branch for everything DIP. It will collect other PRs until we
are happy with the features, and will add the DIP to some of our
runtimes and merge this into `develop`.

## WIP Checklist for the open tasks for v1

- [x] Basic structure ->
#489
- [x] Merkleization of DID Documents ->
#492
- [x] `RuntimeCall` verification logic ->
#502
- [x] DID signature verification ->
#516
- [x] Add support for linked accounts and web3name ->
#525
- [x] Configurable origin for `commit_identity` ->
#526
- [x] Proper fee management ->
#528
- [x] Update to Polkadot 0.9.43 ->
c18a6ce
- [x] Replace XCM with state proofs ->
#543
- [x] Add support for relaychain consumer ->
#553 (part of
#543)
- [x] Proper error handling ->
#572
- [x] Add support for versioning ->
#573
- [x] Take deposits for identity commitments ->
#574
- [x] Expose common definitions usable by consumers ->
#577
- [x] Change ensure_signed! to configurable origin also for the
`dispatch_as` function ->
#577
- [x] Proper benchmarking and weights ->
#585
- [x] Comments and docs ->
#584
- [x] Revert Dockerfile changes in
#587
- [x] [OPTIONAL] Add support for Zombienet ->
#587
- [x] [OPTIONAL] Add chain spec loading from file for template runtimes
-> #587
- [x] Big, final review ->
#494 (review)
- [x] Improvements n.1 PR ->
#591
- [x] Improvements n.2 PR ->
#592
- [x] Add to Peregrine runtime ->
#594
- [ ] Deploy on Peregrine
- [ ] Unit tests
- [ ] Add to Spiritnet runtime
- [ ] Deploy on Spiritnet
- [ ] [OPTIONAL] Move DIP-related stuff into its own repo

---------

Co-authored-by: Adel Golghalyani <48685760+Ad96el@users.noreply.github.com>
Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
Co-authored-by: Albrecht <albrecht@kilt.io>
webguru9178 pushed a commit to webguru9178/kilt-node that referenced this pull request Jan 8, 2024
Feature branch for everything DIP. It will collect other PRs until we
are happy with the features, and will add the DIP to some of our
runtimes and merge this into `develop`.

## WIP Checklist for the open tasks for v1

- [x] Basic structure ->
KILTprotocol/kilt-node#489
- [x] Merkleization of DID Documents ->
KILTprotocol/kilt-node#492
- [x] `RuntimeCall` verification logic ->
KILTprotocol/kilt-node#502
- [x] DID signature verification ->
KILTprotocol/kilt-node#516
- [x] Add support for linked accounts and web3name ->
KILTprotocol/kilt-node#525
- [x] Configurable origin for `commit_identity` ->
KILTprotocol/kilt-node#526
- [x] Proper fee management ->
KILTprotocol/kilt-node#528
- [x] Update to Polkadot 0.9.43 ->
KILTprotocol/kilt-node@c18a6ce
- [x] Replace XCM with state proofs ->
KILTprotocol/kilt-node#543
- [x] Add support for relaychain consumer ->
KILTprotocol/kilt-node#553 (part of
KILTprotocol/kilt-node#543)
- [x] Proper error handling ->
KILTprotocol/kilt-node#572
- [x] Add support for versioning ->
KILTprotocol/kilt-node#573
- [x] Take deposits for identity commitments ->
KILTprotocol/kilt-node#574
- [x] Expose common definitions usable by consumers ->
KILTprotocol/kilt-node#577
- [x] Change ensure_signed! to configurable origin also for the
`dispatch_as` function ->
KILTprotocol/kilt-node#577
- [x] Proper benchmarking and weights ->
KILTprotocol/kilt-node#585
- [x] Comments and docs ->
KILTprotocol/kilt-node#584
- [x] Revert Dockerfile changes in
KILTprotocol/kilt-node#587
- [x] [OPTIONAL] Add support for Zombienet ->
KILTprotocol/kilt-node#587
- [x] [OPTIONAL] Add chain spec loading from file for template runtimes
-> KILTprotocol/kilt-node#587
- [x] Big, final review ->
KILTprotocol/kilt-node#494 (review)
- [x] Improvements n.1 PR ->
KILTprotocol/kilt-node#591
- [x] Improvements n.2 PR ->
KILTprotocol/kilt-node#592
- [x] Add to Peregrine runtime ->
KILTprotocol/kilt-node#594
- [ ] Deploy on Peregrine
- [ ] Unit tests
- [ ] Add to Spiritnet runtime
- [ ] Deploy on Spiritnet
- [ ] [OPTIONAL] Move DIP-related stuff into its own repo

---------

Co-authored-by: Adel Golghalyani <48685760+Ad96el@users.noreply.github.com>
Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
Co-authored-by: Albrecht <albrecht@kilt.io>
Ad96el added a commit that referenced this pull request Feb 7, 2024
Feature branch for everything DIP. It will collect other PRs until we
are happy with the features, and will add the DIP to some of our
runtimes and merge this into `develop`.

## WIP Checklist for the open tasks for v1

- [x] Basic structure ->
#489
- [x] Merkleization of DID Documents ->
#492
- [x] `RuntimeCall` verification logic ->
#502
- [x] DID signature verification ->
#516
- [x] Add support for linked accounts and web3name ->
#525
- [x] Configurable origin for `commit_identity` ->
#526
- [x] Proper fee management ->
#528
- [x] Update to Polkadot 0.9.43 ->
c18a6ce
- [x] Replace XCM with state proofs ->
#543
- [x] Add support for relaychain consumer ->
#553 (part of
#543)
- [x] Proper error handling ->
#572
- [x] Add support for versioning ->
#573
- [x] Take deposits for identity commitments ->
#574
- [x] Expose common definitions usable by consumers ->
#577
- [x] Change ensure_signed! to configurable origin also for the
`dispatch_as` function ->
#577
- [x] Proper benchmarking and weights ->
#585
- [x] Comments and docs ->
#584
- [x] Revert Dockerfile changes in
#587
- [x] [OPTIONAL] Add support for Zombienet ->
#587
- [x] [OPTIONAL] Add chain spec loading from file for template runtimes
-> #587
- [x] Big, final review ->
#494 (review)
- [x] Improvements n.1 PR ->
#591
- [x] Improvements n.2 PR ->
#592
- [x] Add to Peregrine runtime ->
#594
- [ ] Deploy on Peregrine
- [ ] Unit tests
- [ ] Add to Spiritnet runtime
- [ ] Deploy on Spiritnet
- [ ] [OPTIONAL] Move DIP-related stuff into its own repo

---------

Co-authored-by: Adel Golghalyani <48685760+Ad96el@users.noreply.github.com>
Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
Co-authored-by: Albrecht <albrecht@kilt.io>
Ad96el added a commit that referenced this pull request Apr 2, 2024
Feature branch for everything DIP. It will collect other PRs until we
are happy with the features, and will add the DIP to some of our
runtimes and merge this into `develop`.

## WIP Checklist for the open tasks for v1

- [x] Basic structure ->
#489
- [x] Merkleization of DID Documents ->
#492
- [x] `RuntimeCall` verification logic ->
#502
- [x] DID signature verification ->
#516
- [x] Add support for linked accounts and web3name ->
#525
- [x] Configurable origin for `commit_identity` ->
#526
- [x] Proper fee management ->
#528
- [x] Update to Polkadot 0.9.43 ->
c18a6ce
- [x] Replace XCM with state proofs ->
#543
- [x] Add support for relaychain consumer ->
#553 (part of
#543)
- [x] Proper error handling ->
#572
- [x] Add support for versioning ->
#573
- [x] Take deposits for identity commitments ->
#574
- [x] Expose common definitions usable by consumers ->
#577
- [x] Change ensure_signed! to configurable origin also for the
`dispatch_as` function ->
#577
- [x] Proper benchmarking and weights ->
#585
- [x] Comments and docs ->
#584
- [x] Revert Dockerfile changes in
#587
- [x] [OPTIONAL] Add support for Zombienet ->
#587
- [x] [OPTIONAL] Add chain spec loading from file for template runtimes
-> #587
- [x] Big, final review ->
#494 (review)
- [x] Improvements n.1 PR ->
#591
- [x] Improvements n.2 PR ->
#592
- [x] Add to Peregrine runtime ->
#594
- [ ] Deploy on Peregrine
- [ ] Unit tests
- [ ] Add to Spiritnet runtime
- [ ] Deploy on Spiritnet
- [ ] [OPTIONAL] Move DIP-related stuff into its own repo

---------

Co-authored-by: Adel Golghalyani <48685760+Ad96el@users.noreply.github.com>
Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
Co-authored-by: Albrecht <albrecht@kilt.io>
Ad96el added a commit that referenced this pull request Aug 21, 2024
Ad96el added a commit that referenced this pull request Aug 29, 2024
Ad96el added a commit that referenced this pull request Aug 30, 2024
Ad96el added a commit that referenced this pull request Aug 30, 2024
ntn-x2 pushed a commit that referenced this pull request Oct 10, 2024
* moved the `deposit_event(Event::AttestationRemoved)` to the
`remove_attestation` so that the event shall never be forgotten to be
deposited.
* restructured Attestation event
  * added authorized_by to revoked and removed, added ctype
* test attestation events
* removed unused `DepositReclaimed` events
* deposit `W3nReleased` event when governance bans an already used w3n

<details>
<summary>Peregrine Diff</summary>

```
!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
[≠] pallet 62: Attestation -> 4 change(s)
  - events changes:
    [≠]  0: AttestationCreated ( : AttesterOf<T>, : ClaimHashOf<T>, : CtypeHashOf<T>, : Option<AuthorizationIdOf<T>>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "attester"))]), Changed(1, [Name(StringChange("", "claim_hash"))]), Changed(2, [Name(StringChange("", "ctype_hash"))]), Changed(3, [Name(StringChange("", "authorization"))])] })]
    [≠]  1: AttestationRevoked ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [≠]  2: AttestationRemoved ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [-] "DepositReclaimed"

[≠] pallet 63: Delegation -> 1 change(s)
  - events changes:
    [-] "DepositReclaimed"

SUMMARY:
- Compatible.......................: true
- Require transaction_version bump.: false

!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
```

</details>

<details>
<summary>Spiritnet Diff</summary>

```
!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
[≠] pallet 62: Attestation -> 4 change(s)
  - events changes:
    [≠]  0: AttestationCreated ( : AttesterOf<T>, : ClaimHashOf<T>, : CtypeHashOf<T>, : Option<AuthorizationIdOf<T>>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "attester"))]), Changed(1, [Name(StringChange("", "claim_hash"))]), Changed(2, [Name(StringChange("", "ctype_hash"))]), Changed(3, [Name(StringChange("", "authorization"))])] })]
    [≠]  1: AttestationRevoked ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [≠]  2: AttestationRemoved ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [-] "DepositReclaimed"

[≠] pallet 63: Delegation -> 1 change(s)
  - events changes:
    [-] "DepositReclaimed"

SUMMARY:
- Compatible.......................: true
- Require transaction_version bump.: false

!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
```

</details>

- [x] I have verified that the code works
- [ ] No panics! (checked arithmetic ops, no indexing `array[3]` use
`get(3)`, ...)
- [x] I have verified that the code is easy to understand
  - [ ] If not, I have left a well-balanced amount of inline comments
- [x] I have [left the code in a better
state](https://deviq.com/principles/boy-scout-rule)
- [x] I have documented the changes (where applicable)
* Either PR or Ticket to update [the
Docs](https://github.com/KILTprotocol/docs)
    * Link the PR/Ticket here
ntn-x2 pushed a commit that referenced this pull request Oct 10, 2024
* moved the `deposit_event(Event::AttestationRemoved)` to the
`remove_attestation` so that the event shall never be forgotten to be
deposited.
* restructured Attestation event
  * added authorized_by to revoked and removed, added ctype
* test attestation events
* removed unused `DepositReclaimed` events
* deposit `W3nReleased` event when governance bans an already used w3n

<details>
<summary>Peregrine Diff</summary>

```
!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
[≠] pallet 62: Attestation -> 4 change(s)
  - events changes:
    [≠]  0: AttestationCreated ( : AttesterOf<T>, : ClaimHashOf<T>, : CtypeHashOf<T>, : Option<AuthorizationIdOf<T>>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "attester"))]), Changed(1, [Name(StringChange("", "claim_hash"))]), Changed(2, [Name(StringChange("", "ctype_hash"))]), Changed(3, [Name(StringChange("", "authorization"))])] })]
    [≠]  1: AttestationRevoked ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [≠]  2: AttestationRemoved ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [-] "DepositReclaimed"

[≠] pallet 63: Delegation -> 1 change(s)
  - events changes:
    [-] "DepositReclaimed"

SUMMARY:
- Compatible.......................: true
- Require transaction_version bump.: false

!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
```

</details>

<details>
<summary>Spiritnet Diff</summary>

```
!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
[≠] pallet 62: Attestation -> 4 change(s)
  - events changes:
    [≠]  0: AttestationCreated ( : AttesterOf<T>, : ClaimHashOf<T>, : CtypeHashOf<T>, : Option<AuthorizationIdOf<T>>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "attester"))]), Changed(1, [Name(StringChange("", "claim_hash"))]), Changed(2, [Name(StringChange("", "ctype_hash"))]), Changed(3, [Name(StringChange("", "authorization"))])] })]
    [≠]  1: AttestationRevoked ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [≠]  2: AttestationRemoved ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [-] "DepositReclaimed"

[≠] pallet 63: Delegation -> 1 change(s)
  - events changes:
    [-] "DepositReclaimed"

SUMMARY:
- Compatible.......................: true
- Require transaction_version bump.: false

!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
```

</details>

- [x] I have verified that the code works
- [ ] No panics! (checked arithmetic ops, no indexing `array[3]` use
`get(3)`, ...)
- [x] I have verified that the code is easy to understand
  - [ ] If not, I have left a well-balanced amount of inline comments
- [x] I have [left the code in a better
state](https://deviq.com/principles/boy-scout-rule)
- [x] I have documented the changes (where applicable)
* Either PR or Ticket to update [the
Docs](https://github.com/KILTprotocol/docs)
    * Link the PR/Ticket here
ntn-x2 pushed a commit that referenced this pull request Oct 10, 2024
* moved the `deposit_event(Event::AttestationRemoved)` to the
`remove_attestation` so that the event shall never be forgotten to be
deposited.
* restructured Attestation event
  * added authorized_by to revoked and removed, added ctype
* test attestation events
* removed unused `DepositReclaimed` events
* deposit `W3nReleased` event when governance bans an already used w3n

<details>
<summary>Peregrine Diff</summary>

```
!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
[≠] pallet 62: Attestation -> 4 change(s)
  - events changes:
    [≠]  0: AttestationCreated ( : AttesterOf<T>, : ClaimHashOf<T>, : CtypeHashOf<T>, : Option<AuthorizationIdOf<T>>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "attester"))]), Changed(1, [Name(StringChange("", "claim_hash"))]), Changed(2, [Name(StringChange("", "ctype_hash"))]), Changed(3, [Name(StringChange("", "authorization"))])] })]
    [≠]  1: AttestationRevoked ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [≠]  2: AttestationRemoved ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [-] "DepositReclaimed"

[≠] pallet 63: Delegation -> 1 change(s)
  - events changes:
    [-] "DepositReclaimed"

SUMMARY:
- Compatible.......................: true
- Require transaction_version bump.: false

!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
```

</details>

<details>
<summary>Spiritnet Diff</summary>

```
!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
[≠] pallet 62: Attestation -> 4 change(s)
  - events changes:
    [≠]  0: AttestationCreated ( : AttesterOf<T>, : ClaimHashOf<T>, : CtypeHashOf<T>, : Option<AuthorizationIdOf<T>>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "attester"))]), Changed(1, [Name(StringChange("", "claim_hash"))]), Changed(2, [Name(StringChange("", "ctype_hash"))]), Changed(3, [Name(StringChange("", "authorization"))])] })]
    [≠]  1: AttestationRevoked ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [≠]  2: AttestationRemoved ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [-] "DepositReclaimed"

[≠] pallet 63: Delegation -> 1 change(s)
  - events changes:
    [-] "DepositReclaimed"

SUMMARY:
- Compatible.......................: true
- Require transaction_version bump.: false

!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
```

</details>

- [x] I have verified that the code works
- [ ] No panics! (checked arithmetic ops, no indexing `array[3]` use
`get(3)`, ...)
- [x] I have verified that the code is easy to understand
  - [ ] If not, I have left a well-balanced amount of inline comments
- [x] I have [left the code in a better
state](https://deviq.com/principles/boy-scout-rule)
- [x] I have documented the changes (where applicable)
* Either PR or Ticket to update [the
Docs](https://github.com/KILTprotocol/docs)
    * Link the PR/Ticket here
ntn-x2 pushed a commit that referenced this pull request Oct 11, 2024
* moved the `deposit_event(Event::AttestationRemoved)` to the
`remove_attestation` so that the event shall never be forgotten to be
deposited.
* restructured Attestation event
  * added authorized_by to revoked and removed, added ctype
* test attestation events
* removed unused `DepositReclaimed` events
* deposit `W3nReleased` event when governance bans an already used w3n

<details>
<summary>Peregrine Diff</summary>

```
!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
[≠] pallet 62: Attestation -> 4 change(s)
  - events changes:
    [≠]  0: AttestationCreated ( : AttesterOf<T>, : ClaimHashOf<T>, : CtypeHashOf<T>, : Option<AuthorizationIdOf<T>>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "attester"))]), Changed(1, [Name(StringChange("", "claim_hash"))]), Changed(2, [Name(StringChange("", "ctype_hash"))]), Changed(3, [Name(StringChange("", "authorization"))])] })]
    [≠]  1: AttestationRevoked ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [≠]  2: AttestationRemoved ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [-] "DepositReclaimed"

[≠] pallet 63: Delegation -> 1 change(s)
  - events changes:
    [-] "DepositReclaimed"

SUMMARY:
- Compatible.......................: true
- Require transaction_version bump.: false

!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
```

</details>

<details>
<summary>Spiritnet Diff</summary>

```
!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
[≠] pallet 62: Attestation -> 4 change(s)
  - events changes:
    [≠]  0: AttestationCreated ( : AttesterOf<T>, : ClaimHashOf<T>, : CtypeHashOf<T>, : Option<AuthorizationIdOf<T>>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "attester"))]), Changed(1, [Name(StringChange("", "claim_hash"))]), Changed(2, [Name(StringChange("", "ctype_hash"))]), Changed(3, [Name(StringChange("", "authorization"))])] })]
    [≠]  1: AttestationRevoked ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [≠]  2: AttestationRemoved ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [-] "DepositReclaimed"

[≠] pallet 63: Delegation -> 1 change(s)
  - events changes:
    [-] "DepositReclaimed"

SUMMARY:
- Compatible.......................: true
- Require transaction_version bump.: false

!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
```

</details>

- [x] I have verified that the code works
- [ ] No panics! (checked arithmetic ops, no indexing `array[3]` use
`get(3)`, ...)
- [x] I have verified that the code is easy to understand
  - [ ] If not, I have left a well-balanced amount of inline comments
- [x] I have [left the code in a better
state](https://deviq.com/principles/boy-scout-rule)
- [x] I have documented the changes (where applicable)
* Either PR or Ticket to update [the
Docs](https://github.com/KILTprotocol/docs)
    * Link the PR/Ticket here
ntn-x2 pushed a commit that referenced this pull request Oct 11, 2024
* moved the `deposit_event(Event::AttestationRemoved)` to the
`remove_attestation` so that the event shall never be forgotten to be
deposited.
* restructured Attestation event
  * added authorized_by to revoked and removed, added ctype
* test attestation events
* removed unused `DepositReclaimed` events
* deposit `W3nReleased` event when governance bans an already used w3n

<details>
<summary>Peregrine Diff</summary>

```
!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
[≠] pallet 62: Attestation -> 4 change(s)
  - events changes:
    [≠]  0: AttestationCreated ( : AttesterOf<T>, : ClaimHashOf<T>, : CtypeHashOf<T>, : Option<AuthorizationIdOf<T>>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "attester"))]), Changed(1, [Name(StringChange("", "claim_hash"))]), Changed(2, [Name(StringChange("", "ctype_hash"))]), Changed(3, [Name(StringChange("", "authorization"))])] })]
    [≠]  1: AttestationRevoked ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [≠]  2: AttestationRemoved ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [-] "DepositReclaimed"

[≠] pallet 63: Delegation -> 1 change(s)
  - events changes:
    [-] "DepositReclaimed"

SUMMARY:
- Compatible.......................: true
- Require transaction_version bump.: false

!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
```

</details>

<details>
<summary>Spiritnet Diff</summary>

```
!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
[≠] pallet 62: Attestation -> 4 change(s)
  - events changes:
    [≠]  0: AttestationCreated ( : AttesterOf<T>, : ClaimHashOf<T>, : CtypeHashOf<T>, : Option<AuthorizationIdOf<T>>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "attester"))]), Changed(1, [Name(StringChange("", "claim_hash"))]), Changed(2, [Name(StringChange("", "ctype_hash"))]), Changed(3, [Name(StringChange("", "authorization"))])] })]
    [≠]  1: AttestationRevoked ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [≠]  2: AttestationRemoved ( : AttesterOf<T>, : ClaimHashOf<T>, )  )
        [Signature(SignatureChange { args: [Changed(0, [Name(StringChange("", "authorized_by")), Ty(StringChange("AttesterOf<T>", "AuthorizedByOf<T>"))]), Changed(1, [Name(StringChange("", "attester")), Ty(StringChange("ClaimHashOf<T>", "AttesterOf<T>"))]), Added(2, ArgDesc { name: "claim_hash", ty: "ClaimHashOf<T>" })] })]
    [-] "DepositReclaimed"

[≠] pallet 63: Delegation -> 1 change(s)
  - events changes:
    [-] "DepositReclaimed"

SUMMARY:
- Compatible.......................: true
- Require transaction_version bump.: false

!!! THE SUBWASM REDUCED DIFFER IS EXPERIMENTAL, DOUBLE CHECK THE RESULTS !!!
```

</details>

- [x] I have verified that the code works
- [ ] No panics! (checked arithmetic ops, no indexing `array[3]` use
`get(3)`, ...)
- [x] I have verified that the code is easy to understand
  - [ ] If not, I have left a well-balanced amount of inline comments
- [x] I have [left the code in a better
state](https://deviq.com/principles/boy-scout-rule)
- [x] I have documented the changes (where applicable)
* Either PR or Ticket to update [the
Docs](https://github.com/KILTprotocol/docs)
    * Link the PR/Ticket here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants