Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Weight V2 (Chromatic Weight) #10918

Closed
wants to merge 103 commits into from
Closed
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
97d70b2
initial stuff
shawntabrizi Feb 14, 2022
89c2b4f
Merge branch 'master' into shawntabrizi-weight-v2
shawntabrizi Feb 23, 2022
8f5a2ea
fix merge
shawntabrizi Feb 23, 2022
5953db8
a direction
shawntabrizi Feb 24, 2022
a4ecc76
more stuff
shawntabrizi Feb 24, 2022
0c66a30
frame_system compiles
shawntabrizi Feb 24, 2022
75a51f7
fix system tests
shawntabrizi Feb 24, 2022
ad38154
fix support tests
shawntabrizi Feb 25, 2022
1ec5af7
update tests
shawntabrizi Feb 25, 2022
c946aeb
simplify
shawntabrizi Feb 25, 2022
6b1806a
fix some todos, add others
shawntabrizi Feb 25, 2022
bf300dc
Update weight_v2.rs
shawntabrizi Feb 25, 2022
0ae536b
fix test
shawntabrizi Feb 25, 2022
d34ce88
move some stuff around
shawntabrizi Feb 25, 2022
132641b
better variable name
shawntabrizi Feb 25, 2022
e843a10
fix mul stuff
shawntabrizi Feb 25, 2022
707c2fd
Merge branch 'master' into shawntabrizi-weight-v2
shawntabrizi Feb 26, 2022
8594902
naming
shawntabrizi Feb 26, 2022
9d90430
naming
shawntabrizi Feb 26, 2022
6f1b4c7
transaction payment
shawntabrizi Feb 26, 2022
134905d
update simple_max
shawntabrizi Feb 26, 2022
8689d2d
fix balances
shawntabrizi Feb 26, 2022
a771ca1
multisig
shawntabrizi Feb 26, 2022
b40ca8d
fixes
shawntabrizi Feb 27, 2022
a72bdeb
Update tests.rs
shawntabrizi Feb 28, 2022
7eef9b4
sudo
shawntabrizi Feb 28, 2022
4c025ad
utility
shawntabrizi Mar 1, 2022
db2567f
updates
shawntabrizi Mar 1, 2022
01a0070
todo update
shawntabrizi Mar 1, 2022
1ab35e0
proxy
shawntabrizi Mar 1, 2022
3d2cef1
switch all Weight to V2
shawntabrizi Mar 14, 2022
4770937
make frame-support tests compile
shawntabrizi Mar 14, 2022
1016747
frame system tests
shawntabrizi Mar 14, 2022
82d4ae2
fmt
shawntabrizi Mar 14, 2022
444bc97
Merge branch 'master' into shawntabrizi-weight-v2
shawntabrizi Apr 6, 2022
542fca3
fix compile
shawntabrizi Apr 6, 2022
64c0547
get transaction payment to compile
shawntabrizi Apr 6, 2022
cfaf708
fix multisig
shawntabrizi Apr 6, 2022
7b75025
society
shawntabrizi Apr 6, 2022
d56bf24
more fixes
shawntabrizi Apr 6, 2022
60d3f27
system fixes
shawntabrizi Apr 6, 2022
6420011
update weight files
shawntabrizi Apr 6, 2022
65ea42f
collective flip
shawntabrizi Apr 6, 2022
64ed2b9
lottery
shawntabrizi Apr 6, 2022
adaae9c
lots of random fixes
shawntabrizi Apr 6, 2022
7df9373
fix compile
shawntabrizi Apr 6, 2022
924deea
atomic swap
shawntabrizi Apr 6, 2022
9a1ad70
fix scored pool
shawntabrizi Apr 6, 2022
e95297f
collective compile
shawntabrizi Apr 6, 2022
7283939
fmt
shawntabrizi Apr 6, 2022
5da5b43
compile scheduler
shawntabrizi Apr 6, 2022
f2f828b
some more updates
shawntabrizi Apr 6, 2022
d7a4f16
fix referenda
shawntabrizi Apr 6, 2022
50c78df
uniques
shawntabrizi Apr 6, 2022
63ef76c
almost fix contracts
shawntabrizi Apr 6, 2022
5b235e6
fmt
shawntabrizi Apr 6, 2022
4edd948
multi phase
shawntabrizi Apr 6, 2022
a22105f
mmr
shawntabrizi Apr 6, 2022
9d0a6c0
treasury
shawntabrizi Apr 6, 2022
3c5fe79
bunch more
shawntabrizi Apr 6, 2022
dc0a36c
staking and grandpa
shawntabrizi Apr 6, 2022
28fa273
make compile
shawntabrizi Apr 6, 2022
7562af1
some more workspace fixes
shawntabrizi Apr 6, 2022
b102039
fix assets-tx-payment-pallet
shawntabrizi Apr 6, 2022
2fb67bb
more fixes
shawntabrizi Apr 6, 2022
ddbcd23
fix node executor tests
shawntabrizi Apr 6, 2022
791eb7b
frame executive compiles, but fails badly
shawntabrizi Apr 6, 2022
4e2f711
unused
shawntabrizi Apr 6, 2022
53fe88f
Remove redundant associated function
athei Apr 11, 2022
0aa17d3
Fix sudo weight annotation
athei Apr 11, 2022
1012d09
Merge branch 'master' into shawntabrizi-weight-v2
athei Apr 11, 2022
2a66520
WeightV2 is just Weight
athei Apr 11, 2022
b3ffd6e
Fix test compilation
athei Apr 11, 2022
9b77b60
fmt
athei Apr 11, 2022
0c6fb3d
Fix benches
athei Apr 11, 2022
0f5b8d9
Get rid of todo functions
athei Apr 11, 2022
6433bcc
Remove duplicated `saturating_add` function
athei Apr 11, 2022
5200fc4
Convert remote_tests to use proper weight type
athei Apr 11, 2022
8a0a0e6
Merge branch 'master' into shawntabrizi-weight-v2
athei Apr 12, 2022
69abb85
Fix contracts
athei Apr 12, 2022
8a1dc6f
Fix executive tests
athei Apr 12, 2022
cb741d2
Merge branch 'master' into shawntabrizi-weight-v2
athei Apr 13, 2022
4125521
Update UI test output
athei Apr 13, 2022
b535356
Fix ui tests
athei Apr 13, 2022
4e11e42
Merge branch 'master' into shawntabrizi-weight-v2
athei Apr 13, 2022
2379b62
Fix decl_module macro
athei Apr 13, 2022
c031ed2
fmt
athei Apr 13, 2022
b1c766a
Merge branch 'master' into shawntabrizi-weight-v2
shawntabrizi May 1, 2022
321cfaa
fix compile
shawntabrizi May 1, 2022
c604332
fix test compile
shawntabrizi May 1, 2022
34a270b
make field private
shawntabrizi May 1, 2022
2640dd3
fix tests
shawntabrizi May 1, 2022
dc9cf66
remove Weightv1
shawntabrizi May 1, 2022
bcab0bf
weight_v1 to computation_weight
shawntabrizi May 1, 2022
2eeacb7
fix doc
shawntabrizi May 1, 2022
4958b7e
computation_only -> from_computation
shawntabrizi May 2, 2022
4922339
fix limit enforced tests
shawntabrizi May 2, 2022
581dcbb
fix other test
shawntabrizi May 2, 2022
376a40c
Merge branch 'master' into shawntabrizi-weight-v2
shawntabrizi May 23, 2022
f6651bd
fix merge
shawntabrizi May 23, 2022
ce882e8
fmt
shawntabrizi May 23, 2022
4f10008
fix test compile
shawntabrizi May 23, 2022
969e4af
fix comments
shawntabrizi May 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion frame/session/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,8 @@ pub mod pallet {
fn on_initialize(n: T::BlockNumber) -> Weight {
if T::ShouldEndSession::should_end_session(n) {
Self::rotate_session();
T::BlockWeights::get().max_block
// TODO SHAWN FIX
T::BlockWeights::get().max_block.time
} else {
// NOTE: the non-database part of the weight for `should_end_session(n)` is
// included as weight for empty block, the database part is expected to be in
Expand Down
18 changes: 13 additions & 5 deletions frame/support/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ impl<T> Parameter for T where T: Codec + EncodeLike + Clone + Eq + fmt::Debug +
/// ```
/// # #[macro_use]
/// # extern crate frame_support;
/// # use frame_support::dispatch::{DispatchResultWithPostInfo, WithPostDispatchInfo};
/// # use frame_support::{dispatch::{DispatchResultWithPostInfo, WithPostDispatchInfo}, weights::WeightV2};
/// # use frame_system::{Config, ensure_signed};
/// decl_module! {
/// pub struct Module<T: Config> for enum Call where origin: T::Origin {
/// #[weight = 1_000_000]
/// fn my_long_function(origin, do_expensive_calc: bool) -> DispatchResultWithPostInfo {
/// ensure_signed(origin).map_err(|e| e.with_weight(100_000))?;
/// ensure_signed(origin).map_err(|e| e.with_weight(WeightV2 { time: 100_000, bandwidth: 100_000 }))?;
/// if do_expensive_calc {
/// // do the expensive calculation
/// // ...
Expand Down Expand Up @@ -2583,7 +2583,7 @@ mod tests {
CrateVersion, Get, GetCallName, IntegrityTest, OnFinalize, OnIdle, OnInitialize,
OnRuntimeUpgrade, PalletInfo,
},
weights::{DispatchClass, DispatchInfo, Pays, RuntimeDbWeight},
weights::{DispatchClass, DispatchInfo, Pays, RuntimeDbWeight, WeightV2},
};

pub trait Config: system::Config + Sized
Expand Down Expand Up @@ -2832,12 +2832,20 @@ mod tests {
// operational.
assert_eq!(
Call::<TraitImpl>::operational {}.get_dispatch_info(),
DispatchInfo { weight: 5, class: DispatchClass::Operational, pays_fee: Pays::Yes },
DispatchInfo {
weight: WeightV2 { time: 5, bandwidth: 0 },
class: DispatchClass::Operational,
pays_fee: Pays::Yes
},
);
// custom basic
assert_eq!(
Call::<TraitImpl>::aux_3 {}.get_dispatch_info(),
DispatchInfo { weight: 3, class: DispatchClass::Normal, pays_fee: Pays::Yes },
DispatchInfo {
weight: WeightV2 { time: 3, bandwidth: 0 },
class: DispatchClass::Normal,
pays_fee: Pays::Yes
},
);
}

Expand Down
Loading