cheme
4c651637f2
Inner hashing of value in state trie (runtime versioning). ( #9732 )
...
* starting
* Updated from other branch.
* setting flag
* flag in storage struct
* fix flagging to access and insert.
* added todo to fix
* also missing serialize meta to storage proof
* extract meta.
* Isolate old trie layout.
* failing test that requires storing in meta when old hash scheme is used.
* old hash compatibility
* Db migrate.
* runing tests with both states when interesting.
* fix chain spec test with serde default.
* export state (missing trie function).
* Pending using new branch, lacking genericity on layout resolution.
* extract and set global meta
* Update to branch 4
* fix iterator with root flag (no longer insert node).
* fix trie root hashing of root
* complete basic backend.
* Remove old_hash meta from proof that do not use inner_hashing.
* fix trie test for empty (force layout on empty deltas).
* Root update fix.
* debug on meta
* Use trie key iteration that do not include value in proofs.
* switch default test ext to use inner hash.
* small integration test, and fix tx cache mgmt in ext.
test failing
* Proof scenario at state-machine level.
* trace for db upgrade
* try different param
* act more like iter_from.
* Bigger batches.
* Update trie dependency.
* drafting codec changes and refact
* before removing unused branch no value alt hashing.
more work todo rename all flag var to alt_hash, and remove extrinsic
replace by storage query at every storage_root call.
* alt hashing only for branch with value.
* fix trie tests
* Hash of value include the encoded size.
* removing fields(broken)
* fix trie_stream to also include value length in inner hash.
* triedbmut only using alt type if inner hashing.
* trie_stream to also only use alt hashing type when actually alt hashing.
* Refactor meta state, logic should work with change of trie treshold.
* Remove NoMeta variant.
* Remove state_hashed trigger specific functions.
* pending switching to using threshold, new storage root api does not
make much sense.
* refactoring to use state from backend (not possible payload changes).
* Applying from previous state
* Remove default from storage, genesis need a special build.
* rem empty space
* Catch problem: when using triedb with default: we should not revert
nodes: otherwhise thing as trie codec cannot decode-encode without
changing state.
* fix compilation
* Right logic to avoid switch on reencode when default layout.
* Clean up some todos
* remove trie meta from root upstream
* update upstream and fix benches.
* split some long lines.
* UPdate trie crate to work with new design.
* Finish update to refactored upstream.
* update to latest triedb changes.
* Clean up.
* fix executor test.
* rust fmt from master.
* rust format.
* rustfmt
* fix
* start host function driven versioning
* update state-machine part
* still need access to state version from runtime
* state hash in mem: wrong
* direction likely correct, but passing call to code exec for genesis
init seem awkward.
* state version serialize in runtime, wrong approach, just initialize it
with no threshold for core api < 4 seems more proper.
* stateversion from runtime version (core api >= 4).
* update trie, fix tests
* unused import
* clean some TODOs
* Require RuntimeVersionOf for executor
* use RuntimeVersionOf to resolve genesis state version.
* update runtime version test
* fix state-machine tests
* TODO
* Use runtime version from storage wasm with fast sync.
* rustfmt
* fmt
* fix test
* revert useless changes.
* clean some unused changes
* fmt
* removing useless trait function.
* remove remaining reference to state_hash
* fix some imports
* Follow chain state version management.
* trie update, fix and constant threshold for trie layouts.
* update deps
* Update to latest trie pr changes.
* fix benches
* Verify proof requires right layout.
* update trie_root
* Update trie deps to latest
* Update to latest trie versioning
* Removing patch
* update lock
* extrinsic for sc-service-test using layout v0.
* Adding RuntimeVersionOf to CallExecutor works.
* fmt
* error when resolving version and no wasm in storage.
* use existing utils to instantiate runtime code.
* Patch to delay runtime switch.
* Revert "Patch to delay runtime switch."
This reverts commit 67e55fee468f1a0cda853f5362b22e0d775786da.
* useless closure
* remove remaining state_hash variables.
* Remove outdated comment
* useless inner hash
* fmt
* fmt and opt-in feature to apply state change.
* feature gate core version, use new test feature for node and test node
* Use a 'State' api version instead of Core one.
* fix merge of test function
* use blake macro.
* Fix state api (require declaring the api in runtime).
* Opt out feature, fix macro for io to select a given version
instead of latest.
* run test nodes on new state.
* fix
* Apply review change (docs and error).
* fmt
* use explicit runtime_interface in doc test
* fix ui test
* fix doc test
* fmt
* use default for path and specname when resolving version.
* small review related changes.
* doc value size requirement.
* rename old_state feature
* Remove macro changes
* feature rename
* state version as host function parameter
* remove flag for client api
* fix tests
* switch storage chain proof to V1
* host functions, pass by state version enum
* use WrappedRuntimeCode
* start
* state_version in runtime version
* rust fmt
* Update storage proof of max size.
* fix runtime version rpc test
* right intent of convert from compat
* fix doc test
* fix doc test
* split proof
* decode without replay, and remove some reexports.
* Decode with compatibility by default.
* switch state_version to u8. And remove RuntimeVersionBasis.
* test
* use api when reading embedded version
* fix decode with apis
* extract core version instead
* test fix
* unused import
* review changes.
Co-authored-by: kianenigma <kian@parity.io >
2021-12-24 08:54:07 +00:00
dharjeezy
1b0be8ae06
Replace parameter_types with ConstU32 &c. ( #10402 )
...
* remove parameter types and use const type
* remove parameter types and use const type
* Delete {
* Delete count,
* refractor for beefy, benchmarking, child bounties, and collective pallets
* refractor for pallet contracts
* refractor for elections
* refractor for more pallets
* fix CI issues
* fix CI issues
* fix CI issues
* fix CI issues
* remove warning to fix CI issue
* remove warning to fix CI issue
refractor for pallet preimage
* remove warning to fix CI issue
refractor for pallet proxy
* remove warning to fix CI issue
refractor for pallet recovery
refractor for pallet randomness-collective-flip
* remove warning to fix CI issue
refractor for pallet scored-pool
refractor for pallet scheduler
refractor for pallet session
* remove warning to fix CI issue
refractor for pallet society, support, system, timestamp, tips
* remove warning to fix CI issue
refractor for pallet transaction_payment, transaction_storage, treasury, uniques, utility
* remove warning to fix CI issue
* cargo +nightly fmt
* CI fix
* more param refractor on beefy-mmr
* refractor for beefy
* Update frame/babe/src/mock.rs
* Update frame/babe/src/mock.rs
* Update frame/bounties/src/tests.rs
* Update frame/tips/src/tests.rs
* Delete mock.rs
* Update frame/examples/basic/src/tests.rs
* Apply suggestions from code review
* Update frame/im-online/src/mock.rs
* Update frame/im-online/src/mock.rs
* Update frame/offences/benchmarking/src/mock.rs
* Update frame/session/benchmarking/src/mock.rs
* Update frame/support/test/tests/pallet_compatibility.rs
* Update frame/support/test/tests/pallet_compatibility_instance.rs
* Update frame/treasury/src/tests.rs
* Update test-utils/runtime/src/lib.rs
* some cleanup
* fmt
* remove unused
Co-authored-by: Damilare <dakinlose@teamapt.com >
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
2021-12-16 03:06:11 +00:00
Gavin Wood
3dd8f83a3a
Insufficient asset quota and deposits ( #10382 )
...
* Allow asset accounts to exist by deposit
* Place limit on consumers (and therefore freebie asset accounts)
* Maximum number of assets
* Fixes
* Fixes
* Formatting
* Docs
* Formatting
* Destroyed assets are properly tidied
* Update frame/assets/src/types.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Docs
* Docs
* Formatting
* Docs
* Docs
* Fixes
* Fixes
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
2021-12-09 13:22:54 +01:00
Guillaume Thiolliere
db28ba9dfd
Fix order of hook execution ( #10043 )
...
* fix order
* Update frame/support/procedural/src/construct_runtime/mod.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* format
* more accurate description
* format
* better explicit types
* fix tests
* address feedback
* add a type to ease non breaking implementation
* add comment about constraint
* fix test
* add test for generated types
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
2021-12-01 00:59:09 +00:00
Dan Shields
acc835acd3
Update node-template construct_runtime! syntax ( #10155 )
...
* update `construct_runtime!` syntax
* fix build
2021-11-04 13:37:26 +00:00
Shawn Tabrizi
2d556c4429
Add Baseline FRAME Benchmarks ( #9691 )
...
* create and add baseline
* fix import
* try a different name
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* increase repeats
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Update baseline.rs
* Update baseline.rs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* improve hash benchmark
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
Co-authored-by: Parity Bot <admin@parity.io >
2021-10-30 13:02:09 +00:00
Dan Shields
aad0682c45
Move template to homepage = " https://substrate.io/ " , correct links ( #10006 )
...
* move to https://docs.substrate.io/
* cargo to https://docs.substrate.io/ homepage
* Update bin/node-template/pallets/template/src/lib.rs
Co-authored-by: Squirrel <gilescope@gmail.com >
* homepage = "https://docs.substrate.io/ "
Co-authored-by: Squirrel <gilescope@gmail.com >
2021-10-13 12:55:51 -06:00
Shawn Tabrizi
2272a0ed25
Remove incorrect sanity check ( #9924 )
...
* causes issue
* remove the bad error check
2021-10-04 22:19:21 +00:00
Tomasz Drwięga
374fb6a921
Rework Transaction Priority calculation ( #9834 )
...
* Add transaction validity docs.
* Re-work priority calculation.
* Fix tests.
* Update frame/transaction-payment/src/lib.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* cargo +nightly fmt --all
* Fix an obvious mistake :)
* Re-work again.
* Fix test.
* cargo +nightly fmt --all
* Make VirtualTip dependent on the transaction size.
* cargo +nightly fmt --all
* Update frame/transaction-payment/src/lib.rs
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
* Fix compilation.
* Update bin/node/runtime/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2021-10-04 14:25:18 +00:00
Georges
0fcc2ef68c
Adding storage_info to pallet grandpa ( #9817 )
...
Converting some `Vec` to `WeakBoundedVec`
Adding `MaxAuthorities` type to bound the `WeakBoundedVec`
Co-authored-by: thiolliere <gui.thiolliere@gmail.com >
2021-09-22 09:42:57 +00:00
Andrew Jones
49b6dfd2e5
Enrich metadata with type information ( #8615 )
...
* Cargo.lock after merge
* Restore scale-info feature
* Fully qualify TypeInfo derive
* Skip PendingSwap T
* Add missing skip_type_params attr
* metadata docs features
* Reduce pallet event attribute to struct
* Cargo.lock
* Update frame/balances/src/tests_composite.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Line widths check
* Cargo.lock
* Add scale-info/std
* Update frame/system/src/lib.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Use `skip_type_params` to remove `TypeInfo` requirements on checks
* Revert "Remove unused Call metadata stuff"
This reverts commit 41311f85
* Skip BalanceSwapAction type parameter
* Remove unused event metadata macro
* Update frame-metadata
* Update primitives/npos-elections/compact/src/codec.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Manual TypeInfo for Header
* Remove TypeInfo requirement for consts in BoundedVec etc.
* Another TypeInfo bound removed
* review: fix indentation
* TypeInfo impls for Identity types
* Add some todos to add custom TypeInfo impls
* Update frame/support/procedural/src/pallet/expand/pallet_struct.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Add some todos to add custom TypeInfo impls
* Add a test for manual Data TypeInfo impl
* Add custom TypeInfo impl for Vote
* Era custom TypeInfo crimes
* Revert finality-grandpa version to 0.14.z
* review: renamed module to pallet_constants_metadata
* New line at end of file
* Add missing scale-info/std
* Update frame/support/src/storage/types/mod.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Remove StorageEntryType::Map unused flag
* Add missing scale-info dependency after merge
* SignedExtension::AdditionalSigned metadata
* Update frame-metadata, use abbreviated docs and args fields
* Update frame/example/Cargo.toml
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
* Add scale_info/std and remove unused scale-info dependency
* Remove scale-info dependency
* Remove treasury pallet::metadata
* Remove redundant Event test
* Add back scale-info as dev dependency
* fix error metadata when no error defined in decl_module
* Add Module3 to tests
* Fix metadata test
* Add docs feature to frame-support test
* WIP fixing pallet metadata test
* Remove redundant FunctionMetadata, FunctionArgumentMetadata as per https://github.com/paritytech/frame-metadata/pull/20
* Use main branch of frame-metadata
* Use patch of scale-info for latest changes
* Use latest patched scale-info
* Manual TypeInfo for DigestItem
* Manual TypeInfo for DigestItem
* Update scale-info
* Skip __Ignore variants for Error, depends on https://github.com/paritytech/scale-info/pull/117
* Named fields for FRAME v2 pallet Call variants
* Named fields for FRAME v1 pallet Call variants
* Add missing scale-info dependency
* WIP expand benchmark call variant
* fix benchmark with new function
create a new function for each variant of a pallet call.
This function is called by benchmarking macro in order not to break call
creation with unnamed argument
* fix tests
* more fix
* Fix staking tests
* Fix offchain workers calls
* Cherry pick rustfmt.toml from master
* cargo +nightly-2021-06-22 fmt --all
* Update to new call variant structs
* More call variant struct updates
* Remove unused import
* More call variant structs
* More call variant structs
* Even more call variant structs
* Mooar variant structs
* Evermore variant structs
* Call variant structs ad infinitum
* Fmt
* More call variants
* Last call variant
* Call variants all done?
* Fix SS58Prefix type
* Potential workaround for BitFlags<IdentityFields> TypeInfo
* Enable docs capturing for Call, Event, and Error types
* Fix IdentityFields TypeInfo
* Remove metadata-docs feature
* Add capture_docs = true for legacy Call, Event and Error types
* Fmt
* Fix metadata test type
* Update benchmarks with call struct variants
* Fmt
* More test fixes
* Fmt
* Fix benches
* Use latest capture_docs attr
* Latest scale_info
* Fmt
* review: change &Vec to &[]
* Remove pallet metadata attr
* review: remove commented out test code
* review: skip_type_params trailing comma suggestion
* Update to scale-info 0.10.0
* Update construct_runtime ui tests, different because of metadata TypeInfo impls
* Add some TypeInfo derives for UI tests
* Update storage ensure span ui stderrs
* Update call argument bound ui tests
Possibly changed because change from tuple to struct variants?
* Add scale-info dev dependency
* Update to latest finality-grandpa release
* review: missing newline
* review: missing scale-info/std
* review: remove duplicate scale-info/std
* review: remove fully qualified TypeInfo
* review: add missing scale-info/std
* review: remove unnecessary imports.
* Fmt
* Use crates.io RC version of frame-metadata
* Remove scale-info/std because it is a dev dependency
* Add missing scale_info dev-dependency for test
* Delete empty metadata folder
* Fix sp_std import
* review: improve manual UncheckedExtrinsic TypeInfo impl
* review: use full scale-info for dev-dependency
* Remove DefaultByteGetter impl
* review: derive TypeInfo for generic header
* Fmt
* Update primitives/runtime/src/generic/unchecked_extrinsic.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
* Update primitives/runtime/src/generic/unchecked_extrinsic.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
* Update bin/node/executor/Cargo.toml
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update frame/identity/src/types.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update frame/support/src/dispatch.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Remove redundant derive
* Simplify scale-info dependency
* Strip underscore prefix from call variant struct names
* Another underscore field
* More underscore fields
* Another underscore field
* Update to frame-metadata 14.0.0-rc.2 with combined StorageEntryType::Map
* Fmt
* Revert weights formatting
* Fix up some tests
* Fix up some tests for StorageEntryTypeMetadata
* scale-info dev dependency
* Fix test error
* Add missing TypeInfo derives
* Add back missing scale-info dependency
* Add back missing scale-info dependency
* Fix npos compact impls
* Cargo.lock
* Fmt
* Fix errors
* Fmt
* Fix renamed raw_solution field
* Fix error
* Fmt
* Fix some benchmarks
* Fmt
* Stray R
* Fix
* Add missing TypeInfos
* ui test fix
* Fix line widths
* Revert "ui test fix"
This reverts commit 2d15ec058a216e3f92d713f1174603a2bb1eac65.
* Upgrade to scale-info 0.11.0
* Revert "Upgrade to scale-info 0.11.0"
This reverts commit 047bb179085a0059c36cd20ab405f55cf0867e28.
* Add Runtime type
* Update to scale-info 0.12
* Update to scale-info 1.0
* Update frame-metadata to version 14.0.0
* Patch finality-grandpa until release available
* Fix metadata tests
* Fix metadata tests
* Fmt
* Remove patched finality-grandpa
* Fix tests, use scale_info imports
* Fix pallet tests
* Add BlockNumber TypeInfo bound
* ui test fix
* Cargo.lock
* Remove pallet metadata
* Cargo.lock
* Add missing scale-info dependency
* Remove pallet event metadata
* Fix error
* Fix collective errors
* Semicolol
* Fmt
* Remove another metadata attribute
* Add new variant to custom digest TypeInfo
* Fmt
* Cargo.lock from master
* Remove comma lol
* Fix example call error
* Fix example call error properly
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2021-09-15 11:40:41 +00:00
Keith Yeung
886825a5c0
Generate storage info for aura pallet ( #9371 )
...
* Generate storage info for aura pallet
* Add MaxAuthorities to node-template aura pallet config
* Fix compilation errors on node-template
* Use WeakBoundedVec instead of BoundedVec
* Improve comment on BoundedSlice's EncodeLike impl
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Bump MaxAuthorities count to 32 for node template
* cargo fmt
* cargo fmt
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2021-09-02 01:24:08 +00:00
Gavin Wood
bdda3ed612
Remove Filter and use Contains instead ( #9514 )
...
* Remove Filter and use Contains instead
* Fixes
* Formatting
* Update docs/Upgrading-2.0-to-3.0.md
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Typo
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2021-08-07 19:26:40 +00:00
André Silva
0240efde58
aura, babe: don't allow disabled validators to build blocks ( #9414 )
...
* frame-support: add trait for checking disabled validators
* pallet-session: implement DisabledValidators trait
* pallet-babe: check for disabled validators
* pallet-babe: add test for disabled validators
* pallet-aura: check for disabled validators
* pallet-aura: add test for disabled validators
* runtime: fix missing DisableValidator
* test-runtime: add missing DisabledValidators
* frame-support: clean up doc
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2021-08-03 10:57:08 +00:00
Arkadiy Paronyan
f56232602f
Warp sync part I ( #9227 )
...
* Started warp sync
* BABE & GRANDPA recovery
* Warp sync protocol
* Sync warp proofs first
* Added basic documentation
* Apply suggestions from code review
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
* Style changes
* Apply suggestions from code review
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
* fmt
* Apply suggestions from code review
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
* Fixed chage trie pruning wrt missing blocks
* Restore parent finalization
* fmt
* fmt
* Revert pwasm-utils bump
* Change error type & check API version
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Build fix
* Fixed target block check
* Formatting
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2021-08-02 08:27:18 +00:00
Shawn Tabrizi
fa8c6274ac
Refactor Benchmarks for Less Wasm Memory Usage ( #9373 )
...
* extract repeat out of benchmark
* remove r
* unused
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* use linked map to keep order
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Delete pallet_balances.rs
* Delete out
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* steps and repeat to tuple (current_*, total_*)
* idea for list command
* fmt
* use benchmark list in cli
* handle steps in cli
* move log update to cli
* fmt
* remove old todo
* line width
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* benchmark metadata function
* don't need this warm up
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* fix warnings
* fix node-template
* fix
* fmt
* line width
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* improve docs
* improve cli
* fix format
* fix bug?
* Revert "fix bug?"
This reverts commit 8051bf1bf9bae862ff28dfff386e7045cd3f045e.
* skip frame-metadata
* extract repeat out of benchmark
* remove r
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* use linked map to keep order
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Delete pallet_balances.rs
* Delete out
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* steps and repeat to tuple (current_*, total_*)
* idea for list command
* fmt
* use benchmark list in cli
* handle steps in cli
* move log update to cli
* remove old todo
* line width
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* benchmark metadata function
* don't need this warm up
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* fix warnings
* fix node-template
* fix
* fmt
* line width
* cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* improve docs
* improve cli
* fix format
* fix bug?
* Revert "fix bug?"
This reverts commit 8051bf1bf9bae862ff28dfff386e7045cd3f045e.
* skip frame-metadata
* Update .gitlab-ci.yml
* fix import
* Update .gitlab-ci.yml
Co-authored-by: Parity Benchmarking Bot <admin@parity.io >
2021-08-01 18:13:58 +00:00
Bastian Köcher
7b56ab15b4
Run cargo fmt on the whole code base ( #9394 )
...
* Run cargo fmt on the whole code base
* Second run
* Add CI check
* Fix compilation
* More unnecessary braces
* Handle weights
* Use --all
* Use correct attributes...
* Fix UI tests
* AHHHHHHHHH
* 🤦
* Docs
* Fix compilation
* 🤷
* Please stop
* 🤦 x 2
* More
* make rustfmt.toml consistent with polkadot
Co-authored-by: André Silva <andrerfosilva@gmail.com >
2021-07-21 14:32:32 +00:00
Alexander Theißen
e01ac8cea0
contracts: Allow contracts to dispatch calls into the runtime ( #9276 )
...
* contracts: Allow contracts to dispatch calls into the runtime
* Fix RPC tests
* Fix typo
* Replace () by AllowAllFilter and DenyAllFilter
* Add rust doc
* Fixup for `()` removal
* Fix lowest gas calculation
* Rename AllowAllFilter and DenyAllFilter
* Updated changelog
2021-07-12 20:40:27 +00:00
Shawn Tabrizi
b42b8fc5fb
Include StorageInfo in Benchmarking Pipeline ( #9090 )
...
* extend storageinfo
* extend_storage_info
* use vec
* add storage info to pipeline
* get read and written keys
* undo storageinfo move
* refactor keytracker
* return read / write count
* playing with key matching
* add basic `StorageInfo` constructor
* add whitelisted to returned info
* fix some test stuff
* pipe comments into benchmark data
* add_storage_comments
* add comments to template
* track only storage prefix
* Update frame/benchmarking/src/lib.rs
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* fix test
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* remove test logs
* add temp benchmark script
* Apply suggestions from code review
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* remove keytracker and use trackedstoragekey
* add comment for unknown keys
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_timestamp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/timestamp/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* remove duplicate comments with unknown keys
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_timestamp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/timestamp/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* refactor bench tracker, and fix results
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* fix child tries in new tracker
* extra newline
* fix unused warning
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_timestamp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/timestamp/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* fix master merge
* storage info usage refactor
* remove now unused
* fix refactor
* use a vec for prefix
* fix tests
* also update writer to use vec
* disable read and written keys for now
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_system --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/system/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* Update frame/system/src/weights.rs
* fix test
* Delete weights.rs
* reset weights
Co-authored-by: Parity Bot <admin@parity.io >
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
2021-07-07 22:06:06 +00:00
Bastian Köcher
d489bd70b5
Do not call initialize_block before any runtime api ( #8953 )
...
* Do not call `initialize_block` before any runtime api
Before this change we always called `initialize_block` before calling
into the runtime. There was already support with `skip_initialize` to skip
the initialization. Almost no runtime_api requires that
`initialize_block` is called before. Actually this only leads to higher
execution times most of the time, because all runtime modules are
initialized and this is especially expensive when the block contained a
runtime upgrade.
TLDR: Do not call `initialize_block` before calling a runtime api.
* Change `validate_transaction` interface
* Fix rpc test
* Fixes and comments
* Some docs
2021-07-01 15:50:42 +00:00
Disconnect3d
0846cf5d27
node-template: remove redundant types from runtime ( #9161 )
...
Removes `BlockId`, `SignedBlock` and `CheckedExtrinsic` as they are
unused within the runtime currently and the `BlockId` was defined twice.
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
2021-06-23 09:31:35 +00:00
Shawn Tabrizi
67e0c7b545
Remove Unused AccountIndex ( #9149 )
...
* remove unused `AccountIndex`
* Update lib.rs
2021-06-23 10:29:30 +02:00
Keith Yeung
58e837fcd3
Emit error when construct_runtime imports a non-existent pallet part ( #8949 )
...
* Emit error when construct_runtime imports a non-existent Call part
* Reword and display pallet name when emitting part not found error
* Migrate decl_outer_dispatch to a proc macro
* Rename calls.rs to call.rs
* Create new construct_runtime_v2 macro
* Add UI test for importing non-existent call part in construct_runtime
* Emit error when construct_runtime imports a non-existent Config part
* Emit error when construct_runtime imports a non-existent Event part
* Migrate decl_outer_inherent to a proc macro
* Emit error when construct_runtime imports a non-existent Inherent part
* Migrate decl_outer_validate_unsigned to a proc macro
* Emit error when construct_runtime imports a non-existent ValidateUnsigned part
* impl for old macro
* fix line width
* add doc
* hide macroes and use unique counter everywhere
* Remove construct_runtime_v2
* Encapsulate pallet part check macros in a module
* Fix macro definitions in dummy part checker
* Tag ProvideInherent impl with #[pallet::inherent] properly for authorship pallet
* Remove Call part from pallets that do not define it
* Add Call part unit tests
* Remove undefined Call part import from offences pallet
* Add tests for expand_outer_inherent
* Remove Call part from pallets that do not define them
* Remove Call part imports from pallets that do not have it defined
* Remove Call part import of the offences pallet from grandpa pallet mocks
* Update frame/support/test/tests/pallet.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Remove Call part imports for pallets that do not define them
* Move inherent tests to inherent_expand
* Add unit tests for expand_outer_validate_unsigned
* Add newline at the end of file
* fix ui test
* Small prayer to RNGsus for fixing CI
* Remove Call part from construct_runtime for randomness collective flip pallet
* Remove Call part import for randomness collective flip pallet
* Summon Laplace's demon instead of praying to RNGsus
* Update test expectations
* fix ui test and make sure it's flaky
* Revert "fix ui test and make sure it's flaky"
This reverts commit 362b6881389c911ef8d9ef85d71c9463f5694b20.
* Comment out test instead of putting it in conditional compilation
* Update UI test expectations
* Update UI test expectations
* Emit error when construct_runtime imports a non-existent Origin part
Co-authored-by: thiolliere <gui.thiolliere@gmail.com >
Co-authored-by: Denis P <denis.pisarev@parity.io >
2021-06-16 03:44:22 +00:00
Qinxuan Chen
6b33a79831
Migrate pallet-randomness-collective-flip to pallet attribute macro ( #9061 )
...
* migrate pallet-randomness-collective-flip to pallet attribute macro
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* fix some nits
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* remove some spacing things
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* remove space
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* use tabs
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
2021-06-14 11:00:32 +00:00
Xiliang Chen
223529e4dd
Named reserve ( #7778 )
...
* add NamedReservableCurrency
* move currency related trait and types into a new file
* implement NamedReservableCurrency
* remove empty reserves
* Update frame/support/src/traits.rs
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* fix build
* bump year
* add MaxReserves
* repatriate_reserved_named should put reserved fund into named reserved
* add tests
* add some docs
* fix warning
* Update lib.rs
* fix test
* fix test
* fix
* fix
* triggier CI
* Move NamedReservableCurrency.
* Use strongly bounded vec for reserves.
* Fix test.
* remove duplicated file
* trigger CI
* Make `ReserveIdentifier` assosicated type
* add helpers
* make ReserveIdentifier assosicated type
* fix
* update
* trigger CI
* Apply suggestions from code review
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
* trigger CI
* Apply suggestions from code review
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Gavin Wood <i@gavwood.com >
Co-authored-by: Shaun Wang <spxwang@gmail.com >
2021-06-04 09:32:46 +02:00
Sergei Shulepov
0849bcce0e
Embed runtime version as a custom section ( #8688 )
...
* emit a custom section from impl_runtime_apis!
This change emits a custom section from the impl_runtime_apis! proc macro.
Each implemented API will result to emitting a link section `runtime_apis`.
During linking all sections with this name will be concatenated and
placed into the final wasm binary under the same name.
* Introduce `runtime_version` proc macro
This macro takes an existing `RuntimeVersion` const declaration, parses
it and emits the version information in form of a linking section.
Ultimately such a linking section will result into a custom wasm
section.
* Parse custom wasm section for runtime version
* Apply suggestions from code review
Co-authored-by: David <dvdplm@gmail.com >
* Fix sc-executor integration tests
* Nits
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Refactor apis section deserialization
* Fix version decoding
* Reuse uncompressed value for CallInWasm
* Log on decompression error
* Simplify if
* Reexport proc-macro from sp_version
* Merge ReadRuntimeVersionExt
* Export `read_embedded_version`
* Fix test
* Simplify searching for custom section
Co-authored-by: David <dvdplm@gmail.com >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2021-05-12 13:39:08 +00:00
André Silva
122cb6038a
primitives: remove random_seed from BlockBuilder API ( #8718 )
...
* primitives: remove random_seed from BlockBuilderApi
* node: remove random_seed
* primitives: bump BlockBuilderApi version
* client: rpc: fix test
2021-05-04 09:29:44 +00:00
Alexander Popiak
bf8a1d8a1a
add more notes on changing epoch duration ( #8491 )
...
* add more notes on changing epoch duration
* add note about changing slot duration
2021-04-06 12:09:04 +02:00
Gavin Wood
643d2b669f
Introduce OnSetCode type into system config trait. ( #8496 )
...
* Introduce OnSetCode type into system config trait.
* Docs.
* Fixes
* Fixes
2021-04-01 12:20:24 +00:00
Jimmy Chu
fb73a4eef6
Enhancement on Substrate Node Template ( #8473 )
...
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Alexander Popiak <alexander.popiak@parity.io >
2021-03-30 07:47:37 +08:00
Shaun Wang
2e5522444a
Replace 'Module' with 'Pallet' in construct_runtime macro ( #8372 )
...
* Use 'Pallet' struct in construct_runtime.
* Fix genesis and metadata macro.
* Fix 'Pallet' type alias.
* Replace 'Module' with 'Pallet' for all construct_runtime use cases.
* Replace more deprecated 'Module' struct.
* Bring back AllModules and AllPalletsWithSystem type, but deprecate them.
* Replace deprecated 'Module' struct from merge master.
* Minor fix.
* Fix UI tests.
* Revert UI override in derive_no_bound.
* Fix more deprecated 'Module' use from master branch.
* Fix more deprecated 'Module' use from master branch.
2021-03-18 08:50:08 +00:00
Bastian Köcher
15e15e7d8e
Aura and Slots refactoring ( #8386 )
...
* Make slot duration being exposed as `Duration` to the outside
* Some slot info love
* Add `build_aura_worker` utility function
* Copy copy copy
2021-03-17 23:25:58 +00:00
Robert Habermeier
e2960c383e
more clear randomness API for BABE ( #8180 )
...
* more clear randomness API for BABE
* babe: move randomness utilities to its own file
* node: use babe::RandomnessFromOneEpochAgo in random_seed implementation
* frame-support: annotate randomness trait with block number
* pallet-randomness-collective-flip: fix for new randomness trait
* pallet-society: fix randomness usage
* pallet-lottery: fix randomness usage
* pallet-contracts: fix randomness usage
* pallet-babe: fix randomness usage
we need to track when the current and previous epoch started so that we
know the block number by each existing on-chain was known
* node: fix random_seed
* node-template: fix random_seed
* frame-support: extend docs
* babe: add test for epoch starting block number tracking
* babe: fix epoch randomness docs
* frame: add todos for dealing with randomness api changes
Co-authored-by: André Silva <andrerfosilva@gmail.com >
2021-03-10 16:31:49 +00:00
Bastian Köcher
4de4662480
Make ExecuteBlock::execute_block return the final block header ( #8244 )
...
This pr changes the `ExecuteBlock` trait to return the final header that
results from executing the given block.
2021-03-03 08:44:34 +00:00
Shawn Tabrizi
62ef739faf
Add benchmark to node-template pallet-template ( #8239 )
...
* Add benchmark to node-template pallet-template
* export sp_std to avoid missing dep when using macro
* fix more `sp_std` deps
* remove unused
* Update bin/node-template/pallets/template/src/benchmarking.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update bin/node-template/pallets/template/Cargo.toml
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
2021-03-02 18:23:07 +01:00
Bastian Köcher
5569313bd6
AURA: Switch to CurrentSlot instead of LastTimestamp ( #8023 )
...
* Convert AURA to new pallet macro
* AURA: Switch to `CurrentSlot` instead of `LastTimestamp`
This switches AURA to use `CurrentSlot` instead of `LastTimestamp`.
* Add missing file
* Update frame/aura/src/migrations.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
* Remove the runtime side provide inherent code
* Use correct weight
* Add TODO
* Remove the Inherent from AURA
* 🤦
* Remove unused stuff
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
2021-02-03 13:47:13 +01:00
Liu-Cheng Xu
65569620c2
Add payment_queryFeeDetails RPC ( #7692 )
...
* Return FeeDetails in compute_fee_raw()
* Add payment_queryDetails rpc
* Simplify serde attribute a bit
* Fix line width check
* Use saturating_add()
* Move transaction payment rpc types to types.rs
* Add file header
* Fix test
* Update Cargo.lock
* Nit
* Apply the review suggestions
* .
* .
* Fix serde
* Fix rust doc
* .
* Update frame/transaction-payment/src/types.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Use NumberOrHex in fee details RPC
* Address review feedback
* Nits
* Update some docs
* Address review
* Update frame/transaction-payment/src/types.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Happy 2021
* Nit
* Address code review
* Remove needless bound
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
2021-01-14 11:43:53 +00:00
Alexander Theißen
ec2c70396e
Define ss58 prefix inside the runtime ( #7810 )
...
* Add SS58Prefix type to the frame_system config trait
* Remove unused chain_id runtime interface
2020-12-30 22:07:37 +00:00
Tomasz Drwięga
39a776cd00
Streamline frame_system weight parametrization ( #6629 )
...
* Basic weights builder.
* Fixing WiP
* Make the tests work.
* Fix weights in node/runtime.
* WiP.
* Update pallets with new weights parameters.
* Validate returns a Result now.
* Count mandatory weight separately.
* DRY
* BREAKING: Updating state root, because of the left-over weight-tracking stuff
* Update tests affected by Mandatory tracking.
* Fixing tests.
* Fix defaults for simple_max
* Update frame/system/src/weights.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Rework the API a bit.
* Fix compilation & tests.
* Apply suggestions from code review
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Add extra docs & rename few things.
* Fix whitespace in ASCII art.
* Update frame/system/src/limits.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Fix max_extrinsic calculations.
* Fix conflicts.
* Fix compilation.
* Fix new code.
* re-remove generic asset
* Fix usage.
* Update state root.
* Update proxy.
* Fix tests.
* Move weights validity to integrity_test
* Remove redundant BlockWeights.
* Add all/non_mandatory comment
* Add test.
* Remove fn block_weights
* Make the macro prettier.
* Fix some docs.
* Make max_total behave more predictabily.
* Add BlockWeights to metadata.
* fix balances test
* Fix utility test.
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org >
Co-authored-by: thiolliere <gui.thiolliere@gmail.com >
2020-12-08 13:18:34 +01:00
Guillaume Thiolliere
1cbfc9257f
Rename pallet trait Trait to Config ( #7599 )
...
* rename Trait to Config
* add test asserting using Trait is still valid.
* fix ui tests
2020-11-30 14:34:54 +00:00
Shawn Tabrizi
4637100ac7
More Extensible Multiaddress Format ( #7380 )
...
* More extensible multiaddress format
* update name
* Don't depend on indices to define multiaddress type
* Use MultiAddress in Node Template too!
* reduce traits, fix build
* support multiple `StaticLookup`
* bump tx version
* feedback
2020-11-19 11:40:12 +00:00
Alexander Popiak
2ae6ab0e7e
Update MILLISECS_PER_BLOCK comments ( #7483 )
...
* add doc comment to node template MILLISECS_PER_BLOCK
* add broken link comment
* update Babe block time link
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
2020-11-03 14:01:18 +01:00
Albrecht
b7205d4ae0
decouple transaction payment and currency ( #6912 )
...
* wip: setup types
* fix types
* make tx payment pallet independent from balances
* fix dependent tests
* comments
* restructure a bit and include more info
* clean up ugly phantom
* reduce complexity
* minor doc improvements
* use shorthand
* doc
* fix line lenght and style
* readd BalanceOf
* some clarifications and readability improvements
* move balance type to OnChargeTransaction
* remove noise
* fix style
* Apply suggestions from code review
improved documentation
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Improve naming and documentation
Apply suggestions from code review
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Apply suggestions from code review
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* always call withdraw_fee
* move NegativeImbalanceOf to payment module
* fix unused import
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
2020-10-30 12:27:04 +00:00
Shawn Tabrizi
e4cfb2556d
New Weight Template + Organization ( #7391 )
...
* add_handlebar_template_to_benchmark
- add benchmark-cli arg to take in a handlebar-template file
* update to always use template
* rewrite writer for handlebars
* polish
* pass cmd data
* update docs
* new weight layout
* separate templates
* support custom filename output
* Update command.rs
* Create frame-weight-template.hbs
* use a vector to maintain benchmark order
* bring back ()
* fix tests
* fix build
* Custom string serializer, remove feature flag
* temp
* rename
* nit
* update docs
* docs on public objects
* small fix
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* remove long line
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_system --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/system/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for system
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for staking
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_identity --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/identity/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for identity and staking
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_collective --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/collective/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for collective
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_democracy --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/democracy/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for democracy
* clean up zeros
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_elections_phragmen --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/elections-phragmen/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for elections phragmen
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_im_online --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/im-online/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for im online
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_indices --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/indices/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for indices
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_multisig --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/multisig/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for multisig
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_proxy --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/proxy/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for proxy
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_scheduler --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/scheduler/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for scheduler
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_session --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/session/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for session
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_timestamp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/timestamp/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for timestamp
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_treasury --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/treasury/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for treasury
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_utility --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/utility/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for utility
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_vesting --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/vesting/src/weights.rs --template=./.maintain/frame-weight-template.hbs
* update for vesting
* temp update
* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_utility --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/utility/src/weights.rs --template=./.maintain/frame-weight-template.hbs
Co-authored-by: Ezadkiel Marbella <zadkiel.m@gmail.com >
Co-authored-by: Parity Benchmarking Bot <admin@parity.io >
2020-10-27 20:26:12 +00:00
Bastian Köcher
86594727d9
Rename ModuleToIndex to PalletRuntimeSetup ( #7148 )
...
* Rename `ModuleToIndex` to `PalletRuntimeSetup`
Besides the renaming it also adds support getting the name of a pallet
as configured in the runtime.
* Rename it to `PalletInfo`
* Remove accidentally added files
2020-09-22 13:39:56 +00:00
Shawn Tabrizi
42a4c2eef0
Add WeightInfo to Babe and Grandpa Pallet ( #7155 )
...
* Add `WeightInfo` to Babe Pallet
* Also grandpa
* Update frame/grandpa/src/default_weights.rs
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com >
2020-09-21 13:31:44 +00:00
Shawn Tabrizi
ab97e94972
Add benchmarking pipeline to node-template ( #7122 )
2020-09-17 10:09:59 +02:00
Shawn Tabrizi
9aa8698cfc
WeightInfo for Vesting Pallet ( #7103 )
...
* WeightInfo for Vesting Pallet
* clean up weight docs
* Update lib.rs
* try to pipe max locks
* Update for new type
* add warning when locks > MaxLocks
* Update lib.rs
* fix compile
* remove aliasing, fix trait def
* Update
2020-09-16 19:48:10 +00:00
Joshy Orndorff
e4280858dc
De-alias pallets in node template runtime ( #6836 )
...
* dealias pallets
* Restore accidentally deleted code blocks
2020-08-06 21:23:31 +02:00
Joshy Orndorff
07c56a9be9
De-alias frame_system in node template runtime ( #6829 )
...
* de-alias frame_system in node template
* Fix line length
* Fix chainspec
2020-08-06 16:18:35 +00:00