Qinxuan Chen
40c04cf11d
*: update rand to v0.8.5 ( #12962 )
...
* *: update rand to v0.8.5
* *: remove useless deps from Cargo.toml
* fix pallet-session-benchmarking
* fix pallet-election-provider-support test
* remove useless rand from dev-dependencies
2022-12-19 07:38:51 +01: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
João Paulo Silva de Souza
8751f88fc7
Implement crate publishing on CI ( #12768 )
...
* implement crate publishing from CI
* fix indentation
* use resource_group for job exclusivity
ensure that at most one instance of the publish-crates job is running at any given time to prevent race conditions
* correct publish = false
* Remove YAML anchors as GitLab's `extends:` doesn't need it
* Temporarily force cache upload for the new jobs
* Revert `RUSTY_CACHIER_FORCE_UPLOAD`
* pin libp2p-tcp=0.37.0 for sc-telemetry
* Revert "pin libp2p-tcp=0.37.0 for sc-telemetry"
This reverts commit 29146bfad6c31e8cf0e2f17ad92a71bb81a373af.
* always collect generated crates
* increase timeout for publish-crates-template
* Force upload the new job cache again
* Revert "Force upload the new job cache again"
This reverts commit 5a5feee1b2c51fdef768b25a76be4c3949ec1c99.
* reformat
* improve timeout explanation
* s/usual/average
Co-authored-by: Vladimir Istyufeev <vladimir@parity.io >
2022-12-07 18:08:48 +00:00
Niklas Adolfsson
2b8af8cb1a
release sp-core 7.0.0 and sp-runtime 7.0.0 ( #12599 )
...
* chore(release): sp-core v7.0.0
* chore(release): sp-runtime v7.0.0
* fix bad merge
2022-11-15 14:54:14 +00: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