Resolve "Benchmark scenario coverage gaps and one incorrect benchmark call (quota::do_refund)"

Closes #346 (closed)

Goal of the changes

Close benchmark scenario coverage gaps by setting up worst-case or near-limit storage states before benchmarked calls, so measured weights better reflect heavy execution paths.

What reviewers need to know

  • pallets/authority-members/src/benchmarking.rs

    • Added helper to build dense sorted member ID vectors excluding a target.
    • go_offline, go_online, remove_member, and remove_member_from_blacklist now prefill OnlineAuthorities, IncomingAuthorities, OutgoingAuthorities, and Blacklist with dense near-limit data to exercise heavier insert/remove paths.
    • Benchmark test ext seed changed from new_test_ext(2) to new_test_ext(4).
  • pallets/identity/src/benchmarking.rs

    • Fixed an off-by-one setup loop from 1..i to 1..=i so generated names count matches benchmark component i.
  • pallets/quota/src/benchmarking.rs

    • Updated do_refund benchmark to call do_refund(refund, 10u64.into()) instead of try_refund(refund), matching the intended worst branch (withdraw succeeds, destination account resolution fails).
  • pallets/smith-members/src/benchmarking.rs

    • Added helper to prefill issued certs near MaxByIssuer.
    • certify_smith now benchmarks near-bound insertion/sort conditions.
    • on_removed_wot_member now builds dense issuer/receiver relationships so cleanup loops and cert pruning run under heavier conditions.
  • Scope/risk

    • Changes are isolated to benchmark setup code; no runtime logic, APIs, storage formats, or operator-facing configuration were changed.
Edited by Éloïs

Merge request reports

Loading