This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Weight V2 (Chromatic Weight) #10918
Closed
Closed
Weight V2 (Chromatic Weight) #10918
Changes from all commits
Commits
Show all changes
103 commits
Select commit
Hold shift + click to select a range
97d70b2
initial stuff
shawntabrizi 89c2b4f
Merge branch 'master' into shawntabrizi-weight-v2
shawntabrizi 8f5a2ea
fix merge
shawntabrizi 5953db8
a direction
shawntabrizi a4ecc76
more stuff
shawntabrizi 0c66a30
frame_system compiles
shawntabrizi 75a51f7
fix system tests
shawntabrizi ad38154
fix support tests
shawntabrizi 1ec5af7
update tests
shawntabrizi c946aeb
simplify
shawntabrizi 6b1806a
fix some todos, add others
shawntabrizi bf300dc
Update weight_v2.rs
shawntabrizi 0ae536b
fix test
shawntabrizi d34ce88
move some stuff around
shawntabrizi 132641b
better variable name
shawntabrizi e843a10
fix mul stuff
shawntabrizi 707c2fd
Merge branch 'master' into shawntabrizi-weight-v2
shawntabrizi 8594902
naming
shawntabrizi 9d90430
naming
shawntabrizi 6f1b4c7
transaction payment
shawntabrizi 134905d
update simple_max
shawntabrizi 8689d2d
fix balances
shawntabrizi a771ca1
multisig
shawntabrizi b40ca8d
fixes
shawntabrizi a72bdeb
Update tests.rs
shawntabrizi 7eef9b4
sudo
shawntabrizi 4c025ad
utility
shawntabrizi db2567f
updates
shawntabrizi 01a0070
todo update
shawntabrizi 1ab35e0
proxy
shawntabrizi 3d2cef1
switch all Weight to V2
shawntabrizi 4770937
make frame-support tests compile
shawntabrizi 1016747
frame system tests
shawntabrizi 82d4ae2
fmt
shawntabrizi 444bc97
Merge branch 'master' into shawntabrizi-weight-v2
shawntabrizi 542fca3
fix compile
shawntabrizi 64c0547
get transaction payment to compile
shawntabrizi cfaf708
fix multisig
shawntabrizi 7b75025
society
shawntabrizi d56bf24
more fixes
shawntabrizi 60d3f27
system fixes
shawntabrizi 6420011
update weight files
shawntabrizi 65ea42f
collective flip
shawntabrizi 64ed2b9
lottery
shawntabrizi adaae9c
lots of random fixes
shawntabrizi 7df9373
fix compile
shawntabrizi 924deea
atomic swap
shawntabrizi 9a1ad70
fix scored pool
shawntabrizi e95297f
collective compile
shawntabrizi 7283939
fmt
shawntabrizi 5da5b43
compile scheduler
shawntabrizi f2f828b
some more updates
shawntabrizi d7a4f16
fix referenda
shawntabrizi 50c78df
uniques
shawntabrizi 63ef76c
almost fix contracts
shawntabrizi 5b235e6
fmt
shawntabrizi 4edd948
multi phase
shawntabrizi a22105f
mmr
shawntabrizi 9d0a6c0
treasury
shawntabrizi 3c5fe79
bunch more
shawntabrizi dc0a36c
staking and grandpa
shawntabrizi 28fa273
make compile
shawntabrizi 7562af1
some more workspace fixes
shawntabrizi b102039
fix assets-tx-payment-pallet
shawntabrizi 2fb67bb
more fixes
shawntabrizi ddbcd23
fix node executor tests
shawntabrizi 791eb7b
frame executive compiles, but fails badly
shawntabrizi 4e2f711
unused
shawntabrizi 53fe88f
Remove redundant associated function
athei 0aa17d3
Fix sudo weight annotation
athei 1012d09
Merge branch 'master' into shawntabrizi-weight-v2
athei 2a66520
WeightV2 is just Weight
athei b3ffd6e
Fix test compilation
athei 9b77b60
fmt
athei 0c6fb3d
Fix benches
athei 0f5b8d9
Get rid of todo functions
athei 6433bcc
Remove duplicated `saturating_add` function
athei 5200fc4
Convert remote_tests to use proper weight type
athei 8a0a0e6
Merge branch 'master' into shawntabrizi-weight-v2
athei 69abb85
Fix contracts
athei 8a1dc6f
Fix executive tests
athei cb741d2
Merge branch 'master' into shawntabrizi-weight-v2
athei 4125521
Update UI test output
athei b535356
Fix ui tests
athei 4e11e42
Merge branch 'master' into shawntabrizi-weight-v2
athei 2379b62
Fix decl_module macro
athei c031ed2
fmt
athei b1c766a
Merge branch 'master' into shawntabrizi-weight-v2
shawntabrizi 321cfaa
fix compile
shawntabrizi c604332
fix test compile
shawntabrizi 34a270b
make field private
shawntabrizi 2640dd3
fix tests
shawntabrizi dc9cf66
remove Weightv1
shawntabrizi bcab0bf
weight_v1 to computation_weight
shawntabrizi 2eeacb7
fix doc
shawntabrizi 4958b7e
computation_only -> from_computation
shawntabrizi 4922339
fix limit enforced tests
shawntabrizi 581dcbb
fix other test
shawntabrizi 376a40c
Merge branch 'master' into shawntabrizi-weight-v2
shawntabrizi f6651bd
fix merge
shawntabrizi ce882e8
fmt
shawntabrizi 4f10008
fix test compile
shawntabrizi 969e4af
fix comments
shawntabrizi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,7 +66,7 @@ use sp_runtime::{ | |
| generic, impl_opaque_keys, | ||
| traits::{ | ||
| self, BlakeTwo256, Block as BlockT, ConvertInto, NumberFor, OpaqueKeys, | ||
| SaturatedConversion, StaticLookup, | ||
| SaturatedConversion, Saturating, StaticLookup, | ||
| }, | ||
| transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, | ||
| ApplyExtrinsicResult, FixedPointNumber, Perbill, Percent, Permill, Perquintill, | ||
|
|
@@ -169,7 +169,9 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); | |
| /// by Operational extrinsics. | ||
| const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); | ||
| /// We allow for 2 seconds of compute with a 6 second average block time. | ||
| const MAXIMUM_BLOCK_WEIGHT: Weight = 2 * WEIGHT_PER_SECOND; | ||
| const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::new() | ||
| .set_computation(2 * WEIGHT_PER_SECOND) | ||
| .set_bandwidth(5 * 1024 * 1024); // 5 MB | ||
|
|
||
| parameter_types! { | ||
| pub const BlockHashCount: BlockNumber = 2400; | ||
|
|
@@ -673,11 +675,11 @@ impl pallet_election_provider_multi_phase::MinerConfig for Runtime { | |
| // The unsigned submissions have to respect the weight of the submit_unsigned call, thus their | ||
| // weight estimate function is wired to this call's weight. | ||
| fn solution_weight(v: u32, t: u32, a: u32, d: u32) -> Weight { | ||
| < | ||
| Weight::from_computation(< | ||
|
Member
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. does the |
||
| <Self as pallet_election_provider_multi_phase::Config>::WeightInfo | ||
| as | ||
| pallet_election_provider_multi_phase::WeightInfo | ||
| >::submit_unsigned(v, t, a, d) | ||
| >::submit_unsigned(v, t, a, d)) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -1090,7 +1092,7 @@ parameter_types! { | |
| pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / ( | ||
| <Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(1) - | ||
| <Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(0) | ||
| )) / 5) as u32; | ||
| )).computation() / 5) as u32; | ||
| pub Schedule: pallet_contracts::Schedule<Runtime> = Default::default(); | ||
| } | ||
|
|
||
|
|
@@ -1807,6 +1809,7 @@ impl_runtime_apis! { | |
| storage_deposit_limit: Option<Balance>, | ||
| input_data: Vec<u8>, | ||
| ) -> pallet_contracts_primitives::ContractExecResult<Balance> { | ||
| let gas_limit = Weight::from_computation(gas_limit); | ||
| Contracts::bare_call(origin, dest, value, gas_limit, storage_deposit_limit, input_data, true) | ||
| } | ||
|
|
||
|
|
@@ -1820,6 +1823,7 @@ impl_runtime_apis! { | |
| salt: Vec<u8>, | ||
| ) -> pallet_contracts_primitives::ContractInstantiateResult<AccountId, Balance> | ||
| { | ||
| let gas_limit = Weight::from_computation(gas_limit); | ||
| Contracts::bare_instantiate(origin, value, gas_limit, storage_deposit_limit, code, data, salt, true) | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.