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

fix: weight for DID deletion hook #851

Merged
merged 5 commits into from
Jan 17, 2025
Merged

Conversation

ntn-x2
Copy link
Member

@ntn-x2 ntn-x2 commented Jan 16, 2025

Fixes https://github.com/KILTprotocol/ticket/issues/3752.

I realized I over-complicated the previous solution. We never ever have considered the total size of a storage map in our benchmarks, so I don't see why we would need to start now.

In our case, the deletion hook has the worst case if it returns true, which is the default behaviour, hence we don't need any special setup logic for the benchmarks. If needed in the future, that is easy to add behind a feature = "runtime-benchmarks" cfg instruction.

This solution simplifies weight computation by a lot, since the additional weight will be considered when running the benchmarks already, and does not need any specialised benchmarking logic.

@ntn-x2 ntn-x2 force-pushed the aa/alternative-to-benchmarking branch from b414174 to 7ea029d Compare January 16, 2025 15:03
@ntn-x2 ntn-x2 requested a review from Ad96el January 16, 2025 15:03
@ntn-x2 ntn-x2 marked this pull request as ready for review January 16, 2025 15:03
@ntn-x2 ntn-x2 assigned Ad96el and unassigned Ad96el Jan 17, 2025
Copy link
Member

@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.

:neckbeard:

@ntn-x2 ntn-x2 merged commit 0da4386 into develop Jan 17, 2025
14 of 15 checks passed
@ntn-x2 ntn-x2 deleted the aa/alternative-to-benchmarking branch January 17, 2025 09:18
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