gupnik
16fe5be02f
Renames API ( #1186 )
...
Co-authored-by: Javier Viola <javier@parity.io >
2023-09-01 12:16:07 +05:30
Oliver Tale-Yazdi
892831e55c
WeightMeter: more consistent naming (#14586 )
...
* Rename WeightMeter functions
* Fixes
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fixup and doc + tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* One more test
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fixup pallets
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use correct function 🤦
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Apply suggestions from code review
Co-authored-by: Juan <juangirini@gmail.com >
* Update primitives/weights/src/weight_meter.rs
Co-authored-by: Bastian Köcher <git@kchr.de >
* Update primitives/weights/src/weight_meter.rs
Co-authored-by: Bastian Köcher <git@kchr.de >
* Update primitives/weights/src/weight_meter.rs
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Juan <juangirini@gmail.com >
Co-authored-by: Bastian Köcher <git@kchr.de >
2023-07-18 14:38:44 +00:00
Oliver Tale-Yazdi
0895f4904f
Delete 1D weight ctors and set explicit deprecation dates ( #14397 )
...
* Delete old weight functions
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add explicit removal dates
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Upate UI tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2023-06-16 12:09:28 +00:00
Bigna Härdi
0e49ed72aa
Add serde feature flag to primitives ( #13027 )
...
* add serde_full feature flag
add serde_full to sp_runtime
add space to toml
add serde_full to application-crypto
add serde_full to arithmetic
fix arithmetic
add serde full to beefy
add serde full to consensus
add serde_full to core
add serdefull to finality grandpa
add serde_full to several primitives crates
make rpc no_std compatible
add scale info to runtime
make serializer no_std compatible
add serde full to storage
add full serde to version
add serde full to weights
add all serde_full features
add . to comment
add missing impl-serde
fix no-std build
fix build
add full_crypto to serde_full
serde_full also implements crypto
full_serde does not work with full_crytpo. needs std
no no_std serde impl possible
also for crypto std is necessary
no serde full for application crypto
fix arithmetic
fix tomls
fix some things
impl fmt for Signature
add serialize to Public
add impl_maybe_marker_serde_full
fix sp-application-crypto toml
add serde feature flag
fix clippy
fix toml grandpa
fix grandpa
rename if_std to if_serde
keystore is not no_std compatible
make keystore vrf no_std compatible
fix nopos-elections
fix rpc
fix serializer
fix test-primitives
fix version
add comment
add serde full only import for format string
remove all(serde_full and full_crypot) as serde_full enforces full_crypto
make comment better readable
even better comment
clean up rpc toml
clean up toml
clean up serializer toml
clean up storage toml
fix std build
update .lock
fix sp-version
move sp_std import
test extern crate alloc
replace sp_std with core
add missing core
sp_core: serde feature do not enforce full crypto
application-crypto: serde feature do not enforce full crypto
rename serde_full to serde
add dep:serde and alloc to default feature
add full_crypto and remove unnecessary debu/fmt impls for serde
update comment
remove obolsete change in display AccountId32
remove extra changes
minimize diff
revert keystore changes
remove std from keystore
remove full-crypto feature
fix serde import
fix comment
fix feature = serde
* rename serde_full to serde
* move #[doc(hidden)] back
* remove feature = full crypto require frm MultiSigner
* reorder serde and scale_info import
* fix bs58 missing alloc import in serde feature
* add `from_string` to serde feature and add unimplemented
* remove serde feature from fixed_point display
* Remove serde/alloc
Co-authored-by: Davide Galassi <davxy@datawok.net >
* Update primitives/consensus/babe/Cargo.toml
Co-authored-by: Bastian Köcher <git@kchr.de >
* Update primitives/arithmetic/src/fixed_point.rs
Co-authored-by: Bastian Köcher <git@kchr.de >
* revert `from_string`fixed impl back to std only
* remove duplicate runtime string impl
* use sp_std::alloc
* remove no_std compatible rpc
* remove no_std compatibility from serializer
* rename mpl_maybe_marker_serde to std_or_serde
* update .lock
* add sp-std to executor
* fix sp-std import
* fix sp_std::format import
* use crate import
* add serde feature
* Update primitives/core/src/lib.rs
---------
Co-authored-by: Davide Galassi <davxy@datawok.net >
Co-authored-by: Bastian Köcher <git@kchr.de >
2023-05-17 11:31:12 +00:00
Oliver Tale-Yazdi
36957d6760
Deprecate V1 Weights ( #13699 )
...
* Remove deprecated pallet calls
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Deprecate old weight
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update Runtime API
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Delete shitty code
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix doctest
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update frame/alliance/src/lib.rs
Co-authored-by: Koute <koute@users.noreply.github.com >
* Add doc
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* contracts: Use u64 as old weight type
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update frame/contracts/src/lib.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Koute <koute@users.noreply.github.com >
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
Co-authored-by: parity-processbot <>
2023-04-04 18:57:21 +00:00
Oliver Tale-Yazdi
370e71cb20
Remove Weight::without_{ref_time, proof_size} ( #13637 )
...
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2023-03-23 17:09:29 +00:00
Oliver Tale-Yazdi
fd6b971d22
Add dedicated FeePolynomial struct ( #13612 )
...
* Add FeePolynomial struct
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add Weight::without_{ref_time, proof_size}
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Docs
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Cleanup code
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add docs
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* doc
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix docs
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* docs
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2023-03-15 20:43:22 +00:00
Oliver Tale-Yazdi
9e56e1acdd
Deprecate Weight::from_{ref_time, proof_size} ( #13475 )
...
* Deprecate Weight::from_{ref_time, proof_size}
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update templates
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use from_parts
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use from_parts
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Dont revert comment 🤦
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_balances
* Update weight files
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* More fixes
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Adapt to Master changes
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: command-bot <>
2023-03-02 21:28:17 +00:00
Vivek Pandya
bc53b9a03a
Remove years from copyright notes. ( #13415 )
...
* Change copyright year to 2023 from 2022
* Fix incorrect update of copyright year
* Remove years from copy right header
* Fix remaining files
* Fix typo in a header and remove update-copyright.sh
2023-02-21 18:46:41 +00:00
Alexander Theißen
1c04ab0f6f
contracts: Use proof_size from benchmarks ( #13268 )
...
* Avoid reading contract code when it is supplied in the extrinsic
* Remove custom proof size injection from schedule
* Set benchmarks pov_mode to Measure
* Reduce overestimation of code size on re-instrument
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* Do not override proof size from benchmark
* Do not charge proof size for basic block
* Incrase gas limit for tests
* Fix deletion queue to also use `proof_size`
* Fix tests
* Update frame/contracts/src/schedule.rs
Co-authored-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
* Fix wrong schedule macro invocations
* Remove stale docs
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* Handle zero components
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* Fix instruction weight
---------
Co-authored-by: command-bot <>
Co-authored-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
2023-02-15 22:56:50 +01:00
Shawn Tabrizi
6bbc2292e4
Improve Weight Template and API ( #13355 )
...
* improve weights template and api
* follow template
2023-02-12 15:01:06 +00:00
Oliver Tale-Yazdi
9601b479e4
Correct arithmetical semantic of PerDispatchClass ( #13194 )
...
* Fix PerDispatchClass arithmetic
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Test PerDispatchClass arithmetic
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add helpers for Weight
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Remove stale doc
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Dont mention Polkadot in Substrate
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* fmt
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Remove saturating_ prefix
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix usage
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2023-01-26 16:13:38 +00:00
Gavin Wood
6f3d1a8143
General Message Queue Pallet ( #12485 )
...
* The message queue
* Make fully generic
* Refactor
* Docs
* Refactor
* Use iter not slice
* Per-origin queues
* Multi-queue processing
* Introduce MaxReady
* Remove MaxReady in favour of ready ring
* Cleanups
* ReadyRing and tests
* Stale page reaping
* from_components -> from_parts
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Move WeightCounter to sp_weights
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add MockedWeightInfo
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Deploy to kitchensink
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use WeightCounter
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Small fixes and logging
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add service_page
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Typo
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Move service_page below service_queue
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add service_message
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use correct weight function
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Overweight execution
* Refactor
* Missing file
* Fix WeightCounter usage in scheduler
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix peek_index
Take into account that decoding from a mutable slice modifies it.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add tests and bench service_page_item
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add debug_info
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add no-progress check to service_queues
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add more benches
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Bound from_message and try_append_message
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add PageReaped event
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Rename BookStateOf and BookStateFor
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update tests and remove logging
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Remove redundant per-message origins; add footprint() and sweep_queue()
* Move testing stuff to mock.rs
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add integration test
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix no-progress check
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix debug_info
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fixup merge and tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix footprint tracking
* Introduce
* Formatting
* OverweightEnqueued event, auto-servicing config item
* Update tests and benchmarks
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Provide change handler
* Add missing BookStateFor::insert and call QueueChangeHandler
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Docs
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update benchmarks and weights
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* More tests...
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use weight metering functions
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* weightInfo::process_message_payload is gone
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add defensive_saturating_accrue
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Rename WeightCounter to WeightMeter
Ctr+Shift+H should do the trick.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Test on_initialize
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add module docs
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Remove origin from MaxMessageLen
The message origin is not encoded into the heap and does
therefore not influence the max message length anymore.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add BoundedVec::as_slice
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Test Page::{from_message, try_append_message}
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fixup docs
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Docs
* Do nothing in sweep_queue if the queue does not exist
... otherwise it inserts default values into the storage.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Test ring (un)knitting
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Upgrade stress-test
Change the test to not assume that all queued messages will be
processed in the next block but split it over multiple.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* More tests...
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Beauty fixes
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Rename BoundedVec::as_slice to as_bounded_slice
Conflicts with deref().as_slice() otherwise.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix imports
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Remove ReadyRing struct
Was used for testing only. Instead use 'fn assert_ring' which also
check the service head and backlinks.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Beauty fixes
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix stale page watermark
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Cleanup
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix test feature and clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* QueueChanged handler is called correctly
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update benches
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Abstract testing functions
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* More tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Cleanup
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* fmt
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Simplify tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Make stuff compile
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Extend overweight execution benchmark
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Remove TODOs
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Test service queue with faulty MessageProcessor
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* fmt
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update pallet ui tests to 1.65
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* More docs
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Review doc fixes
Co-authored-by: Robert Klotzner <eskimor@users.noreply.github.com >
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add weight_limit to extrinsic weight of execute_overweight
* Correctly return unused weight
* Return actual weight consumed in do_execute_overweight
* Review fixes
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Set version 7.0.0-dev
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Make it compile
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Switch message_size to u64
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Switch message_count to u64
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix benchmarks
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Make CI green
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Docs
* Update tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* ".git/.scripts/bench-bot.sh" pallet dev pallet_message_queue
* Dont mention README.md in the Cargo.toml
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Remove reference to readme
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: parity-processbot <>
Co-authored-by: Robert Klotzner <eskimor@users.noreply.github.com >
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
2022-12-09 10:38:24 +00:00
Keith Yeung
51db8c77a7
Introduce sensible weight constants ( #12868 )
...
* Introduce sensible weight constants
* cargo fmt
* Remove unused import
* Add missing import
* ".git/.scripts/bench-bot.sh" pallet dev pallet_lottery
Co-authored-by: command-bot <>
2022-12-09 01:18:51 +09:00
Oliver Tale-Yazdi
bd2166de79
Move WeightCounter to sp-weights ( #12603 )
...
* Move WeightCounter to sp_weights
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Rename to WeightMeter and test
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix pallet-scheduler for new usage
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update primitives/weights/src/weight_meter.rs
Co-authored-by: David <dvdplm@gmail.com >
* More tests for can_accrue
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Remove defensive_accrue and fixup consumed_ratio
I dont think there is a good use-case for defensive_accrue
without saturation. Only in tests maybe, will remove for now
until we have a use-case.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Test
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: David <dvdplm@gmail.com >
Co-authored-by: Gavin Wood <gavin@parity.io >
2022-11-11 11:26:47 +00:00
Bastian Köcher
ec6a428ade
payment_queryInfo: Make it work with WeightV2 (#12633 )
...
* `payment_queryInfo`: Make it work with `WeighV2`
The runtime api for querying the payment info depends on the `Weight` type and broke for old
runtimes that still use the `WeighV1`. This pull requests fixes this by:
1. Bumping the version of the runtime api.
2. Making the node side code use the correct runtime api function depending on the version of the
runtime api.
3. Make the RPC always return `WeighV1`.
Users of the api should switch to `state_call` and decide based on the version of the runtime api
which `Weight` type is being returned.
* Fix tests
* Review comment
2022-11-08 11:33:43 +01:00
Keith Yeung
fbdfa84cd7
Rename from_components to from_parts ( #12473 )
...
* Rename `from_components` to `from_parts`
* Fixes
* Spelling
2022-10-11 16:35:54 +00:00
Oliver Tale-Yazdi
8596339b49
Fix Weight::is_zero ( #12396 )
...
* Fix Weight::is_zero
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add test
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2022-10-03 13:17:59 +00:00
Keith Yeung
0327258566
Add storage size component to weights ( #12277 )
...
* Add storage size component to weights
* Rename storage_size to proof_size
* Update primitives/weights/src/weight_v2.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fixes
* cargo fmt
* Implement custom Decode and CompactAs
* Add missing import
* Fixes
* Remove CompactAs implementation
* Properly migrate from 1D weight
* Remove #[pallet::compact] from Weight parameters
* More #[pallet::compact] removals
* Add unit tests
* Set appropriate default block proof size
* cargo fmt
* Remove nonsensical weight constant
* Test only for the reference time weight in frame_system::limits
* Only check for reference time weight on idle
* Use destructuring syntax
* Update test expectations
* Fixes
* Fixes
* Fixes
* Correctly migrate from 1D weights
* cargo fmt
* Migrate using extra extrinsics instead of custom Decode
* Fixes
* Silence dispatch call warnings that were previously allowed
* Fix gas_left test
* Use OldWeight instead of u64
* Fixes
* Only check for reference time weight in election provider
* Fix test expectations
* Fix test expectations
* Use only reference time weight in grandpa test
* Use only reference time weight in examples test
* Use only reference time weight in examples test
* Fix test expectations
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
2022-09-28 10:21:53 +00:00
Frederik Gartenmeister
3317eb76d5
Const impls of base arithmetics for Weights with u64 ( #12322 )
...
* Const impls
* Adding explainatory comments
* Update primitives/weights/src/weight_v2.rs
Doc comment suggestions
Co-authored-by: Bastian Köcher <git@kchr.de >
* Update primitives/weights/src/weight_v2.rs
Doc comment suggestions
Co-authored-by: Bastian Köcher <git@kchr.de >
Co-authored-by: Bastian Köcher <git@kchr.de >
2022-09-24 08:59:44 +02:00
Keith Yeung
30e7b1e8cd
Create sp-weights crate to store weight primitives ( #12219 )
...
* Create sp-weights crate to store weight primitives
* Fix templates
* Fix templates
* Fixes
* Fixes
* cargo fmt
* Fixes
* Fixes
* Use deprecated type alias instead of deprecated unit types
* Use deprecated subtraits instead of deprecated hollow new traits
* Fixes
* Allow deprecation in macro expansion
* Add missing where clause during call macro expansion
* cargo fmt
* Fixes
* cargo fmt
* Fixes
* Fixes
* Fixes
* Fixes
* Move FRAME-specific weight files back to frame_support
* Fixes
* Update frame/support/src/dispatch.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Update frame/support/src/dispatch.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Update frame/support/src/dispatch.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Add missing header
* Rewrite module docs
* Fixes
* Fixes
* Fixes
* Fixes
* cargo fmt
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2022-09-13 13:23:44 +00:00