Skip to content

feat: did lookup#299

Merged
weichweich merged 42 commits intodevelopfrom
aw-did-lookup
Nov 26, 2021
Merged

feat: did lookup#299
weichweich merged 42 commits intodevelopfrom
aw-did-lookup

Conversation

@weichweich
Copy link
Copy Markdown
Contributor

@weichweich weichweich commented Nov 16, 2021

fixes KILTprotocol/ticket/issues/1698

  • rename DidAccount -> DidIdentifier

Checklist:

  • I have verified that the code works
    • No panics! (checked arithmetic ops, no indexing array[3] use get(3), ...)
  • I have verified that the code is easy to understand
    • If not, I have left a well-balanced amount of inline comments
  • This PR does not introduce new custom types
  • I have left the code in a better state
  • I have documented the changes (where applicable)

Copy link
Copy Markdown
Contributor

@ntn-x2 ntn-x2 left a comment

Choose a reason for hiding this comment

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

😇

Comment thread pallets/did-lookup/src/lib.rs Outdated
Comment thread pallets/did-lookup/src/lib.rs Outdated
@weichweich
Copy link
Copy Markdown
Contributor Author

/bench runtime pallet pallet-did-lookup

@kilt-command-bot
Copy link
Copy Markdown

kilt-command-bot Bot commented Nov 18, 2021

Benchmark Runtime Pallet for branch "aw-did-lookup" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet-did-lookup --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=pallets/pallet-did-lookup/src/default_weights.rs --template=.maintain/weight-template.hbs

Results
Error: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })

ERROR: Unable to commit file pallets/pallet-did-lookup/src/default_weights.rs

weichweich and others added 2 commits November 18, 2021 17:50
Co-authored-by: Antonio <antonio@kilt.io>
@weichweich
Copy link
Copy Markdown
Contributor Author

/bench runtime pallet did-lookup

@kilt-command-bot
Copy link
Copy Markdown

kilt-command-bot Bot commented Nov 19, 2021

Benchmark Runtime Pallet for branch "aw-did-lookup" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=did-lookup --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=pallets/did-lookup/src/default_weights.rs --template=.maintain/weight-template.hbs

Results
Error: Input("No benchmarks found which match your input.")

ERROR: Unable to commit file pallets/did-lookup/src/default_weights.rs

@weichweich
Copy link
Copy Markdown
Contributor Author

/bench runtime pallet pallet-did-lookup

@kilt-command-bot
Copy link
Copy Markdown

kilt-command-bot Bot commented Nov 19, 2021

Benchmark Runtime Pallet for branch "aw-did-lookup" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet-did-lookup --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=pallets/pallet-did-lookup/src/default_weights.rs --template=.maintain/weight-template.hbs

Results
error: failed to load manifest for workspace member `/home/benchbot/bench-bot/git/mashnet-node/nodes/parachain`

Caused by:
  failed to load manifest for dependency `peregrine-runtime`

Caused by:
  failed to load manifest for dependency `pallet-did-lookup`

Caused by:
  failed to read `/home/benchbot/bench-bot/git/mashnet-node/pallets/did-lookup/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

ERROR: Unable to commit file pallets/pallet-did-lookup/src/default_weights.rs

@weichweich
Copy link
Copy Markdown
Contributor Author

/bench runtime pallet pallet-did-lookup

@kilt-command-bot
Copy link
Copy Markdown

kilt-command-bot Bot commented Nov 19, 2021

Benchmark Runtime Pallet for branch "aw-did-lookup" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet-did-lookup --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=pallets/pallet-did-lookup/src/default_weights.rs --template=.maintain/weight-template.hbs

Results
Pallet: "pallet_did_lookup", Extrinsic: "associate_account", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    74.37
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    74.37
              µs

Reads = 1
Writes = 1

Pallet: "pallet_did_lookup", Extrinsic: "associate_sender", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    17.57
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    17.57
              µs

Reads = 1
Writes = 1

Pallet: "pallet_did_lookup", Extrinsic: "remove_sender_association", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    18.99
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    18.99
              µs

Reads = 1
Writes = 1

Pallet: "pallet_did_lookup", Extrinsic: "remove_account_association", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    22.41
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    22.41
              µs

Reads = 1
Writes = 1


…hmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet-did-lookup --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=pallets/pallet-did-lookup/src/default_weights.rs --template=.maintain/weight-template.hbs
@weichweich
Copy link
Copy Markdown
Contributor Author

/bench runtime spiritnet-runtime pallet-did-lookup

@kilt-command-bot
Copy link
Copy Markdown

kilt-command-bot Bot commented Nov 19, 2021

Benchmark Runtime Pallet for branch "aw-did-lookup" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=pallet-did-lookup --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/pallet_did-lookup.rs --template=.maintain/runtime-weight-template.hbs

Results
Pallet: "pallet_did_lookup", Extrinsic: "associate_account", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    75.15
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    75.15
              µs

Reads = 1
Writes = 1

Pallet: "pallet_did_lookup", Extrinsic: "associate_sender", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=       18
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=       18
              µs

Reads = 1
Writes = 1

Pallet: "pallet_did_lookup", Extrinsic: "remove_sender_association", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    18.92
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    18.92
              µs

Reads = 1
Writes = 1

Pallet: "pallet_did_lookup", Extrinsic: "remove_account_association", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    22.14
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    22.14
              µs

Reads = 1
Writes = 1


…hmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=pallet-did-lookup --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/pallet_did-lookup.rs --template=.maintain/runtime-weight-template.hbs
@weichweich
Copy link
Copy Markdown
Contributor Author

/bench runtime peregrine pallet-did-lookup

@kilt-command-bot
Copy link
Copy Markdown

kilt-command-bot Bot commented Nov 19, 2021

Benchmark Runtime Substrate Pallet for branch "aw-did-lookup" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet-did-lookup --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/peregrine/src/weights/pallet_did-lookup.rs --template=.maintain/runtime-weight-template.hbs

Results
Pallet: "pallet_did_lookup", Extrinsic: "associate_account", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    74.81
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    74.81
              µs

Reads = 1
Writes = 1

Pallet: "pallet_did_lookup", Extrinsic: "associate_sender", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    17.76
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    17.76
              µs

Reads = 1
Writes = 1

Pallet: "pallet_did_lookup", Extrinsic: "remove_sender_association", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    19.12
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    19.12
              µs

Reads = 1
Writes = 1

Pallet: "pallet_did_lookup", Extrinsic: "remove_account_association", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    22.32
              µs

Reads = 1
Writes = 1

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    22.32
              µs

Reads = 1
Writes = 1


kiltbot and others added 4 commits November 19, 2021 12:59
…hmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet-did-lookup --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/peregrine/src/weights/pallet_did-lookup.rs --template=.maintain/runtime-weight-template.hbs
@weichweich weichweich requested a review from ntn-x2 November 23, 2021 09:29
Copy link
Copy Markdown
Contributor

@ntn-x2 ntn-x2 left a comment

Choose a reason for hiding this comment

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

Some stuff is minor, there are also some discussion points especially regarding the validity of the signature in the associate_account function.

Comment thread pallets/did/src/origin.rs
Comment thread support/src/traits.rs
Comment thread pallets/pallet-did-lookup/Cargo.toml Outdated
Comment thread runtimes/standalone/src/lib.rs Outdated
Comment thread runtimes/standalone/src/lib.rs
Comment thread pallets/pallet-did-lookup/src/lib.rs
Comment thread pallets/pallet-did-lookup/src/lib.rs Outdated
Comment thread pallets/pallet-did-lookup/src/lib.rs Outdated
Comment thread pallets/pallet-did-lookup/src/lib.rs
Comment thread pallets/pallet-did-lookup/src/lib.rs
@weichweich
Copy link
Copy Markdown
Contributor Author

/bench runtime spiritnet-runtime pallet_did_lookup

@kilt-command-bot
Copy link
Copy Markdown

kilt-command-bot Bot commented Nov 25, 2021

Benchmark Runtime Pallet for branch "aw-did-lookup" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=pallet_did_lookup --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/pallet_did_lookup.rs --template=.maintain/runtime-weight-template.hbs

Results
error: failed to select a version for `pallet-did-lookup`.
    ... required by package `peregrine-runtime v1.2.0 (/home/benchbot/bench-bot/git/mashnet-node/runtimes/peregrine)`
    ... which is depended on by `kilt-parachain v1.2.0 (/home/benchbot/bench-bot/git/mashnet-node/nodes/parachain)`
versions that meet the requirements `=1.2.0` are: 1.2.0

the package `peregrine-runtime` depends on `pallet-did-lookup`, with features: `pallet-balances` but `pallet-did-lookup` does not have these features.


failed to select a version for `pallet-did-lookup` which could resolve this conflict

ERROR: Unable to commit file ./runtimes/spiritnet/src/weights/pallet_did_lookup.rs

@weichweich
Copy link
Copy Markdown
Contributor Author

/bench runtime peregrine pallet_did_lookup

@kilt-command-bot
Copy link
Copy Markdown

kilt-command-bot Bot commented Nov 25, 2021

Benchmark Runtime Substrate Pallet for branch "aw-did-lookup" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_did_lookup --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/peregrine/src/weights/pallet_did_lookup.rs --template=.maintain/runtime-weight-template.hbs

Results
error: failed to select a version for `pallet-did-lookup`.
    ... required by package `peregrine-runtime v1.2.0 (/home/benchbot/bench-bot/git/mashnet-node/runtimes/peregrine)`
    ... which is depended on by `kilt-parachain v1.2.0 (/home/benchbot/bench-bot/git/mashnet-node/nodes/parachain)`
versions that meet the requirements `=1.2.0` are: 1.2.0

the package `peregrine-runtime` depends on `pallet-did-lookup`, with features: `pallet-balances` but `pallet-did-lookup` does not have these features.


failed to select a version for `pallet-did-lookup` which could resolve this conflict

ERROR: Unable to commit file ./runtimes/peregrine/src/weights/pallet_did_lookup.rs

@weichweich
Copy link
Copy Markdown
Contributor Author

/bench runtime spiritnet-runtime pallet_did_lookup

@kilt-command-bot
Copy link
Copy Markdown

kilt-command-bot Bot commented Nov 25, 2021

Benchmark Runtime Pallet for branch "aw-did-lookup" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=pallet_did_lookup --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/pallet_did_lookup.rs --template=.maintain/runtime-weight-template.hbs

Results
Pallet: "pallet_did_lookup", Extrinsic: "associate_account", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    100.1
              µs

Reads = 2
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    100.1
              µs

Reads = 2
Writes = 2

Pallet: "pallet_did_lookup", Extrinsic: "associate_sender", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    41.38
              µs

Reads = 2
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    41.38
              µs

Reads = 2
Writes = 2

Pallet: "pallet_did_lookup", Extrinsic: "remove_sender_association", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    38.91
              µs

Reads = 2
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    38.91
              µs

Reads = 2
Writes = 2

Pallet: "pallet_did_lookup", Extrinsic: "remove_account_association", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    42.38
              µs

Reads = 2
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    42.38
              µs

Reads = 2
Writes = 2


@weichweich
Copy link
Copy Markdown
Contributor Author

/bench runtime peregrine pallet_did_lookup

…hmarks -- benchmark --chain=spiritnet-dev --steps=50 --repeat=20 --pallet=pallet_did_lookup --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/spiritnet/src/weights/pallet_did_lookup.rs --template=.maintain/runtime-weight-template.hbs
@kilt-command-bot
Copy link
Copy Markdown

kilt-command-bot Bot commented Nov 25, 2021

Benchmark Runtime Substrate Pallet for branch "aw-did-lookup" with command cargo run --quiet --release -p kilt-parachain --features=runtime-benchmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_did_lookup --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/peregrine/src/weights/pallet_did_lookup.rs --template=.maintain/runtime-weight-template.hbs

Results
Pallet: "pallet_did_lookup", Extrinsic: "associate_account", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    100.7
              µs

Reads = 2
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    100.7
              µs

Reads = 2
Writes = 2

Pallet: "pallet_did_lookup", Extrinsic: "associate_sender", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: System Account (r:1 w:1)
Storage: DidLookup ConnectedDids (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    41.26
              µs

Reads = 2
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    41.26
              µs

Reads = 2
Writes = 2

Pallet: "pallet_did_lookup", Extrinsic: "remove_sender_association", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    39.03
              µs

Reads = 2
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    39.03
              µs

Reads = 2
Writes = 2

Pallet: "pallet_did_lookup", Extrinsic: "remove_account_association", Lowest values: [], Highest values: [], Steps: 50, Repeat: 20
Raw Storage Info
========
Storage: DidLookup ConnectedDids (r:1 w:1)
Storage: System Account (r:1 w:1)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    42.01
              µs

Reads = 2
Writes = 2

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    42.01
              µs

Reads = 2
Writes = 2


…hmarks -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_did_lookup --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtimes/peregrine/src/weights/pallet_did_lookup.rs --template=.maintain/runtime-weight-template.hbs
@weichweich weichweich requested a review from ntn-x2 November 25, 2021 11:05
@weichweich weichweich self-assigned this Nov 25, 2021
Copy link
Copy Markdown
Contributor

@ntn-x2 ntn-x2 left a comment

Choose a reason for hiding this comment

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

LGMT! 👏 Maybe we can clean up the origin type from all the pallets and the runtimes, as mentioned in the only outstanding comment, since this PR introduces the GenerateBenchmarkOrigin trait. Other than that, this could be merged!

@weichweich
Copy link
Copy Markdown
Contributor Author

Maybe we can clean up the origin type from all the pallets and the runtimes

I would like to do that in a new PR since this would touch all the other pallets.

@weichweich weichweich merged commit e61b091 into develop Nov 26, 2021
@weichweich weichweich deleted the aw-did-lookup branch November 26, 2021 07:51
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.

2 participants