* stub for construct_dev_runtime!
* revert
* stub for dev_mode proc macro
* preliminary docs for pallet::dev_mode (attribute) proc macro
* add dev_mode to pallet_macros module
* add docs item for dev_mode to frame_support
* parsing of #[pallet(dev_mode)]
* strip out dev_mode stub since it will be an arg for pallet instead
* make pallet Def struct aware of dev mode
* WIP
* revert changes to call.rs
* pass dev_mode to pallet parsing code
* auto-specify default weights when in dev mode if not specified
* add proof / expect for syn::parse in dev mode weight processing
* set all storages to unbounded when in dev mode
* just use 0
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* add invalid pallet arg test
* add passing dev mode pallet test
* add test confirming that dev mode features only work in dev mode
* cargo fmt + clean up
* bump CI
* fix pallet ui test
* add docs for dev mode
* add warning about using dev mode in production circumstances
* remove comment about no other attributes being supported
* fix unneeded assignment
* make warning more explicit
* more explicit warning about using dev mode in production
* simpler assignment for dev_mode boolean
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* add note about MEL requirement
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* add comment specifying why weights can be omitted in example
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* tweak wording of comments
* bump ci
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* traits for defensive min and defensive max
* defensive min and strict min with tests
* defensive max and strict max with tests
* include docs
* implement partial ord on defensive min and max
* Update frame/support/src/traits/misc.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* wrap lines
* Fix traits
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update frame/support/src/traits/misc.rs
* Update frame/support/src/traits/misc.rs
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 <>
* Force base weights to be the minimum only when the intercept is negative; emit minimum execution times
* Add an `assert` making sure the intercept is zero when it's supposed to be zero
* Fix template
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* ".git/.scripts/bench-bot.sh" pallet dev pallet_assets
* ".git/.scripts/bench-bot.sh" pallet dev pallet_uniques
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: command-bot <>
* Bump clap to 3.2.22
* Replace `from_os_str` with `value_parser`
* Replace `from_str` and `try_from_str` with `value_parser`
* Move possible_values to the new format
* Remove unwanted print
* Add missing match branch
* Update clap to 4.0.9 and make it compile
* Replace deprecated `clap` macro with `command` and `value`
* Move remaining `clap` attributes to `arg`
* Remove no-op value_parsers
* Adjust value_parser for state_version
* Remove "deprecated" feature flag and bump to 4.0.11
* Improve range
Co-authored-by: Bastian Köcher <git@kchr.de>
* Apply suggestions
* Trigger CI
* Fix unused error warning
* Fix doc errors
* Fix ArgGroup naming conflict
* Change default_value to default_value_t
* Use 1.. instead of 0..
Co-authored-by: Bastian Köcher <git@kchr.de>
* execute try-state at end of tests
* run post condition only with try runtime
* Revert "run post condition only with try runtime"
This reverts commit 7db0ecf7eaa2ee5afa5a995487b73d023ba3bcd9.
* voterlist contains validators as well
* fmt
* simplify
* fmt
Co-authored-by: parity-processbot <>
* pallet-mmr: cosmetic improvements
* pallet-mmr: fix offchain storage for initial sync
* address review comments
* pallet-mmr: change offchain fork-resistant key to `(prefix, pos, parent_hash)`
Do this so that both canon and fork-resitant keys have the same
`(prefix, pos).encode()` prefix. Might be useful in the future if we'd
be able to to "get" offchain db entries using key prefixes as well.
Signed-off-by: acatangiu <adrian@parity.io>
Signed-off-by: acatangiu <adrian@parity.io>
* dont use benchmark range on constant function
* update weights
* fix
* new weights
* Update frame/examples/basic/src/benchmarking.rs
Co-authored-by: parity-processbot <>
* proof of concept working for pallet::whitelist_storage
* fix comments
* pallet macros docs rewrite WIP
* fix issue with cargo fmt cobbling links
* tweak capitalization
* fix docs for storage_version
* fix docs for pallet::hooks
* fix several comments
* fix invalid link
* fix wrapping and add missing links for pallet::hooks docs
* run rewrap on all text blocks in frame_support::pallet docs
* cargo fmt
* fix up pallet::call_index docs
* fix docs for pallet::extra_constants
* fix docs for pallet::error
* fix docs for pallet::event
* fix docs for pallet::event
* * fix docs for pallet::storage
* fix docs for pallet::getter
* fix docs for pallet::storage_prefix
* fix docs for pallet::unbounded
* fix docs for pallet::whitelist_storage
* fix docs for #[cfg(..)] (for storage items and attributes)
* fix docs for pallet::storage macro expansion
* fix docs for pallet::type_value
* fix docs for pallet::genesis_config
* fix docs for pallet::genesis_build
* fix docs for pallet::inherent
* fix docs for pallet::validate_unsigned
* fix docs for pallet::origin
* fix docs for general notes on instantiable pallets
* fix docs for example of a non-instantiable pallet
* fix docs for example of an instantiable pallet
* fix docs for upgrade guidelines
* fix docs for upgrade guidelines
* fix docs for upgrade checking and final notes
* fix some examples near the beginning
* extract docs for `pallet::whitelist_storage`
* add docs for pallet_macro_stub
* fix order of pallet::config and pallet::constant
* set up stub for pallet::config
* set up stub for pallet::constant
* fix
* set up stub for pallet::disable_frame_system_supertrait_check
* set up stub for pallet::generate_storage_info
* set up stub for pallet::storage_version
* set up stub for pallet::hooks
* set up stub for pallet::weight
* set up stub for pallet::compact
* set up stub for pallet::call_index
* set up stub for pallet::extra_constants
* set up stub for pallet::error
* set up stub for pallet::event
* set up stub for pallet::generate_deposit
* set up stub for pallet::storage
* set up stub for pallet::getter
* set up stub for pallet::storage_prefix
* set up stub for pallet::unbounded
* set up stub for pallet::type_value
* set up stub for pallet::genesis_config
* set up stub for pallet::genesis_build
* set up stub for pallet::inherent
* set up stub for pallet::validate_unsigned
* set up stub for pallet::origin
* fix comment
* cargo fmt
* tweak error message
* Update frame/support/procedural/src/lib.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* Update frame/support/procedural/src/lib.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* switch order of derives
Co-authored-by: Squirrel <gilescope@gmail.com>
* tweak wording
Co-authored-by: Squirrel <gilescope@gmail.com>
* add more context info about `MAX_MODULE_ERROR_ENCODED_SIZE`
Co-authored-by: Squirrel <gilescope@gmail.com>
* tweak wording about where clause
Co-authored-by: Squirrel <gilescope@gmail.com>
* clarify wording about system/events key
Co-authored-by: Squirrel <gilescope@gmail.com>
* use "The Event enum" instead of "item"
Co-authored-by: Squirrel <gilescope@gmail.com>
* fix bad wording
Co-authored-by: Squirrel <gilescope@gmail.com>
* use enum instead of type
Co-authored-by: Squirrel <gilescope@gmail.com>
* expect => expects
Co-authored-by: Squirrel <gilescope@gmail.com>
* add additional note about storage prefix
Co-authored-by: Squirrel <gilescope@gmail.com>
* clearer note about GenesisConfig
Co-authored-by: Squirrel <gilescope@gmail.com>
* Use "The impl" instead of "The item"
Co-authored-by: Squirrel <gilescope@gmail.com>
* add note and link to tight-coupling docs
Co-authored-by: Squirrel <gilescope@gmail.com>
* cargo fmt
* remove spaces around parenthesis
* fix missing text for pallet::config
* fix issue with pallet::constant intro
* fix wording about codec index
* fix pallet::error wording
* fix comment about 1 byte => 256 errors
* fix where clause comment
* fix comment about where pallet events are stored
* rewrap some text
* fix pallet::storage docs
* fix pallet::storage_prefix docs
* tweak docs for pallet::genesis_build
* tweak docs for pallet::config
* specify that pallet::event must be present if pallet::config is present
* add note about why we would want to bypass the supertrait check
* mention that pallet::generate_store attribute is only valid on pallet struct
* add note about adding new calls to the end to maintain existing order
* add note about pallet::type_value and pallet::storage
Co-authored-by: Squirrel <gilescope@gmail.com>
* add note about using pallet::type_value alongside pallet::storage
* include warning about modifying disaptchables on other pallet::call_index docs page
* fix incorrect comment
* add much more information for pallet::inherent
* move pallet::pallet macro expansion notes back to their rightful place
* re-run CI
* fix macro expansion appearing in wrong place for pallet::pallet
* replicate pallet::pallet docs on the pallet::pallet macro stub
* force CI re-run
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Squirrel <gilescope@gmail.com>
Co-authored-by: parity-processbot <>
* Introduce preimages module in traits
* Multisize Preimages
* Len not actually necessary
* Tweaks to the preimage API
* Fixes
* Get Scheduler building with new API
* Scheduler tests pass
* Bounded Scheduler 🎉
* Use Agenda holes and introduce IncompleteSince to avoid need to reschedule
* Tests pass with new weight system
* New benchmarks
* Add missing file
* Drop preimage when permenantly overeight
* Drop preimage when permenantly overeight
* Referenda uses latest preimage API
* Testing ok
* Adding tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* fmt
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add preimage migration
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Docs
* Remove dbg
* Refactor Democracy
* Refactor Democracy
* Add final MEL
* Remove silly maps
* Fixes
* Minor refactor
* Formatting
* Fixes
* Fixes
* Fixes
* Update frame/preimage/src/lib.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
* Add migrations to Democracy
* WIP
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Resolve conflicts
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Revert "Resolve conflicts"
This reverts commit 734d66d69e54553471ffa54fa52e3e304dc8f106.
* Undo wrong resolves...
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* WIP
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Make compile
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* massage clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* More clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* clippy annoyance
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* clippy annoyance
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Fix benchmarks
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* add missing file
* Test <Preimage as QueryPreimage>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* More tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Clippy harassment
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add test
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Fixup tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Remove old stuff
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* fmt
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Test <Scheduler as Anon> trait functions
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update pallet-ui tests
Why is this needed? Should not be the case unless master is broken...
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* More scheduler trait test
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* More tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Apply review suggestion
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Beauty fixes
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add Scheduler test migration_v3_to_v4_works
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Merge fixup
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Keep referenda benchmarks instantiatable
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update weights
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Use new scheduler weight functions
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Use new democracy weight functions
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Use weight compare functions
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Update pallet-ui tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* More renaming…
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* More renaming…
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add comment
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Implement OnRuntimeUpgrade for scheduler::v3_to_v4 migration
Put the migration into a proper `MigrateToV4` struct and implement
the OnRuntimeUpgrade hooks for it. Also move the test to use that
instead.
This should make it easier for adding it to Polkadot.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Handle undecodable Agendas
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Remove trash
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Fix test
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Use new OnRuntimeUpgrade functions
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* fix test
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Fix BoundedSlice::truncate_from
Co-authored-by: jakoblell
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Fix pre_upgrade hook return values
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add more error logging
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Find too large preimages in the pre_upgrade hook
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Test that too large Calls in agendas are ignored
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Use new OnRuntimeUpgrade hooks
Why did the CI not catch this?!
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* works fine - just more logs
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Fix staking migration
Causing issues on Kusama...
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Fix UI tests
No idea why this is needed. This is actually undoing an earlier change.
Maybe the CI has different rustc versions!?
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Remove multisig's Calls (#12072)
* Remove multisig's Calls
* Multisig: Fix tests and re-introduce reserve logic (#12241)
* Fix tests and re-introduce reserve logic
* fix benches
* add todo
* remove irrelevant bench
* [Feature] Add a migration that drains and refunds stored calls (#12313)
* [Feature] Add a migration that drains and refunds stored calls
* migration fixes
* fixes
* address review comments
* consume the whole block weight
* fix assertions
* license header
* fix interface
Co-authored-by: parity-processbot <>
Co-authored-by: parity-processbot <>
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
* Fix test
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Fix multisig benchmarks
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* ".git/.scripts/bench-bot.sh" pallet dev pallet_democracy
* ".git/.scripts/bench-bot.sh" pallet dev pallet_scheduler
* ".git/.scripts/bench-bot.sh" pallet dev pallet_preimage
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: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>