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

Weights dont match benchmarks #418

Closed
distributedstatemachine opened this issue May 14, 2024 · 0 comments · Fixed by #424
Closed

Weights dont match benchmarks #418

distributedstatemachine opened this issue May 14, 2024 · 0 comments · Fixed by #424
Assignees
Labels
red team feature development, etc

Comments

@distributedstatemachine
Copy link
Contributor

From DMs with @JohnReedV :

Hey, I added benchmakrs for commit/reveal. While I was doing so I noticed a lot of the existing benchmarks in the subtensor pallet don't work or have different results than what is set above their function signature. Might be something we should look at.

For example add stake is defined as

        #[pallet::call_index(2)]
        #[pallet::weight((Weight::from_parts(65_000_000, 0)
        .saturating_add(T::DbWeight::get().reads(8))
        .saturating_add(T::DbWeight::get().writes(6)), DispatchClass::Normal, Pays::No))]
        pub fn add_stake(
            origin: OriginFor<T>,
            hotkey: T::AccountId,
            amount_staked: u64,
        ) -> DispatchResult {
            Self::do_add_stake(origin, hotkey, amount_staked)
        } 

but the benchmark result is

========
-- Extrinsic Time --

Model:
Time ~=       85
              µs

Reads = 10
Writes = 7
Recorded proof Size = 1064

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=       85
              µs

Reads = 10
Writes = 7
Recorded proof Size = 1064```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red team feature development, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants