Calculate and refund weight for identity pallet (#5680)
* add old_registrar_count as param to estimate weight * cast count to Weight Co-Authored-By:Shawn Tabrizi <shawntabrizi@gmail.com> * add weight calculation for set_identity * remove superfluous weight comment * add detailed weight estimation for set_subs * adjust benchmarking code to the new API * add second parameter to set_subs benchmark * rename o to p * calculate weight based on benchmarks * use try_mutate for registrars * fix weight number typo * update weights for set_subs + add weights for clear_identity and request_judgement * improve naming and docs * add weight calculation for cancel_request * fix benchmark * fix tests * fix arithmetic overflow in balances triggered by tests * add weight calcluations for more dispatchables * add weight calculation for provide_judgement * mark param as unused * add MaxRegistrars associated type used for weight estimation * check that MaxRegistrars is not exceeded * add remaining weight calculations * use weight refunds to use more constants in weight estimation * adjust usage of clear_identity * refund request_judgement weights and remove param * refund weights for cancel_request and remove param * add remaining refunds and remove params * refund weight for set_subs and remove param * make comment more specific * add range note to benchmarking docs * fix inconsistencies before review * fix actual weight calculation for add_registrar * remove duplicate balance ops weights + refund on all dispatchables Co-authored-by:
Shawn Tabrizi <shawntabrizi@gmail.com>
Showing
- substrate/bin/node/runtime/src/lib.rs 2 additions, 0 deletionssubstrate/bin/node/runtime/src/lib.rs
- substrate/frame/balances/src/lib.rs 1 addition, 1 deletionsubstrate/frame/balances/src/lib.rs
- substrate/frame/benchmarking/src/lib.rs 4 additions, 0 deletionssubstrate/frame/benchmarking/src/lib.rs
- substrate/frame/identity/src/benchmarking.rs 27 additions, 22 deletionssubstrate/frame/identity/src/benchmarking.rs
- substrate/frame/identity/src/lib.rs 307 additions, 55 deletionssubstrate/frame/identity/src/lib.rs
Please register or sign in to comment