Repository navigation
v1.2.0
Runtimes can now bind their own verification weights, from their own run of these crates'
benchmarks, the way they do for any FRAME pallet. The weights shipped with the crates are unchanged.
This is a runtime-configuration change, not a client-visible one: device, registration and
credential encodings, and metadata, are unchanged. Runtimes need a one-line change to their
authenticator types when they upgrade.
Changed
- Each crate's
WeightInfois a trait again,pub trait WeightInfo, with one function per
benchmark, like a FRAME pallet's:verify_attestation(c, a)andverify_credential(c, a)for
WebAuthn,verify_{attestation,credential}_{sr25519,ed25519,ecdsa,eth}()for Substrate keys. The
weights measured here moved toSubstrateWeight<T: frame_system::Config>, which implements it,
and so does(), with the same numbers (as in FRAME pallets). A runtime's ownweights.rsfor
these benchmarks (impl<T: frame_system::Config> pass_webauthn::WeightInfo for WeightInfo<T>)
now compiles against it. .maintain/frame-weight-template.hbsgenerates that shape (the trait,SubstrateWeight<T>and
()), like the Polkadot SDK's pallet template, and the committedweights.rsfiles were
converted to it without changing any number.
Added
Weights<W>, in both crates: implementsfc_traits_authn::AuthenticatorWeightInfofor any
W: WeightInfo, with the same mapping ofverify_device/verify_useronto the benchmarks as
1.1.0(WebAuthn clampscandato the benchmarked range; Substrate keys charge the
costliest key type).DefaultWeights<T>isWeights<SubstrateWeight<T>>.
Migrating from 1.1.0
The authenticator's last type parameter changes from WeightInfo<Runtime> to:
pass_webauthn::DefaultWeights<Runtime>/pass_substrate_keys::DefaultWeights<Runtime>, to
keep the weights measured by these crates (what1.1.0charged); orpass_webauthn::Weights<crate::weights::pass_webauthn::WeightInfo<Runtime>>(and likewise for
pass_substrate_keys), to charge the runtime's own run of the benchmarks.