-
Couldn't load subscription status.
- Fork 2.7k
Update Weights for Vesting Pallet #5708
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -190,11 +190,13 @@ decl_module! { | |
| /// | ||
| /// # <weight> | ||
| /// - `O(1)`. | ||
| /// - One balance-lock operation. | ||
| /// - One storage read (codec `O(1)`) and up to one removal. | ||
| /// - One event. | ||
| /// - DbWeight: 2 Reads, 2 Writes | ||
| /// - Reads: Vesting Storage, Balances Locks, [Sender Account] | ||
| /// - Writes: Vesting Storage, Balances Locks, [Sender Account] | ||
| /// - Benchmark: 147.5 µs (min square analysis) | ||
| /// - Assuming less than 50 locks on any user, else we may want factor in number of locks. | ||
| /// # </weight> | ||
| #[weight = 0] | ||
| #[weight = 150_000_000 + T::DbWeight::get().reads_writes(2, 2)] | ||
| fn vest(origin) -> DispatchResult { | ||
| let who = ensure_signed(origin)?; | ||
| Self::update_lock(who) | ||
|
|
@@ -211,12 +213,13 @@ decl_module! { | |
| /// | ||
| /// # <weight> | ||
| /// - `O(1)`. | ||
| /// - Up to one account lookup. | ||
| /// - One balance-lock operation. | ||
| /// - One storage read (codec `O(1)`) and up to one removal. | ||
| /// - One event. | ||
| /// - DbWeight: 3 Reads, 3 Writes | ||
| /// - Reads: Vesting Storage, Balances Locks, Target Account | ||
| /// - Writes: Vesting Storage, Balances Locks, Target Account | ||
| /// - Benchmark: 150.4 µs (min square analysis) | ||
| /// - Assuming less than 50 locks on any user, else we may want factor in number of locks. | ||
| /// # </weight> | ||
| #[weight = 0] | ||
| #[weight = 150_000_000 + T::DbWeight::get().reads_writes(3, 3)] | ||
| fn vest_other(origin, target: <T::Lookup as StaticLookup>::Source) -> DispatchResult { | ||
| ensure_signed(origin)?; | ||
| Self::update_lock(T::Lookup::lookup(target)?) | ||
|
|
@@ -233,10 +236,14 @@ decl_module! { | |
| /// Emits `VestingCreated`. | ||
| /// | ||
| /// # <weight> | ||
| /// - Creates a new storage entry, but is protected by a minimum transfer | ||
| /// amount needed to succeed. | ||
| /// - `O(1)`. | ||
| /// - DbWeight: 3 Reads, 3 Writes | ||
| /// - Reads: Vesting Storage, Balances Locks, Target Account, [Sender Account] | ||
| /// - Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account] | ||
| /// - Benchmark: 263 µs (min square analysis) | ||
| /// - Assuming less than 50 locks on any user, else we may want factor in number of locks. | ||
| /// # </weight> | ||
| #[weight = 1_000_000_000] | ||
| #[weight = 300_000_000 + T::DbWeight::get().reads_writes(3, 3)] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we have a rule of thumb for granularity or soundings? This, accurately, should have been around 260_000_000 or sth? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Benchmarks are not that accurate to begin with, but yeah, rounding here is mostly just an opinion, as long as it does not extremely change the value. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Benchmarks are not that accurate to begin with, but yeah, rounding here is mostly just an opinion, as long as it does not extremely change the value. I am also taking into consideration the variability of locks. If this is a little bit larger, it is a little bit safer overall as more locks are introduced per user. |
||
| pub fn vested_transfer( | ||
| origin, | ||
| target: <T::Lookup as StaticLookup>::Source, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.