sp_staking/lib.rs
1// This file is part of Substrate.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: Apache-2.0
5
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17
18#![cfg_attr(not(feature = "std"), no_std)]
19
20//! A crate which contains primitives that are useful for implementation that uses staking
21//! approaches in general. Definitions related to sessions, slashing, etc go here.
22
23extern crate alloc;
24
25use crate::currency_to_vote::CurrencyToVote;
26use alloc::{collections::btree_map::BTreeMap, vec, vec::Vec};
27use codec::{Decode, Encode, FullCodec, HasCompact, MaxEncodedLen};
28use core::ops::Sub;
29use scale_info::TypeInfo;
30use sp_runtime::{
31 traits::{AtLeast32BitUnsigned, Zero},
32 DispatchError, DispatchResult, Perbill, RuntimeDebug, Saturating,
33};
34
35pub mod offence;
36
37pub mod currency_to_vote;
38
39/// Simple index type with which we can count sessions.
40pub type SessionIndex = u32;
41
42/// Counter for the number of eras that have passed.
43pub type EraIndex = u32;
44
45/// Type for identifying a page.
46pub type Page = u32;
47/// Representation of a staking account, which may be a stash or controller account.
48///
49/// Note: once the controller is completely deprecated, this enum can also be deprecated in favor of
50/// the stash account. Tracking issue: <https://github.com/paritytech/substrate/issues/6927>.
51#[derive(Clone, Debug)]
52pub enum StakingAccount<AccountId> {
53 Stash(AccountId),
54 Controller(AccountId),
55}
56
57#[cfg(feature = "std")]
58impl<AccountId> From<AccountId> for StakingAccount<AccountId> {
59 fn from(account: AccountId) -> Self {
60 StakingAccount::Stash(account)
61 }
62}
63
64/// Representation of the status of a staker.
65#[derive(RuntimeDebug, TypeInfo)]
66#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone))]
67pub enum StakerStatus<AccountId> {
68 /// Chilling.
69 Idle,
70 /// Declaring desire in validate, i.e author blocks.
71 Validator,
72 /// Declaring desire to nominate, delegate, or generally approve of the given set of others.
73 Nominator(Vec<AccountId>),
74}
75
76/// A struct that reflects stake that an account has in the staking system. Provides a set of
77/// methods to operate on it's properties. Aimed at making `StakingInterface` more concise.
78#[derive(RuntimeDebug, Clone, Copy, Eq, PartialEq, Default)]
79pub struct Stake<Balance> {
80 /// The total stake that `stash` has in the staking system. This includes the
81 /// `active` stake, and any funds currently in the process of unbonding via
82 /// [`StakingInterface::unbond`].
83 ///
84 /// # Note
85 ///
86 /// This is only guaranteed to reflect the amount locked by the staking system. If there are
87 /// non-staking locks on the bonded pair's balance this amount is going to be larger in
88 /// reality.
89 pub total: Balance,
90 /// The total amount of the stash's balance that will be at stake in any forthcoming
91 /// rounds.
92 pub active: Balance,
93}
94
95/// A generic staking event listener.
96///
97/// Note that the interface is designed in a way that the events are fired post-action, so any
98/// pre-action data that is needed needs to be passed to interface methods. The rest of the data can
99/// be retrieved by using `StakingInterface`.
100#[impl_trait_for_tuples::impl_for_tuples(10)]
101pub trait OnStakingUpdate<AccountId, Balance> {
102 /// Fired when the stake amount of someone updates.
103 ///
104 /// This is effectively any changes to the bond amount, such as bonding more funds, and
105 /// unbonding.
106 fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>) {}
107
108 /// Fired when someone sets their intention to nominate.
109 ///
110 /// This should never be fired for existing nominators.
111 fn on_nominator_add(_who: &AccountId) {}
112
113 /// Fired when an existing nominator updates their nominations.
114 ///
115 /// Note that this is not fired when a nominator changes their stake. For that,
116 /// `on_stake_update` should be used, followed by querying whether `who` was a validator or a
117 /// nominator.
118 fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>) {}
119
120 /// Fired when someone removes their intention to nominate, either due to chill or validating.
121 ///
122 /// The set of nominations at the time of removal is provided as it can no longer be fetched in
123 /// any way.
124 fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>) {}
125
126 /// Fired when someone sets their intention to validate.
127 ///
128 /// Note validator preference changes are not communicated, but could be added if needed.
129 fn on_validator_add(_who: &AccountId) {}
130
131 /// Fired when an existing validator updates their preferences.
132 ///
133 /// Note validator preference changes are not communicated, but could be added if needed.
134 fn on_validator_update(_who: &AccountId) {}
135
136 /// Fired when someone removes their intention to validate, either due to chill or nominating.
137 fn on_validator_remove(_who: &AccountId) {}
138
139 /// Fired when someone is fully unstaked.
140 fn on_unstake(_who: &AccountId) {}
141
142 /// Fired when a staker is slashed.
143 ///
144 /// * `stash` - The stash of the staker whom the slash was applied to.
145 /// * `slashed_active` - The new bonded balance of the staker after the slash was applied.
146 /// * `slashed_unlocking` - A map of slashed eras, and the balance of that unlocking chunk after
147 /// the slash is applied. Any era not present in the map is not affected at all.
148 /// * `slashed_total` - The aggregated balance that was lost due to the slash.
149 fn on_slash(
150 _stash: &AccountId,
151 _slashed_active: Balance,
152 _slashed_unlocking: &BTreeMap<EraIndex, Balance>,
153 _slashed_total: Balance,
154 ) {
155 }
156
157 /// Fired when a portion of a staker's balance has been withdrawn.
158 fn on_withdraw(_stash: &AccountId, _amount: Balance) {}
159}
160
161/// A generic representation of a staking implementation.
162///
163/// This interface uses the terminology of NPoS, but it is aims to be generic enough to cover other
164/// implementations as well.
165pub trait StakingInterface {
166 /// Balance type used by the staking system.
167 type Balance: Sub<Output = Self::Balance>
168 + Ord
169 + PartialEq
170 + Default
171 + Copy
172 + MaxEncodedLen
173 + FullCodec
174 + TypeInfo
175 + Saturating;
176
177 /// AccountId type used by the staking system.
178 type AccountId: Clone + core::fmt::Debug;
179
180 /// Means of converting Currency to VoteWeight.
181 type CurrencyToVote: CurrencyToVote<Self::Balance>;
182
183 /// The minimum amount required to bond in order to set nomination intentions. This does not
184 /// necessarily mean the nomination will be counted in an election, but instead just enough to
185 /// be stored as a nominator. In other words, this is the minimum amount to register the
186 /// intention to nominate.
187 fn minimum_nominator_bond() -> Self::Balance;
188
189 /// The minimum amount required to bond in order to set validation intentions.
190 fn minimum_validator_bond() -> Self::Balance;
191
192 /// Return a stash account that is controlled by a `controller`.
193 ///
194 /// ## Note
195 ///
196 /// The controller abstraction is not permanent and might go away. Avoid using this as much as
197 /// possible.
198 fn stash_by_ctrl(controller: &Self::AccountId) -> Result<Self::AccountId, DispatchError>;
199
200 /// Number of eras that staked funds must remain bonded for.
201 fn bonding_duration() -> EraIndex;
202
203 /// The current era index.
204 ///
205 /// This should be the latest planned era that the staking system knows about.
206 fn current_era() -> EraIndex;
207
208 /// Returns the [`Stake`] of `who`.
209 fn stake(who: &Self::AccountId) -> Result<Stake<Self::Balance>, DispatchError>;
210
211 /// Total stake of a staker, `Err` if not a staker.
212 fn total_stake(who: &Self::AccountId) -> Result<Self::Balance, DispatchError> {
213 Self::stake(who).map(|s| s.total)
214 }
215
216 /// Total active portion of a staker's [`Stake`], `Err` if not a staker.
217 fn active_stake(who: &Self::AccountId) -> Result<Self::Balance, DispatchError> {
218 Self::stake(who).map(|s| s.active)
219 }
220
221 /// Returns whether a staker is unbonding, `Err` if not a staker at all.
222 fn is_unbonding(who: &Self::AccountId) -> Result<bool, DispatchError> {
223 Self::stake(who).map(|s| s.active != s.total)
224 }
225
226 /// Returns whether a staker is FULLY unbonding, `Err` if not a staker at all.
227 fn fully_unbond(who: &Self::AccountId) -> DispatchResult {
228 Self::unbond(who, Self::stake(who)?.active)
229 }
230
231 /// Bond (lock) `value` of `who`'s balance, while forwarding any rewards to `payee`.
232 fn bond(who: &Self::AccountId, value: Self::Balance, payee: &Self::AccountId)
233 -> DispatchResult;
234
235 /// Have `who` nominate `validators`.
236 fn nominate(who: &Self::AccountId, validators: Vec<Self::AccountId>) -> DispatchResult;
237
238 /// Chill `who`.
239 fn chill(who: &Self::AccountId) -> DispatchResult;
240
241 /// Bond some extra amount in `who`'s free balance against the active bonded balance of
242 /// the account. The amount extra actually bonded will never be more than `who`'s free
243 /// balance.
244 fn bond_extra(who: &Self::AccountId, extra: Self::Balance) -> DispatchResult;
245
246 /// Schedule a portion of the active bonded balance to be unlocked at era
247 /// [Self::current_era] + [`Self::bonding_duration`].
248 ///
249 /// Once the unlock era has been reached, [`Self::withdraw_unbonded`] can be called to unlock
250 /// the funds.
251 ///
252 /// The amount of times this can be successfully called is limited based on how many distinct
253 /// eras funds are schedule to unlock in. Calling [`Self::withdraw_unbonded`] after some unlock
254 /// schedules have reached their unlocking era should allow more calls to this function.
255 fn unbond(stash: &Self::AccountId, value: Self::Balance) -> DispatchResult;
256
257 /// Set the reward destination for the ledger associated with the stash.
258 fn set_payee(stash: &Self::AccountId, reward_acc: &Self::AccountId) -> DispatchResult;
259
260 /// Unlock any funds schedule to unlock before or at the current era.
261 ///
262 /// Returns whether the stash was killed because of this withdraw or not.
263 fn withdraw_unbonded(
264 stash: Self::AccountId,
265 num_slashing_spans: u32,
266 ) -> Result<bool, DispatchError>;
267
268 /// The ideal number of active validators.
269 fn desired_validator_count() -> u32;
270
271 /// Whether or not there is an ongoing election.
272 fn election_ongoing() -> bool;
273
274 /// Force a current staker to become completely unstaked, immediately.
275 fn force_unstake(who: Self::AccountId) -> DispatchResult;
276
277 /// Checks whether an account `staker` has been exposed in an era.
278 fn is_exposed_in_era(who: &Self::AccountId, era: &EraIndex) -> bool;
279
280 /// Return the status of the given staker, `Err` if not staked at all.
281 fn status(who: &Self::AccountId) -> Result<StakerStatus<Self::AccountId>, DispatchError>;
282
283 /// Checks whether or not this is a validator account.
284 fn is_validator(who: &Self::AccountId) -> bool {
285 Self::status(who).map(|s| matches!(s, StakerStatus::Validator)).unwrap_or(false)
286 }
287
288 /// Checks whether the staker is a virtual account.
289 ///
290 /// A virtual staker is an account whose locks are not managed by the [`StakingInterface`]
291 /// implementation but by an external pallet. See [`StakingUnchecked::virtual_bond`] for more
292 /// details.
293 fn is_virtual_staker(who: &Self::AccountId) -> bool;
294
295 /// Get the nominations of a stash, if they are a nominator, `None` otherwise.
296 fn nominations(who: &Self::AccountId) -> Option<Vec<Self::AccountId>> {
297 match Self::status(who) {
298 Ok(StakerStatus::Nominator(t)) => Some(t),
299 _ => None,
300 }
301 }
302
303 /// Returns the fraction of the slash to be rewarded to reporter.
304 fn slash_reward_fraction() -> Perbill;
305
306 #[cfg(feature = "runtime-benchmarks")]
307 fn max_exposure_page_size() -> Page;
308
309 #[cfg(feature = "runtime-benchmarks")]
310 fn add_era_stakers(
311 current_era: &EraIndex,
312 stash: &Self::AccountId,
313 exposures: Vec<(Self::AccountId, Self::Balance)>,
314 );
315
316 #[cfg(feature = "runtime-benchmarks")]
317 fn set_current_era(era: EraIndex);
318}
319
320/// Set of low level apis to manipulate staking ledger.
321///
322/// These apis bypass some or all safety checks and should only be used if you know what you are
323/// doing.
324pub trait StakingUnchecked: StakingInterface {
325 /// Migrate an existing staker to a virtual staker.
326 ///
327 /// It would release all funds held by the implementation pallet.
328 fn migrate_to_virtual_staker(who: &Self::AccountId);
329
330 /// Book-keep a new bond for `keyless_who` without applying any locks (hence virtual).
331 ///
332 /// It is important that `keyless_who` is a keyless account and therefore cannot interact with
333 /// staking pallet directly. Caller is responsible for ensuring the passed amount is locked and
334 /// valid.
335 fn virtual_bond(
336 keyless_who: &Self::AccountId,
337 value: Self::Balance,
338 payee: &Self::AccountId,
339 ) -> DispatchResult;
340
341 /// Migrate a virtual staker to a direct staker.
342 ///
343 /// Only used for testing.
344 #[cfg(feature = "runtime-benchmarks")]
345 fn migrate_to_direct_staker(who: &Self::AccountId);
346}
347
348/// The amount of exposure for an era that an individual nominator has (susceptible to slashing).
349#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Encode, Decode, RuntimeDebug, TypeInfo)]
350pub struct IndividualExposure<AccountId, Balance: HasCompact> {
351 /// The stash account of the nominator in question.
352 pub who: AccountId,
353 /// Amount of funds exposed.
354 #[codec(compact)]
355 pub value: Balance,
356}
357
358/// A snapshot of the stake backing a single validator in the system.
359#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Encode, Decode, RuntimeDebug, TypeInfo)]
360pub struct Exposure<AccountId, Balance: HasCompact> {
361 /// The total balance backing this validator.
362 #[codec(compact)]
363 pub total: Balance,
364 /// The validator's own stash that is exposed.
365 #[codec(compact)]
366 pub own: Balance,
367 /// The portions of nominators stashes that are exposed.
368 pub others: Vec<IndividualExposure<AccountId, Balance>>,
369}
370
371impl<AccountId, Balance: Default + HasCompact> Default for Exposure<AccountId, Balance> {
372 fn default() -> Self {
373 Self { total: Default::default(), own: Default::default(), others: vec![] }
374 }
375}
376
377impl<
378 AccountId: Clone,
379 Balance: HasCompact + AtLeast32BitUnsigned + Copy + codec::MaxEncodedLen,
380 > Exposure<AccountId, Balance>
381{
382 /// Splits an `Exposure` into `PagedExposureMetadata` and multiple chunks of
383 /// `IndividualExposure` with each chunk having maximum of `page_size` elements.
384 pub fn into_pages(
385 self,
386 page_size: Page,
387 ) -> (PagedExposureMetadata<Balance>, Vec<ExposurePage<AccountId, Balance>>) {
388 let individual_chunks = self.others.chunks(page_size as usize);
389 let mut exposure_pages: Vec<ExposurePage<AccountId, Balance>> =
390 Vec::with_capacity(individual_chunks.len());
391
392 for chunk in individual_chunks {
393 let mut page_total: Balance = Zero::zero();
394 let mut others: Vec<IndividualExposure<AccountId, Balance>> =
395 Vec::with_capacity(chunk.len());
396 for individual in chunk.iter() {
397 page_total.saturating_accrue(individual.value);
398 others.push(IndividualExposure {
399 who: individual.who.clone(),
400 value: individual.value,
401 })
402 }
403
404 exposure_pages.push(ExposurePage { page_total, others });
405 }
406
407 (
408 PagedExposureMetadata {
409 total: self.total,
410 own: self.own,
411 nominator_count: self.others.len() as u32,
412 page_count: exposure_pages.len() as Page,
413 },
414 exposure_pages,
415 )
416 }
417}
418
419/// A snapshot of the stake backing a single validator in the system.
420#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Encode, Decode, RuntimeDebug, TypeInfo)]
421pub struct ExposurePage<AccountId, Balance: HasCompact> {
422 /// The total balance of this chunk/page.
423 #[codec(compact)]
424 pub page_total: Balance,
425 /// The portions of nominators stashes that are exposed.
426 pub others: Vec<IndividualExposure<AccountId, Balance>>,
427}
428
429impl<A, B: Default + HasCompact> Default for ExposurePage<A, B> {
430 fn default() -> Self {
431 ExposurePage { page_total: Default::default(), others: vec![] }
432 }
433}
434
435/// Metadata for Paged Exposure of a validator such as total stake across pages and page count.
436///
437/// In combination with the associated `ExposurePage`s, it can be used to reconstruct a full
438/// `Exposure` set of a validator. This is useful for cases where we want to query full set of
439/// `Exposure` as one page (for backward compatibility).
440#[derive(
441 PartialEq,
442 Eq,
443 PartialOrd,
444 Ord,
445 Clone,
446 Encode,
447 Decode,
448 RuntimeDebug,
449 TypeInfo,
450 Default,
451 MaxEncodedLen,
452)]
453pub struct PagedExposureMetadata<Balance: HasCompact + codec::MaxEncodedLen> {
454 /// The total balance backing this validator.
455 #[codec(compact)]
456 pub total: Balance,
457 /// The validator's own stash that is exposed.
458 #[codec(compact)]
459 pub own: Balance,
460 /// Number of nominators backing this validator.
461 pub nominator_count: u32,
462 /// Number of pages of nominators.
463 pub page_count: Page,
464}
465
466/// A type that belongs only in the context of an `Agent`.
467///
468/// `Agent` is someone that manages delegated funds from [`Delegator`] accounts. It can
469/// then use these funds to participate in the staking system. It can never use its own funds to
470/// stake. They instead (virtually bond)[`StakingUnchecked::virtual_bond`] into the staking system
471/// and are also called `Virtual Stakers`.
472///
473/// The `Agent` is also responsible for managing rewards and slashing for all the `Delegators` that
474/// have delegated funds to it.
475#[derive(Clone, Debug)]
476pub struct Agent<T>(T);
477impl<T> From<T> for Agent<T> {
478 fn from(acc: T) -> Self {
479 Agent(acc)
480 }
481}
482
483impl<T> Agent<T> {
484 pub fn get(self) -> T {
485 self.0
486 }
487}
488
489/// A type that belongs only in the context of a `Delegator`.
490///
491/// `Delegator` is someone that delegates funds to an `Agent`, allowing them to pool funds
492/// along with other delegators and participate in the staking system.
493#[derive(Clone, Debug)]
494pub struct Delegator<T>(T);
495impl<T> From<T> for Delegator<T> {
496 fn from(acc: T) -> Self {
497 Delegator(acc)
498 }
499}
500
501impl<T> Delegator<T> {
502 pub fn get(self) -> T {
503 self.0
504 }
505}
506
507/// Trait to provide delegation functionality for stakers.
508pub trait DelegationInterface {
509 /// Balance type used by the staking system.
510 type Balance: Sub<Output = Self::Balance>
511 + Ord
512 + PartialEq
513 + Default
514 + Copy
515 + MaxEncodedLen
516 + FullCodec
517 + TypeInfo
518 + Saturating;
519
520 /// AccountId type used by the staking system.
521 type AccountId: Clone + core::fmt::Debug;
522
523 /// Returns effective balance of the `Agent` account. `None` if not an `Agent`.
524 ///
525 /// This takes into account any pending slashes to `Agent` against the delegated balance.
526 fn agent_balance(agent: Agent<Self::AccountId>) -> Option<Self::Balance>;
527
528 /// Returns the total amount of funds that is unbonded and can be withdrawn from the `Agent`
529 /// account. `None` if not an `Agent`.
530 fn agent_transferable_balance(agent: Agent<Self::AccountId>) -> Option<Self::Balance>;
531
532 /// Returns the total amount of funds delegated. `None` if not a `Delegator`.
533 fn delegator_balance(delegator: Delegator<Self::AccountId>) -> Option<Self::Balance>;
534
535 /// Register `Agent` such that it can accept delegation.
536 fn register_agent(
537 agent: Agent<Self::AccountId>,
538 reward_account: &Self::AccountId,
539 ) -> DispatchResult;
540
541 /// Removes `Agent` registration.
542 ///
543 /// This should only be allowed if the agent has no staked funds.
544 fn remove_agent(agent: Agent<Self::AccountId>) -> DispatchResult;
545
546 /// Add delegation to the `Agent`.
547 fn delegate(
548 delegator: Delegator<Self::AccountId>,
549 agent: Agent<Self::AccountId>,
550 amount: Self::Balance,
551 ) -> DispatchResult;
552
553 /// Withdraw or revoke delegation to `Agent`.
554 ///
555 /// If there are `Agent` funds upto `amount` available to withdraw, then those funds would
556 /// be released to the `delegator`
557 fn withdraw_delegation(
558 delegator: Delegator<Self::AccountId>,
559 agent: Agent<Self::AccountId>,
560 amount: Self::Balance,
561 num_slashing_spans: u32,
562 ) -> DispatchResult;
563
564 /// Returns pending slashes posted to the `Agent` account. None if not an `Agent`.
565 ///
566 /// Slashes to `Agent` account are not immediate and are applied lazily. Since `Agent`
567 /// has an unbounded number of delegators, immediate slashing is not possible.
568 fn pending_slash(agent: Agent<Self::AccountId>) -> Option<Self::Balance>;
569
570 /// Apply a pending slash to an `Agent` by slashing `value` from `delegator`.
571 ///
572 /// A reporter may be provided (if one exists) in order for the implementor to reward them,
573 /// if applicable.
574 fn delegator_slash(
575 agent: Agent<Self::AccountId>,
576 delegator: Delegator<Self::AccountId>,
577 value: Self::Balance,
578 maybe_reporter: Option<Self::AccountId>,
579 ) -> DispatchResult;
580}
581
582/// Trait to provide functionality for direct stakers to migrate to delegation agents.
583/// See [`DelegationInterface`] for more details on delegation.
584pub trait DelegationMigrator {
585 /// Balance type used by the staking system.
586 type Balance: Sub<Output = Self::Balance>
587 + Ord
588 + PartialEq
589 + Default
590 + Copy
591 + MaxEncodedLen
592 + FullCodec
593 + TypeInfo
594 + Saturating;
595
596 /// AccountId type used by the staking system.
597 type AccountId: Clone + core::fmt::Debug;
598
599 /// Migrate an existing `Nominator` to `Agent` account.
600 ///
601 /// The implementation should ensure the `Nominator` account funds are moved to an escrow
602 /// from which `Agents` can later release funds to its `Delegators`.
603 fn migrate_nominator_to_agent(
604 agent: Agent<Self::AccountId>,
605 reward_account: &Self::AccountId,
606 ) -> DispatchResult;
607
608 /// Migrate `value` of delegation to `delegator` from a migrating agent.
609 ///
610 /// When a direct `Nominator` migrates to `Agent`, the funds are kept in escrow. This function
611 /// allows the `Agent` to release the funds to the `delegator`.
612 fn migrate_delegation(
613 agent: Agent<Self::AccountId>,
614 delegator: Delegator<Self::AccountId>,
615 value: Self::Balance,
616 ) -> DispatchResult;
617
618 /// Drop the `Agent` account and its associated delegators.
619 ///
620 /// Also removed from [`StakingUnchecked`] as a Virtual Staker. Useful for testing.
621 #[cfg(feature = "runtime-benchmarks")]
622 fn migrate_to_direct_staker(agent: Agent<Self::AccountId>);
623}
624
625sp_core::generate_feature_enabled_macro!(runtime_benchmarks_enabled, feature = "runtime-benchmarks", $);