1. Sep 15, 2021
    • Andrew Jones's avatar
      Enrich metadata with type information (#8615) · 49b6dfd2
      Andrew Jones authored
      
      
      * 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: default avatarGuillaume Thiolliere <[email protected]>
      
      * Line widths check
      
      * Cargo.lock
      
      * Add scale-info/std
      
      * Update frame/system/src/lib.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * 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: default avatarGuillaume Thiolliere <[email protected]>
      
      * 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: default avatarGuillaume Thiolliere <[email protected]>
      
      * 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: default avatarGuillaume Thiolliere <[email protected]>
      
      * 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: default avatarKeith Yeung <[email protected]>
      
      * 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: default avatarKeith Yeung <[email protected]>
      
      * Update primitives/runtime/src/generic/unchecked_extrinsic.rs
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * Update bin/node/executor/Cargo.toml
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update frame/identity/src/types.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * Update frame/support/src/dispatch.rs
      
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      
      * 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: default avatarGuillaume Thiolliere <[email protected]>
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      Co-authored-by: default avatarBastian Köcher <[email protected]>
      49b6dfd2
  2. Sep 06, 2021
    • Alexander Theißen's avatar
      contracts: Remove state rent (#9669) · 522e77e2
      Alexander Theißen authored
      
      
      * Remove storage rent
      
      * Add storage migration
      
      * 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
      
      * 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
      
      * 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
      
      * Add migration for deletetion queue
      
      * Fix compilation
      
      * Increase gas supplied to out_of_gas to be sure that it won't deplete too early
      
      * 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
      
      Co-authored-by: default avatarParity Bot <[email protected]>
      522e77e2
  3. Aug 11, 2021
  4. Aug 07, 2021
  5. Jul 27, 2021
    • Bastian Köcher's avatar
      Move `PalletVersion` away from the crate version (#9165) · 4fe55f0b
      Bastian Köcher authored
      
      
      * Move `PalletVersion` away from the crate version
      
      Before this pr, `PalletVersion` was referring to the crate version that
      hosted the pallet. This pr introduces a custom `package.metadata.frame`
      section in the `Cargo.toml` that can contain a `pallet-version` key
      value pair. While the value is expected to be a valid u16. If this
      key/value pair isn't given, the version is set to 1.
      
      It also changes the `PalletVersion` declaration. We now only have one
      `u16` that represents the version. Not a major/minor/patch version. As
      the old `PalletVersion` was starting with the `u16` major, decoding the
      old values will work.
      
      * Overhaul the entire implementation
      
      - Drop PalletVersion
      - Introduce StorageVersion
      - StorageVersion needs to be set in the crate and set for the macros
      - Added migration
      
      * Fix migrations
      
      * Review feedback
      
      * Remove unneeded dep
      
      * remove pub consts
      
      * Brings back logging and implements `GetStorageVersion`
      
      * Return weight from migration
      
      * Fmt and remove unused import
      
      * Update frame/support/src/dispatch.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * Update frame/support/src/traits/metadata.rs
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      4fe55f0b
  6. Jul 21, 2021
    • Bastian Köcher's avatar
      Run cargo fmt on the whole code base (#9394) · 7b56ab15
      Bastian Köcher authored
      * 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: default avatarAndré Silva <[email protected]>
      7b56ab15
  7. Jul 12, 2021
  8. Jun 25, 2021
  9. Jun 07, 2021
  10. May 29, 2021
  11. May 28, 2021
  12. May 25, 2021
    • Alexander Theißen's avatar
      contracts: Fix some minor bugs around instantiation (#8879) · c92d4a26
      Alexander Theißen authored
      
      
      * Fix output of wrongly outputted error
      
      The "Tombstoned a contract that is below the subsistence threshold: {:?}" was
      triggered when too few balance was provided. It was a false alarm.
      
      * Fix return of wrong code_len
      
      * Split up `NotCallable` into more fine grained errors
      
      * Fix typos in docs
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      
      * RentNotPayed -> RentNotPaid
      
      * Fix typo: payed -> paid
      
      It is OK to change the in-storage field name because:
      
      1. The SCALE encoding is not based on names only on position.
      2. The struct is not public (only to the crate).
      
      Co-authored-by: default avatarKeith Yeung <[email protected]>
      c92d4a26
  13. May 13, 2021
    • Alexander Theißen's avatar
      contracts: Move `Schedule` from Storage to `Config` (#8773) · 1ac95b6b
      Alexander Theißen authored
      * Move `Schedule` from Storage to Config
      
      * Updated CHANGELOG
      
      * Fix nits from review
      
      * Fix migration
      
      * Print the debug buffer as tracing message
      
      * Use `debug` instead of `trace` and update README
      
      * Add additional assert to test
      
      * Rename `schedule_version` to `instruction_weights_version`
      
      * Fixed typo
      
      * Added more comments to wat fixtures
      
      * Add clarification for the `debug_message` field
      1ac95b6b
  14. May 07, 2021
    • Alexander Theißen's avatar
      contracts: Refactor the exec module (#8604) · 9e894ce1
      Alexander Theißen authored
      
      
      * contracts: Add default implementation for Executable::occupied_storage()
      
      * contracts: Refactor the exec module
      
      * Let runtime specify the backing type of the call stack
      
      This removes the need for a runtime check of the specified
      `MaxDepth`. We can now garantuee that we don't need to
      allocate when a new call frame is pushed.
      
      * Fix doc typo
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      
      * cargo run --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
      
      * Review nits
      
      * Fix defect in contract info caching behaviour
      
      * Add more docs
      
      * Fix wording and typos
      
      Co-authored-by: default avatarGuillaume Thiolliere <[email protected]>
      Co-authored-by: default avatarParity Benchmarking Bot <[email protected]>
      9e894ce1
  15. Apr 13, 2021
  16. Mar 24, 2021
  17. Mar 23, 2021
  18. Mar 18, 2021
    • sacha-l's avatar
      doc(frame): [nitpicks] (#8396) · 33fefc25
      sacha-l authored
      33fefc25
    • Shaun Wang's avatar
      Replace 'Module' with 'Pallet' in construct_runtime macro (#8372) · 2e552244
      Shaun Wang authored
      * 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.
      2e552244
  19. Mar 12, 2021
    • Alexander Theißen's avatar
      contracts: Expose rent parameter to contracts (#8231) · a4e88758
      Alexander Theißen authored
      
      
      * contracts: Expose rent parameter to contracts
      
      * cargo run --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
      
      * Fix typos
      
      * Improve comments
      
      * Add rent parameter weights
      
      * Allow deploying a new schedule with the same version
      
      * Add storage migration for new schedule
      
      * Only decode the schedule version in storage migration
      
      * Remove confusing docs
      
      * Replace original_code_len() by aggregate_code_len()
      
      Co-authored-by: default avatarParity Benchmarking Bot <[email protected]>
      a4e88758
  20. Mar 10, 2021
    • asynchronous rob's avatar
      more clear randomness API for BABE (#8180) · e2960c38
      asynchronous rob authored
      
      
      * 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: default avatarAndré Silva <[email protected]>
      e2960c38
  21. Feb 25, 2021
  22. Feb 22, 2021
  23. Feb 05, 2021
    • Alexander Theißen's avatar
      contracts: Remove ConfigCache (#8047) · 1b31f7c5
      Alexander Theißen authored
      
      
      * contracts: Remove ConfigCache
      
      * cargo run --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
      
      * Fixup test
      
      Co-authored-by: default avatarParity Benchmarking Bot <[email protected]>
      1b31f7c5
  24. Feb 04, 2021
  25. Feb 03, 2021
  26. Feb 02, 2021
  27. Feb 01, 2021
  28. Jan 14, 2021
  29. Jan 06, 2021
  30. Jan 04, 2021
    • Alexander Theißen's avatar
      contracts: Lazy storage removal (#7740) · 3ba8fdfc
      Alexander Theißen authored
      * Do not evict a contract from within a call stack
      
      We don't want to trigger contract eviction automatically when
      a contract is called. This is because those changes can be
      reverted due to how storage transactions are used at the moment.
      More Information:
      https://github.com/paritytech/substrate/issues/6439#issuecomment-648754324
      
      It can be re-introduced once the linked issue is resolved. In the meantime
      `claim_surcharge` must be called to evict a contract.
      
      * Lazily delete storage in on_initialize instead of when removing the contract
      
      * Add missing documentation of new error
      
      * Make Module::claim_surcharge public
      
      It being the only dispatchable that is private is an oversight.
      
      * review: Add final newline
      
      * review: Simplify assert statement
      
      * Add test that checks that partial remove of a contract works
      
      * Premote warning to error
      
      * Added missing docs for seal_terminate
      
      * Lazy deletion should only take AVERAGE_ON_INITIALIZE_RATIO of the block
      
      * Added informational about the lazy deletion throughput
      
      * Avoid lazy deletion in case the block is already full
      
      * Prevent queue decoding in case of an already full block
      
      * Add test that checks that on_initialize honors block limits
      3ba8fdfc
    • Alexander Theißen's avatar
      contracts: Allow runtime authors to define a chain extension (#7548) · 51c37ecc
      Alexander Theißen authored
      * Make host functions return TrapReason
      
      This avoids the need to manually store any trap reasons
      to the `Runtime` from the host function. This adds the following
      benefits:
      
      * It properly composes with the upcoming chain extensions
      * Missing to set a trap value is now a compile error
      
      * Add chain extension
      
      The chain extension is a way for the contract author to add new
      host functions for contracts to call.
      
      * Add tests for chain extensions
      
      * Fix regression in set_rent.wat fixture
      
      Not all offsets where properly updated when changing the fixtures
      for the new salt on instantiate.
      
      * Pre-charge a weight amount based off the specified length
      
      * Improve fn write docs
      
      * Renamed state to phantom
      
      * Fix typo
      51c37ecc
    • Bastian Köcher's avatar
      Happy new year (#7814) · e3e651f7
      Bastian Köcher authored
      * Happy new year
      
      Updates the copyright years and fixes wrong license headers.
      
      * Fix the template
      
      * Split HEADER into HEADER-APACHE & HEADER-GPL
      e3e651f7
  31. Dec 29, 2020
  32. Nov 30, 2020
  33. Nov 24, 2020
    • Alexander Theißen's avatar
      contracts: Add `salt` argument to contract instantiation (#7482) · c3ca78fa
      Alexander Theißen authored
      
      
      * pallet-contracts: Fix seal_restore_to to output proper module errors
      
      Those errors where part of the decl_error for some time but where
      never actually returned. This allows proper debugging of failed
      restorations. Previously, any error did return the misleading
      `ContractTrapped`.
      
      * Bind UncheckedFrom<T::Hash> + AsRef<[u8]> everywhere
      
      This allows us to make assumptions about the AccoutId
      that are necessary for testing and in order to benchmark
      the module properly.
      
      This also groups free standing functions into inherent functions
      in order to minimize the places where the new bounds need to
      be specified.
      
      * Rework contract address determination
      
      * Do not allow override by runtime author
      * Instantiate gained a new parameter "salt"
      
      This change is done now in expecation of the upcoming code rent
      which needs to change the instantiation dispatchable and
      host function anyways.
      
      The situation in where we have only something that is like CREATE2
      makes it impossible for UIs to help the user to create an arbitrary
      amount of instantiations from the same code.
      
      With this change we have the same functionality as ethereum with
      a CREATE and CREATE2 instantation semantic.
      
      * Remove TrieIdGenerator
      
      The new trait bounds allows us to remove this workaround
      from the configuration trait.
      
      * Remove default parameters for config trait
      
      It should be solely the responsiblity to determine proper values for
      these parameter. As a matter of fact most runtime weren't using these
      values anyways.
      
      * Fix tests for new account id type
      
      Because of the new bounds on the trait tests can't get away by using
      u64 as accound id. Replacing the 8 byte value by a 32 byte value
      creates out quite a bit of code churn.
      
      * Fix benchmarks
      
      The benchmarks need adaption to the new instantiate semantics.
      
      * Fix compile errors caused by adding new trait bounds
      * Fix compile errors caused by renaming storage and rent functions
      * Adapt host functions and dispatchables to the new salt
      * Add tests for instantiate host functions (was not possible before)
      
      * Add benchmark results
      
      * Adapt to the new WeightInfo
      
      The new benchmarks add a new parameter for salt "s" to the instantiate weights
      that needs to be applied.
      
      * Fix deploying_wasm_contract_should_work integration test
      
      This test is adapted to use the new instantiate signature.
      
      * Break overlong line
      
      * Break more long lines
      
      Co-authored-by: default avatarParity Benchmarking Bot <[email protected]>
      c3ca78fa
  34. Nov 09, 2020
    • Alexander Theißen's avatar
      contracts: Add automated weights for wasm instructions (#7361) · 51c67fe8
      Alexander Theißen authored
      
      
      * pallet_contracts: Inline benchmark helper that is only used once
      
      * Move all max_* Schedule items into a new struct
      
      * Limit the number of globals a module can declare
      
      * The current limits are too high for wasmi to even execute
      
      * Limit the amount of parameters any wasm function is allowed to have
      
      * Limit the size the BrTable's immediate value
      
      * Add instruction benchmarks
      
      * Add new benchmarks to the schedule and make use of it
      
      * Add Benchmark Results generated by the bench bot
      
      * Add proc macro that implements `Debug` for `Schedule`
      
      * Add missing imports necessary for no_std build
      
      * Make the WeightDebug macro available for no_std
      
      In this case a dummy implementation is derived in order to not
      blow up the code size akin to the RuntimeDebug macro.
      
      * Rework instr_memory_grow benchmark to use only the maximum amount of pages allowed
      
      * Add maximum amount of memory when benching (seal_)call/instantiate
      
      * cargo run --release --features runtime-benchmarks --manifest-path bin/node/cli/Cargo.toml -- benchmark --chain dev --steps 50 --repeat 20 --extrinsic * --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output ./bin/node/runtime/src/weights --header ./HEADER --pallet pallet_contracts
      
      * Added utility benchmark that allows pretty printing of the real schedule
      
      * review: Add missing header to the proc-macro lib.rs
      
      * review: Clarify why #[allow(dead_code)] attribute is there
      
      * review: Fix pwasm-utils line
      
      * review: Fixup rand usage
      
      * review: Fix typo
      
      * review: Imported -> Exported
      
      * cargo run --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
      
      * contracts: Adapt to new weight structure
      
      * contracts: Fixup runtime WeightInfo
      
      * contracts: Remove unneeded fullpath of WeightInfo type
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAndrew Jones <[email protected]>
      
      * Fix typo in schedule.rs
      
      Co-authored-by: default avatarAndrew Jones <[email protected]>
      
      * Fix docs in schedule.rs
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarNikolay Volf <[email protected]>
      
      * Don't publish proc-macro crate until 3.0.0 is ready
      
      * Optimize imports for less repetition
      
      * Break overlong line
      
      Co-authored-by: default avatarParity Benchmarking Bot <[email protected]>
      Co-authored-by: default avatarAndrew Jones <[email protected]>
      Co-authored-by: default avatarNikolay Volf <[email protected]>
      51c67fe8
  35. Oct 29, 2020