1. Mar 14, 2022
  2. Mar 09, 2022
  3. Mar 07, 2022
  4. Mar 04, 2022
    • Kian Paimani's avatar
      Trie version migration pallet (#10073) · 6cfdbe5c
      Kian Paimani authored
      
      
      * 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.
      
      * migration pallet
      
      * Patch to delay runtime switch.
      
      * Revert "Patch to delay runtime switch."
      
      This reverts commit 67e55fee468f1a0cda853f5362b22e0d775786da.
      
      * fix test
      
      * fix child migration calls.
      
      * useless closure
      
      * remove remaining state_hash variables.
      
      * Fix and add more tests
      
      * Remove outdated comment
      
      * useless inner hash
      
      * fmt
      
      * remote tests
      
      * finally ksm works
      
      * batches are broken
      
      * clean the benchmarks
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Update frame/state-trie-migration/src/lib.rs
      
      Co-authored-by: default avatarJoshy Orndorff <[email protected]>
      
      * Update frame/state-trie-migration/src/lib.rs
      
      * brand new version
      
      * fix build
      
      * Update frame/state-trie-migration/src/lib.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Update frame/state-trie-migration/src/lib.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Update primitives/storage/src/lib.rs
      
      Co-authored-by: default avatarcheme <[email protected]>
      
      * Update frame/state-trie-migration/src/lib.rs
      
      Co-authored-by: default avatarcheme <[email protected]>
      
      * Update frame/state-trie-migration/src/lib.rs
      
      Co-authored-by: default avatarcheme <[email protected]>
      
      * 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
      
      * new test structure
      
      * new testing stuff from emeric
      
      * Add commit_all, still not working
      
      * Fix all tests
      
      * add comment
      
      * we have PoV tracking baby
      
      * document stuff, but proof size is still wrong
      
      * FUCK YEAH
      
      * a big batch of review comments
      
      * add more tests
      
      * tweak test
      
      * update config
      
      * some remote-ext stuff
      
      * delete some of the old stuff
      
      * sync more files with master to minimize the diff
      
      * Fix all tests
      
      * make signed migration a bit more relaxed
      
      * add witness check to signed submissions
      
      * allow custom migration to also go above limit
      
      * Fix these pesky tests
      
      * ==== removal of the unsigned stuff ====
      
      * Make all tests work again
      
      * separate the tests from the logic so it can be reused easier
      
      * fix overall build
      
      * Update frame/state-trie-migration/src/lib.rs
      
      Co-authored-by: default avatarcheme <[email protected]>
      
      * Update frame/state-trie-migration/src/lib.rs
      
      Co-authored-by: default avatarcheme <[email protected]>
      
      * Slightly better termination
      
      * some final tweaks
      
      * Fix tests
      
      * Restrict access to signed migrations
      
      * address most of the review comments
      
      * fix defensive
      
      * New simplified code
      
      * Fix weights
      
      * fmt
      
      * Update frame/state-trie-migration/src/lib.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * make the tests correctly fail
      
      * Fix build
      
      * Fix build
      
      * try and fix the benchmarks
      
      * fix build
      
      * Fix cargo file
      
      * Fix runtime deposit
      
      * make rustdoc happy
      
      * cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_state_trie_migration --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/state-trie-migration/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      Co-authored-by: default avatarcheme <[email protected]>
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      Co-authored-by: default avatarJoshy Orndorff <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      Co-authored-by: default avatarParity Bot <[email protected]>
      6cfdbe5c
  5. Mar 01, 2022
  6. Feb 14, 2022
    • Bastian Köcher's avatar
      Remove `u32_trait` (#10850) · fdd49f07
      Bastian Köcher authored
      * Remove `u32_trait`
      
      This trait only existed because there wasn't any const generic support at time of creation. However,
      we now have support for it :)
      
      * FMT
      fdd49f07
  7. Feb 06, 2022
    • Gavin Wood's avatar
      Referenda and Conviction Voting pallets (#10195) · a6891951
      Gavin Wood authored
      * Initial draft of new referendum state machine.
      
      * Docs
      
      * Fixes
      
      * Fixes
      
      * Add conviction-voting pallet
      
      * Basic build
      
      * Building
      
      * Some TODOs
      
      * Tests building
      
      * Add missing file
      
      * Basic lifecycle test
      
      * Add couple of tests
      
      * Another test
      
      * More tests
      
      * Fixes
      
      * Fixes
      
      * Formatting
      
      * Fixes
      
      * Tests
      
      * Fixes
      
      * Fixes
      
      * More tests
      
      * Formatting
      
      * First few benchmarks
      
      * First few benchmarks
      
      * Defered queue servicing
      
      * More testing
      
      * Benchmarks
      
      * Fiddly benchmark
      
      * Final nudge benchmarks
      
      * Formatting
      
      * Formatting
      
      * Finished up benchmarks
      
      * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_referenda --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/referenda/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * Events finished
      
      * Missing file
      
      * No GenesisConfig for Referenda
      
      * Formatting
      
      * Docs
      
      * Docs
      
      * Docs
      
      * Per-class conviction voting
      
      * New test & mock utils
      
      * More tests
      
      * Tests
      
      * Tests finished 🎉
      
      
      
      * Benchmarking stuff
      
      * Fixes
      
      * Test harness
      
      * Test harness
      
      * Benchmarks for Conviction=Voting
      
      * Benchmarking pipeline complete
      
      * Docs
      
      * Formatting
      
      * Remove unneeded warning
      
      * Fix UI tests
      
      * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_conviction_voting --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/conviction-voting/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * Docs
      
      * Update frame/conviction-voting/src/vote.rs
      
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      
      * update sp-runtime version
      
      * MEL Fixes for Referenda and Conviction Voting (#10725)
      
      * free maxencodedlen
      
      * more maxencodedlen
      
      * more MEL
      
      * more mel
      
      * disable storage info
      
      * More Referenda Patches (#10760)
      
      * basic fixes
      
      * fix benchmarking
      
      * fix license
      
      * prevent panic in curve math
      
      * fmt
      
      * bump crate versions
      
      * Update mock.rs
      
      Co-authored-by: default avatarParity Bot <[email protected]>
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      a6891951
  8. Jan 27, 2022
  9. Jan 25, 2022
  10. Jan 19, 2022
  11. Jan 17, 2022
  12. Jan 03, 2022
  13. Dec 24, 2021
    • cheme's avatar
      Inner hashing of value in state trie (runtime versioning). (#9732) · 4c651637
      cheme authored
      
      
      * 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: default avatarkianenigma <[email protected]>
      4c651637
  14. Dec 23, 2021
  15. Dec 16, 2021
    • dharjeezy's avatar
      Replace parameter_types with ConstU32 &c. (#10402) · 1b0be8ae
      dharjeezy authored
      
      
      * 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: default avatarDamilare <[email protected]>
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      1b0be8ae
  16. Dec 13, 2021
  17. Dec 11, 2021
    • Gavin Wood's avatar
      Preimage registrar and Scheduler integration (#10356) · 5e50e0bc
      Gavin Wood authored
      
      
      * initial idea
      
      * more
      
      * fix compile
      
      * add clear and request logic
      
      * improve some docs
      
      * Add and implement trait
      
      * continuing to improve
      
      * refcount type
      
      * infallible system preimage upload
      
      * fmt
      
      * fix requests
      
      * Make it simple
      
      * Make it simple
      
      * Formatting
      
      * Initial draft
      
      * request when scheduled
      
      * Docs
      
      * Scheduler good
      
      * Scheduler good
      
      * Scheduler tests working
      
      * Add new files
      
      * Missing stuff
      
      * Repotting, add weights.
      
      * Add some tests to preimage pallet
      
      * More tests
      
      * Fix benchmarks
      
      * preimage benchmarks
      
      * All preimage benchmarks
      
      * Tidy cargo
      
      * Update weights.rs
      
      * Allow hash provision in benchmarks
      
      * Initial work on new benchmarks for Scheduler
      
      * Tests working, refactor looks good
      
      * Tests for new Scheduler functionality
      
      * Use real weight, make tests work with runtimes without Preimage
      
      * Rename
      
      * Update benchmarks
      
      * Formatting
      
      * Formatting
      
      * Fix weird formatting
      
      * Update frame/preimage/src/lib.rs
      
      * Fix try-runtime build
      
      * Fixes
      
      * Fixes
      
      * Update frame/support/src/traits/tokens/currency.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/support/src/traits/tokens/currency/reservable.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/support/src/traits/tokens/imbalance.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Update frame/preimage/src/mock.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Update frame/scheduler/src/lib.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Update frame/preimage/src/lib.rs
      
      * Fixes
      
      * Fixes
      
      * Formatting
      
      * Fixes
      
      * Fixes
      
      * cargo run --quiet --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
      
      * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_preimage --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/preimage/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      Co-authored-by: default avatarParity Bot <[email protected]>
      5e50e0bc
  18. Dec 09, 2021
  19. Dec 08, 2021
  20. Dec 07, 2021
    • Gautam Dhameja's avatar
      Add child-bounties pallet. (#10309) · 752e050c
      Gautam Dhameja authored
      
      
      * Extract child-bounties as a separate pallet.
      
      * Initial tests added.
      
      * More tests.
      
      * Tests complete. Fixed curator fee issue.
      
      * Fixed comments.
      
      * Added benchmarks for child-bounties pallet.
      
      * Added weights.
      
      * Fixed formatting.
      
      * Fixed comments.
      
      * Re-run benchmarks for bounties pallet.
      
      * Make cargo fmt happy again
      
      * add max encoded len
      
      * use event structs
      
      * fmt
      
      * fix compile
      
      * Addressed review comments.
      
      * Use config type instead of const in benchmarking.
      
      * Addressed more review comments.
      
      * Use ensure_can_withdraw instead of just checking min balance.
      
      * fmt.
      
      * Introduce ChildBountyCuratorDepositBase to avoid zero curator deposits for child bounties.
      
      * Fix unassign curator logic for child-bounties.
      
      * Added more tests for unassign curator.
      
      * Reduce bounty description max length in node runtime.
      
      * Updated weights for child bounties pallet.
      
      * reduce indentation of unassign_curator
      
      * more indentation reduction
      
      * deduplicate slashing arms
      
      * reintroduce ensure check
      
      * add assertion to check that bad unassign origin fails
      
      * formatting
      
      * Updated comments.
      
      Co-authored-by: default avatarRicardo Rius <[email protected]>
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      Co-authored-by: default avatarAlexander Popiak <[email protected]>
      752e050c
    • Alexander Theißen's avatar
      contracts: Add storage deposits (#10082) · 68634766
      Alexander Theißen authored
      
      
      * Frame no longer needs to be mutable (refactoring artifact)
      
      * Remove Contract/Tombstone deposit
      
      * Add StorageMeter
      
      * cargo fmt
      
      * Fix weight annotation
      
      * cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs
      
      * Simplify keep check for contract accounts
      
      - Make sure that the "base deposit" for each contract >= ed
      - Remove now obsolete checks when sneding away free balance
      
      * Remove unused imports and functions
      
      * Rename storage_limit to storage_deposit_limit
      
      * cargo fmt
      
      * Fix typo
      
      Co-authored-by: default avatarMichael Müller <[email protected]>
      
      * Finish up rename of storage_limit
      
      * Fix rpc tests
      
      * Make use of `StorageDepositLimitTooHigh`
      
      * Add tests and fix bugs discovered by tests
      
      * Add storage migration
      
      * Don't use u128 in RPC
      
      * Fix weight of migration
      
      * Rename `endowment` to `value`
      
      * Fix bug where contract couldn't get funded by a storage deposit
      
      - Make sure that contract gets funded from deposits before value is transferred
      - Don't reserve value at origin because otherwise funding isn't possible
      	- Just transfer free balance and reserve it after the transfer
      - When refunding make sure that this refund can't dust the contract
      	- Can only happen after a runtime upgrade where costs where upped
      - Add more tests
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAndrew Jones <[email protected]>
      
      * Remove unused `fn storage_meter`
      
      * Fix copy pasta doc error
      
      * Import `MaxEncodeLen` from codec
      
      * Beautify RPC trait bounds
      
      * Add re-instrument behaviour to dispatchable doc
      
      * Make sure a account won't be destroyed a refund after a slash
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAndrew Jones <[email protected]>
      
      * Update `Storage::write` docs
      
      * Improve doc
      
      * Remove superflous conditional
      
      * Typos
      
      * Remove superflous clone (refactoring artifact)
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAndrew Jones <[email protected]>
      
      Co-authored-by: default avatarParity Bot <[email protected]>
      Co-authored-by: default avatarMichael Müller <[email protected]>
      Co-authored-by: default avatarAndrew Jones <[email protected]>
      68634766
  21. Dec 01, 2021
  22. Nov 28, 2021
  23. Nov 23, 2021
    • Xavier Lau's avatar
      Support MMR Pruning (#9700) · f9122a87
      Xavier Lau authored
      
      
      * Use `0.3.2`
      
      * Replace `u64` with `NodeIndex`
      
      * Fix Typo
      
      * Add Pruning Logic
      
      * Fix Some Tests
      
      * Remove Comment
      
      * Log Only Under STD
      
      * Return while No Element to Append
      
      * Optimize Pruning Algorithm
      
      * Update Doc
      
      * Update Doc
      
      * Zero Copy Algorithm
      
      * Import Missing Type
      
      * Fix Merge Mistake
      
      * Import Missing Item
      
      * Make `verify` Off-Chain
      
      * `cargo fmt`
      
      * Avoid using NodeIndex in incorrect places.
      
      * Simplify pruning.
      
      * Format
      
      Co-authored-by: default avatarTomasz Drwięga <[email protected]>
      f9122a87
  24. Nov 19, 2021
    • Georges's avatar
      Moving `pallet-asset-tx-payment` from cumulus to substrate (#10127) · 439af98e
      Georges authored
      
      
      * Moving `pallet-asset-tx-payment` from cumulus
      
      * move pallet-asset-tx-payment into transaction payment directory
      
      * cargo +nightly fmt
      
      * Adding `pallet-asset-tx-payment` to node runtime
      I had to change the Balance type to u128.
      Also harmonised that pallet's version
      
      * Updating cargo.lock after merge
      
      * forgot this
      
      * Adding tx-payment signature
      
      * Missed one more
      
      * `transaction-payment` replaced in`SignedExtension`
      by `asset-tx-payment` and not added
      
      * Fixing benches
      
      * add test to verify that we don't charge on post-dispatch if we didn't on pre-dispatch
      
      * add (failing) test for asset tx payment of unsigned extrinsics
      
      * fix test by removing debug_assert
      
      * cargo +nightly fmt
      
      * typo in `Cargo.lock`
      
      * Object defined twice in lock file
      
      * cargo update
      
      * remove todo
      
      * Apply formatting suggestions from code review
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Refactoring `post_dispatch` of `asset-tx-payment`
      to reuse `post_dispatch` of `transaction-payment` if the fee asset is
      native
      Removing unneeded imports.
      
      * Removing redundant `TODO`
      
      * Reverting an accidental bump of `impl-serde`
       from `0.3.1` to `0.3.2`
      
      * Revert unneeded changes to `cargo.lock`
      
      * Update frame/transaction-payment/asset-tx-payment/src/payment.rs
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * Fixing cargo fmt
      
      Reverting changes which broke cargo fmt
      
      Co-authored-by: default avatarAlexander Popiak <[email protected]>
      Co-authored-by: default avatarAlexander Popiak <[email protected]>
      Co-authored-by: default avatarKian Paimani <[email protected]>
      439af98e
  25. Nov 10, 2021
  26. Nov 04, 2021
  27. Oct 31, 2021
    • thiolliere's avatar
      Automatic pallet parts in construct_runtime (#9681) · 4292e18e
      thiolliere authored
      
      
      * implement automatic parts
      
      * ui tests
      
      * rename
      
      * remove unnecessary exclude
      
      * better doc
      
      * better doc
      
      * fix genesis config
      
      * fix UI tests
      
      * fix UI test
      
      * Revert "fix UI test"
      
      This reverts commit a910351c0b24cfe42195cfd97d83a416640e3259.
      
      * implemented used_parts
      
      * Update frame/support/procedural/src/construct_runtime/mod.rs
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * doc + fmt
      
      * Update frame/support/procedural/src/construct_runtime/parse.rs
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * add doc in the macro
      
      * remove yet some more parts
      
      * fix ui test
      
      * more determnistic error message + fix ui tests
      
      * fix ui test
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * do refactor + fix ui tests
      
      * fmt
      
      * fix test
      
      * fix test
      
      * fix ui test
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * refactor
      
      * remove even more part in node-runtime
      
      * fix test
      
      * Add flow chart for the construct_runtime! execution flow
      
      * Fix typo
      
      * Ignore snippets that don't contain code
      
      * Refactor some code in expand_after
      
      * Rename expand_after to match_and_insert
      
      * cargo fmt
      
      * Fix rename
      
      * Remove frame_support argument to construct_runtime_parts
      
      * Make use of tt-call to simplify intermediate expansions
      
      * cargo fmt
      
      * Update match_and_insert documentation
      
      * Reset cursor to 0 when no matching patterns are found
      
      * Reorder struct fields on MatchAndInsertDef
      
      * Add test for dependency renames and fix frame-support import
      
      * Add more doc comments
      
      * Update frame/support/test/compile_pass/src/lib.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      4292e18e
  28. Oct 30, 2021
    • Shawn Tabrizi's avatar
      Add Baseline FRAME Benchmarks (#9691) · 2d556c44
      Shawn Tabrizi authored
      
      
      * 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: default avatarParity Bot <[email protected]>
      2d556c44
  29. Oct 29, 2021
    • Bastian Köcher's avatar
      pallet-scheduler: Introduce `OriginPrivilegeCmp` (#10078) · 95b8fd61
      Bastian Köcher authored
      
      
      * pallet-scheduler: Introduce `OriginPrivilegeCmp`
      
      When a scheduled task should be canceled, the origin that tries to
      cancel the task is compared to the origin the task should be executed
      with. Before this pr this check only allowed that both origins are
      equal. However, this is problematic as this means that for example a
      council origin it needs to be have the same amount of yes votes to
      cancel the scheduled task. While a council origin with more yes votes
      should be able to cancel this task. This happened recently on Kusama and
      lead to a failed cancelation of a scheduled task. With this pr the two
      origins are compared and the cancelling origin needs to have greater or
      equal privileges as the origin that scheduled the task. What a greater,
      equal or less privilege is, can be configured in the runtime.
      
      For simplicity, a `EqualPrivilegeOnly` implementation is provided that
      only checks if two origins are equal. So, this mimics the old behaviour.
      
      * FMT
      
      * fix import
      
      * Small optimizations
      
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      95b8fd61
  30. Oct 11, 2021
    • Alexander Popiak's avatar
      Add Deposit and Withdraw Events to Balances Pallet (#9425) · 32900294
      Alexander Popiak authored
      
      
      * add Deposit and Withdraw events to balances
      
      + add deposit_event() calls where appropriate to signal fund movement
      + adjust and extend tests
      
      * line length
      
      * move events to the end to avoid changing indices
      
      * bump spec_version
      
      * cargo fmt
      
      * adjust block import bench to new event count
      
      * fix node executor tests
      
      * adjust import bench comment
      
      * fix typo and formatting
      
      * adjust event number
      
      * fix copy pasta
      
      * fix contracts pallets tests
      
      * cargo fmt
      
      * WIP fix events in tests
      
      * fix offences tests
      
      * fix tests
      
      * cargo +nightly fmt
      
      * fix contracts pallets tests
      
      * cargo +nightly fmt
      
      * fix offences tests
      
      * formatting and compile fixes
      
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      32900294
  31. Oct 08, 2021
  32. Oct 06, 2021
  33. Oct 04, 2021
  34. Sep 30, 2021
  35. Sep 22, 2021
    • Georges's avatar
      Generate storage info for pallet babe (#9760) · 5922da95
      Georges authored
      
      
      * Adding MaxEncodedLen for:
      * NextConfigDescriptor
      * AllowedSlots
      * BabeEpochConfiguration
      
      In prepation for adding storage information on pallet babe
      
      * Adding stotage_info to pallet babe
      
      Refactored UNDER_CONSTRUCTION_SEGMENT_LENGTH to become a runtime
      parameter MaxSegmentLength
      
      * Reinstate Slice as opposed to Vec
      
      * Refactoring code to make it neater
      
      * Replace `MaxSegmentLength` by
      `UNDER_CONSTRUCTION_SEGMENT_LENGTH`
      Stop exposing the bounds to the runtime
      
      * Removing extra line
      
      Co-authored-by: default avatarthiolliere <[email protected]>
      5922da95