PG Herveou
b6231c79ca
Contracts: Refactor API to use WeightMeter ( #2943 )
...
Update the Contracts API to use `WeightMeter`, as it simplifies the code
and makes it easier to reason about, rather than taking a mutable weight
or returning a tuple with the weight consumed
---------
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
2024-04-09 10:22:54 +00:00
Liam Aharon
12ce4f7d04
Runtime Upgrade ref docs and Single Block Migration example pallet ( #1554 )
...
Closes https://github.com/paritytech/polkadot-sdk-docs/issues/55
- Changes 'current storage version' terminology to less ambiguous
'in-code storage version' (suggestion by @ggwpez)
- Adds a new example pallet `pallet-example-single-block-migrations`
- Adds a new reference doc to replace
https://docs.substrate.io/maintain/runtime-upgrades/ (temporarily living
in the pallet while we wait for developer hub PR to merge)
- Adds documentation for the `storage_alias` macro
- Improves `trait Hooks` docs
- Improves `trait GetStorageVersion` docs
- Update the suggested patterns for using `VersionedMigration`, so that
version unchecked migrations are never exported
- Prevents accidental usage of version unchecked migrations in runtimes
https://github.com/paritytech/substrate/pull/14421#discussion_r1255467895
- Unversioned migration code is kept inside `mod version_unchecked`,
versioned code is kept in `pub mod versioned`
- It is necessary to use modules to limit visibility because the inner
migration must be `pub`. See
https://github.com/rust-lang/rust/issues/30905 and
https://internals.rust-lang.org/t/lang-team-minutes-private-in-public-rules/4504/40
for more.
### todo
- [x] move to reference docs to proper place within sdk-docs (now that
https://github.com/paritytech/polkadot-sdk/pull/2102 is merged)
- [x] prdoc
---------
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Juan <juangirini@gmail.com >
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: command-bot <>
Co-authored-by: gupnik <nikhilgupta.iitk@gmail.com >
2024-02-28 07:32:02 +00:00
PG Herveou
18ad449015
Contracts migration update ( #2091 )
...
Restore fix from #2077
2023-10-31 12:08:32 +01:00
Liam Aharon
ad5163ba93
contracts migration: remove unnecessary panics ( #2079 )
...
Runtime migration CI is currently failing
(https://gitlab.parity.io/parity/mirrors/polkadot-sdk/builds/4122083 )
for the contracts testnet due to unnecessary panicing in a `pre_upgrade`
hook.
Soon idempotency will be enforced
https://github.com/paritytech/try-runtime-cli/issues/42 , in the mean
time we need to manually fix these issues as they arise.
---
also removes backticks from the string in `echo`, which caused a
'command not found' error in ci output
2023-10-30 11:55:05 +01:00
Kevin Wang
e8da320734
contracts: Fix incorrect storage alias in mirgration ( #1687 )
...
# Description
We are recently trying to upgrade our Substrate version from
`polkadot-v0.9.43` to `polkadot-v1.0.0` and we noticed a critical issue:
all deployed contracts seem to be experiencing a `CodeNotFound` error.
After a thorough investigation, it appears that the root cause of this
issue lies in the mismatch between the storage alias of `CodeInfoOf<T>`
in the migration and its original definition.
This PR corrects the storage alias to align it with its original
definition
I am uncertain about the proper approach for adding tests to this
change. Would the team consider taking over this PR to bring it to
completion?
---------
Co-authored-by: pgherveou <pgherveou@gmail.com >
2023-09-25 15:13:11 +02:00
Juan
878c562cd4
Restructure frame_support macro related exports ( #14745 )
...
* make reexports private
* make reexports private 2
* make reexports private for runtime-benchmarking
* make reexports private for try-runtime
* fix for try-runtime
* make reexports private for tests
* fmt
* make reexports private for tests
* make reexports private for experimental
* fix beefy
* fix ui test
* fix ui test
* fix benches
* ".git/.scripts/commands/fmt/fmt.sh"
* fix contracts use
* wip
* wip
* do not reexport sp_api::metadata_ir
* fix CI checks
* fix support tests
* ".git/.scripts/commands/fmt/fmt.sh"
* Update frame/support/src/lib.rs
Co-authored-by: Bastian Köcher <git@kchr.de >
* import codec directly
* fmt
* fix node-cli tests
---------
Co-authored-by: command-bot <>
Co-authored-by: Bastian Köcher <git@kchr.de >
2023-08-23 12:30:12 +00:00
Juan
9c5315961e
Contracts remove deposit accounts ( #14589 )
...
* contracts: refactor currency to use fungible traits
* contracts: refactor currency to use fungible traits
* contracts: add minor improvements
* contracts: max holds config set
* contracts: fix some typos
* contracts: map token errors
* fix typo
* contracts: add 0 balance transfer to test
* contracts: not transfer if value is zero
* contracts: [WIP] add StorageDepositHold
* contracts: add storage deposit held event
* contracts: clean up some code and comments
* contracts: add deposit storage released event
* contracts: update comment
* contracts: update slash cannot kill account test
* contracts: fix tests
* contracts: add some comments to the slashing test
* contracts: add some comments to the slashing test
* contracts: remove references to Currency
* contracts: do not transfer if from equals to
* bound BalanceOf<T>
* added FixedPointOperand to Balance trait
* move migrate sequence to config
* remove commented out code
* Update frame/contracts/src/lib.rs
Co-authored-by: PG Herveou <pgherveou@gmail.com >
* remove Migrations generic
* make runtime use noop migrations
* restrict is_upgrade_supported
* undo is_upgrade_supported change
* Update bin/node/runtime/src/lib.rs
Co-authored-by: PG Herveou <pgherveou@gmail.com >
* add rust doc example for `Migrations`
* feature gate NoopMigration
* fix example code
* improve example
* wip
* remove FixedPointOperand from trait
* trait bound BalanceOf
* more trait bound BalanceOf
* update to use RuntimeHoldReason
* replace Fungible for Currency
* update runtime
* WIP
* make v10 benchmark generic over currency
* solve merge conflicts
* make v12 migration benchmarking generic over DepositPerItem and DepositPerByte
* give some format
* fix tests and old migrations
* add migration v13 placholder
* wip
* wip
* add benchmarking
* add weights
* wip
* [pallet_collective] Enforce prime is a valid member of collective in set_members extrinsic (#14354 )
* Updated set_members extrinsic to enforce prime is valid member of collective
* Added additional tests for set_members extrinsic
* applied the code review suggestions
* update to docify 0.2.0 / crate-relative embed paths (#14570 )
* Fix Society v2 migration (#14421 )
* fix society v2 migration
* Update frame/society/src/migrations.rs
* Update frame/society/src/migrations.rs
Co-authored-by: Bastian Köcher <git@kchr.de >
* Update frame/society/src/migrations.rs
Co-authored-by: Bastian Köcher <git@kchr.de >
* update for versioned upgrade
* fix society v2 migration
* remove references to members being sorted from commnets
* fix type
* fix can_migrate check
* add sanity log
* fix sanity check
* kick ci
* kick ci
* run tests with --experimental flag
* versioned migration cleanup
* revert pipeline change
* use defensive!
* semicolons
* defensive and doc comment
* address pr comment
* feature gate the versioned migration
* defensive_unwrap_or
* fix test
* fix doc comment
* change defensive to a log warning
* remove can_migrate anti-pattern
* Update frame/society/Cargo.toml
Co-authored-by: Bastian Köcher <git@kchr.de >
* add experimental feature warning to doc comment
* update doc comment
* bump ci
* kick ci
* kick ci
* kick ci
---------
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Bastian Köcher <git@kchr.de >
* Moves `Block` to `frame_system` instead of `construct_runtime` and removes `Header` and `BlockNumber` (#14437 )
* Initial setup
* Adds node block
* Uses UncheckedExtrinsic and removes Where section
* Updates frame_system to use Block
* Adds deprecation warning
* Fixes pallet-timestamp
* Removes Header and BlockNumber
* Addresses review comments
* Addresses review comments
* Adds comment about compiler bug
* Removes where clause
* Refactors code
* Fixes errors in cargo check
* Fixes errors in cargo check
* Fixes warnings in cargo check
* Formatting
* Fixes construct_runtime tests
* Uses import instead of full path for BlockNumber
* Uses import instead of full path for Header
* Formatting
* Fixes construct_runtime tests
* Fixes imports in benchmarks
* Formatting
* Fixes construct_runtime tests
* Formatting
* Minor updates
* Fixes construct_runtime ui tests
* Fixes construct_runtime ui tests with 1.70
* Fixes docs
* Fixes docs
* Adds u128 mock block type
* Fixes split example
* fixes for cumulus
* ".git/.scripts/commands/fmt/fmt.sh"
* Updates new tests
* Fixes fully-qualified path in few places
* Formatting
* Update frame/examples/default-config/src/lib.rs
Co-authored-by: Juan <juangirini@gmail.com >
* Update frame/support/procedural/src/construct_runtime/mod.rs
Co-authored-by: Juan <juangirini@gmail.com >
* ".git/.scripts/commands/fmt/fmt.sh"
* Addresses some review comments
* Fixes build
* ".git/.scripts/commands/fmt/fmt.sh"
* Update frame/democracy/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update frame/democracy/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update frame/support/procedural/src/construct_runtime/mod.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update frame/support/procedural/src/construct_runtime/mod.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Addresses review comments
* Updates trait bounds
* Minor fix
* ".git/.scripts/commands/fmt/fmt.sh"
* Removes unnecessary bound
* ".git/.scripts/commands/fmt/fmt.sh"
* Updates test
* Fixes build
* Adds a bound for header
* ".git/.scripts/commands/fmt/fmt.sh"
* Removes where block
* Minor fix
* Minor fix
* Fixes tests
* ".git/.scripts/commands/update-ui/update-ui.sh" 1.70
* Updates test
* Update primitives/runtime/src/traits.rs
Co-authored-by: Bastian Köcher <git@kchr.de >
* Update primitives/runtime/src/traits.rs
Co-authored-by: Bastian Köcher <git@kchr.de >
* Updates doc
* Updates doc
---------
Co-authored-by: command-bot <>
Co-authored-by: Juan <juangirini@gmail.com >
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Bastian Köcher <git@kchr.de >
* Refactor the asset-conversion-tx-payment pallet (#14558 )
* Code refactoring
* Fix imports
* Typo
* Update frame/asset-conversion/src/types.rs
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Sync docs
---------
Co-authored-by: parity-processbot <>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* wip
* wip
* wip
* improve try-runtime imports
* remove deposit account
* wip
* wip
* fix benchmark test
* improved rustdocs
* improved rustdocs
* remove log
* ignore variable
* reduce caller funding
* wip
* fix tests
* fix tests
* move v13 out
* add v14
* update v13 migration
* v13 migration
* benchmark v13_migration
* fix broken compilation
* ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_contracts
* remove all the `where BalanceOf`
* add Balance to Config
* improve docs
* add new deposit storage error
* remove todo message
* wip
* rename migration v13 pre rebase
* fix tests
* add missing migration;
* bump storage version
* apply review suggestions
* improved comment
* remove unnecessary code
* simplify migrations
* mock balance
* mock more for benchmarks
* make room for rebaes
* make room for rebase
* fix benchmarking tests
* fix benchmarking tests with caller
* improve cargo toml
* solve nit
* Update frame/contracts/src/lib.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/exec.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/exec.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/storage/meter.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* review improvements
* remove extra events
* update cargo
* undo update cargo
* review updates
* wip
* wip
* fix test
* remove type Balance
* add extra fields to events
* fix zepter ci
* fix tests
* remove commented out code
* remove deposit_account from benchmarking
* update v15 migration
* wip
* remove deposit account from codebase
* add contract info to v15
* make try-runtime fixes
* fix wrong v14 logs
* add extra post upgrade steps
* remove old comments
* wip
* fix delegate deposit test
* ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_contracts
* wip
* wip
* wip
* implement review updates
* ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_contracts
* fix documentation
* fix consumers/providers
* fix consumers/providers
* do not check consumers in migration
* review comments addressed
* update fully qualified System
* wip
* wip
* Transfer to beneficiary after `transfer_on_hold` (#14767 )
* transfer to beneficiary after transfer_on_hold
* wip
* add consumer comment
* review updates
* fix typo
* make clippy happy
* refactor `Terminated`
* rename ContractStatus to ContractState
* rename status to state
* replace Contribution::Alive to ContractState::Alive
* defer storage deposit charge
* ".git/.scripts/commands/fmt/fmt.sh"
* remove unused imports
* Update frame/contracts/src/migration/v15.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Update frame/contracts/src/storage/meter.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
---------
Co-authored-by: PG Herveou <pgherveou@gmail.com >
Co-authored-by: Toufeeq Pasha <47236805+ToufeeqP@users.noreply.github.com >
Co-authored-by: Sam Johnson <sam@durosoft.com >
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Bastian Köcher <git@kchr.de >
Co-authored-by: gupnik <17176722+gupnik@users.noreply.github.com >
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com >
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
Co-authored-by: command-bot <>
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
2023-08-18 14:24:55 +00:00
Juan
fef9723d65
Jg/13643 contracts migrate to fungible traits ( #14020 )
...
* contracts: refactor currency to use fungible traits
* contracts: refactor currency to use fungible traits
* contracts: add minor improvements
* contracts: max holds config set
* contracts: fix some typos
* contracts: map token errors
* fix typo
* contracts: add 0 balance transfer to test
* contracts: not transfer if value is zero
* contracts: [WIP] add StorageDepositHold
* contracts: add storage deposit held event
* contracts: clean up some code and comments
* contracts: add deposit storage released event
* contracts: update comment
* contracts: update slash cannot kill account test
* contracts: fix tests
* contracts: add some comments to the slashing test
* contracts: add some comments to the slashing test
* contracts: remove references to Currency
* contracts: do not transfer if from equals to
* bound BalanceOf<T>
* added FixedPointOperand to Balance trait
* move migrate sequence to config
* remove commented out code
* Update frame/contracts/src/lib.rs
Co-authored-by: PG Herveou <pgherveou@gmail.com >
* remove Migrations generic
* make runtime use noop migrations
* restrict is_upgrade_supported
* undo is_upgrade_supported change
* Update bin/node/runtime/src/lib.rs
Co-authored-by: PG Herveou <pgherveou@gmail.com >
* add rust doc example for `Migrations`
* feature gate NoopMigration
* fix example code
* improve example
* wip
* remove FixedPointOperand from trait
* trait bound BalanceOf
* more trait bound BalanceOf
* update to use RuntimeHoldReason
* replace Fungible for Currency
* update runtime
* WIP
* make v10 benchmark generic over currency
* solve merge conflicts
* make v12 migration benchmarking generic over DepositPerItem and DepositPerByte
* give some format
* fix tests and old migrations
* add migration v13 placholder
* wip
* wip
* add benchmarking
* add weights
* wip
* [pallet_collective] Enforce prime is a valid member of collective in set_members extrinsic (#14354 )
* Updated set_members extrinsic to enforce prime is valid member of collective
* Added additional tests for set_members extrinsic
* applied the code review suggestions
* update to docify 0.2.0 / crate-relative embed paths (#14570 )
* Fix Society v2 migration (#14421 )
* fix society v2 migration
* Update frame/society/src/migrations.rs
* Update frame/society/src/migrations.rs
Co-authored-by: Bastian Köcher <git@kchr.de >
* Update frame/society/src/migrations.rs
Co-authored-by: Bastian Köcher <git@kchr.de >
* update for versioned upgrade
* fix society v2 migration
* remove references to members being sorted from commnets
* fix type
* fix can_migrate check
* add sanity log
* fix sanity check
* kick ci
* kick ci
* run tests with --experimental flag
* versioned migration cleanup
* revert pipeline change
* use defensive!
* semicolons
* defensive and doc comment
* address pr comment
* feature gate the versioned migration
* defensive_unwrap_or
* fix test
* fix doc comment
* change defensive to a log warning
* remove can_migrate anti-pattern
* Update frame/society/Cargo.toml
Co-authored-by: Bastian Köcher <git@kchr.de >
* add experimental feature warning to doc comment
* update doc comment
* bump ci
* kick ci
* kick ci
* kick ci
---------
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Bastian Köcher <git@kchr.de >
* Moves `Block` to `frame_system` instead of `construct_runtime` and removes `Header` and `BlockNumber` (#14437 )
* Initial setup
* Adds node block
* Uses UncheckedExtrinsic and removes Where section
* Updates frame_system to use Block
* Adds deprecation warning
* Fixes pallet-timestamp
* Removes Header and BlockNumber
* Addresses review comments
* Addresses review comments
* Adds comment about compiler bug
* Removes where clause
* Refactors code
* Fixes errors in cargo check
* Fixes errors in cargo check
* Fixes warnings in cargo check
* Formatting
* Fixes construct_runtime tests
* Uses import instead of full path for BlockNumber
* Uses import instead of full path for Header
* Formatting
* Fixes construct_runtime tests
* Fixes imports in benchmarks
* Formatting
* Fixes construct_runtime tests
* Formatting
* Minor updates
* Fixes construct_runtime ui tests
* Fixes construct_runtime ui tests with 1.70
* Fixes docs
* Fixes docs
* Adds u128 mock block type
* Fixes split example
* fixes for cumulus
* ".git/.scripts/commands/fmt/fmt.sh"
* Updates new tests
* Fixes fully-qualified path in few places
* Formatting
* Update frame/examples/default-config/src/lib.rs
Co-authored-by: Juan <juangirini@gmail.com >
* Update frame/support/procedural/src/construct_runtime/mod.rs
Co-authored-by: Juan <juangirini@gmail.com >
* ".git/.scripts/commands/fmt/fmt.sh"
* Addresses some review comments
* Fixes build
* ".git/.scripts/commands/fmt/fmt.sh"
* Update frame/democracy/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update frame/democracy/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update frame/support/procedural/src/construct_runtime/mod.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update frame/support/procedural/src/construct_runtime/mod.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Addresses review comments
* Updates trait bounds
* Minor fix
* ".git/.scripts/commands/fmt/fmt.sh"
* Removes unnecessary bound
* ".git/.scripts/commands/fmt/fmt.sh"
* Updates test
* Fixes build
* Adds a bound for header
* ".git/.scripts/commands/fmt/fmt.sh"
* Removes where block
* Minor fix
* Minor fix
* Fixes tests
* ".git/.scripts/commands/update-ui/update-ui.sh" 1.70
* Updates test
* Update primitives/runtime/src/traits.rs
Co-authored-by: Bastian Köcher <git@kchr.de >
* Update primitives/runtime/src/traits.rs
Co-authored-by: Bastian Köcher <git@kchr.de >
* Updates doc
* Updates doc
---------
Co-authored-by: command-bot <>
Co-authored-by: Juan <juangirini@gmail.com >
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Bastian Köcher <git@kchr.de >
* Refactor the asset-conversion-tx-payment pallet (#14558 )
* Code refactoring
* Fix imports
* Typo
* Update frame/asset-conversion/src/types.rs
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* Sync docs
---------
Co-authored-by: parity-processbot <>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
* wip
* wip
* wip
* improve try-runtime imports
* fix benchmark test
* improved rustdocs
* improved rustdocs
* remove log
* ignore variable
* reduce caller funding
* move v13 out
* update v13 migration
* v13 migration
* benchmark v13_migration
* fix broken compilation
* ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_contracts
* remove all the `where BalanceOf`
* add Balance to Config
* improve docs
* add new deposit storage error
* remove todo message
* rename migration v13 pre rebase
* fix tests
* add missing migration;
* bump storage version
* apply review suggestions
* improved comment
* remove unnecessary code
* simplify migrations
* mock balance
* mock more for benchmarks
* fix benchmarking tests
* fix benchmarking tests with caller
* improve cargo toml
* solve nit
* Update frame/contracts/src/lib.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/exec.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/exec.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/storage/meter.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* review improvements
* remove extra events
* update cargo
* undo update cargo
* review updates
* remove type Balance
* add extra fields to events
* fix zepter ci
---------
Co-authored-by: PG Herveou <pgherveou@gmail.com >
Co-authored-by: Toufeeq Pasha <47236805+ToufeeqP@users.noreply.github.com >
Co-authored-by: Sam Johnson <sam@durosoft.com >
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: Bastian Köcher <git@kchr.de >
Co-authored-by: gupnik <17176722+gupnik@users.noreply.github.com >
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com >
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
Co-authored-by: command-bot <>
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
2023-08-02 13:51:31 +00:00
PG Herveou
49816ff4d9
Contracts: Ensure latest migration match pallet_version ( #14676 )
...
* Add version check
* fix format
* simplify
* restructure imports
* add version check
* Fix benchmarking
* Rename migrations -> BenchMigrations
* doc
* add more docs
* fix format string
* Update frame/contracts/build.rs
* fix
* add cargo:rerun-if-changed
---------
Co-authored-by: parity-processbot <>
2023-07-31 14:48:53 +00:00
PG Herveou
5a5b1df69b
Contracts Add deposit for dependencies ( #14079 )
...
* wip
* fixes
* rm comment
* join fns
* clippy
* Fix limits
* reduce diff
* fix
* fix
* fix typo
* refactor store to use self
* refactor run to take self by value
* pass tests
* rm comment
* fixes
* fix typo
* rm
* fix fmt
* clippy
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* Update frame/contracts/src/lib.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Update frame/contracts/src/wasm/mod.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Update frame/contracts/src/wasm/mod.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* PR review, rm duplicate increment_refcount
* PR review
* Update frame/contracts/src/wasm/prepare.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Add test for failing storage_deposit
* fix lint
* wip
* Delegate update take 2
* update
* fix migration
* fix migration
* doc
* fix lint
* update migration
* fix warning
* reformat comment
* regenerate weightInfo trait
* fix merge
* PR review
https://github.com/paritytech/substrate/pull/14079#discussion_r1255904563
* PR review
https://github.com/paritytech/substrate/pull/14079/files#r1257521373
* PR review remove optimisation
https://github.com/paritytech/substrate/pull/14079/files#r1263312237
* PR review fix return type
https://github.com/paritytech/substrate/pull/14079/files#r1263315804
* Apply suggestions from code review
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* PR review pass CodeInfo and update docstring
https://github.com/paritytech/substrate/pull/14079/files#r1257522327
* PR review add code_info to the executable
https://github.com/paritytech/substrate/pull/14079/files#r1263309049
* rename info -> contract_info
* Update frame/contracts/src/exec.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/fixtures/add_remove_delegate_dependency.wat
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/migration/v13.rs
* fix tests
* Fmt & fix tests
* Test Result<(), _> return type
* Update frame/contracts/src/migration.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Revert "Test Result<(), _> return type"
This reverts commit a876168f2054edf84d720c666387583ccbe78dcd.
* add / update doc comments
* fix backticks
* Revert "Revert "Test Result<(), _> return type""
This reverts commit 3cbb6161d1abd9520cd9f8519b4dfbf4f29a2998.
* fix bench
* fix bench
* fix
* Update frame/contracts/src/storage/meter.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* rm stale comments
* Apply suggestions from code review
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* PR suggestion
* Add missing doc
* fx lint
* ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_contracts
* Update frame/contracts/src/lib.rs
Co-authored-by: Juan <juangirini@gmail.com >
---------
Co-authored-by: command-bot <>
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
Co-authored-by: Juan <juangirini@gmail.com >
2023-07-26 12:09:02 +00:00
PG Herveou
1818bb130e
Contracts rename v9 to v09 ( #14533 )
2023-07-12 08:33:22 +00:00
Sasha Gryaznov
fda86dd501
contracts: switch to wasmi gas metering ( #14084 )
...
* upgrade to wasmi 0.29
* prepare cleanup
* sync ref_time w engine from the stack frame
* proc_macro: sync gas in host funcs
save: compiles, only gas pushing left to macro
WIP proc macro
proc macro: done
* clean benchmarks & schedule: w_base = w_i64const
* scale gas values btw engine and gas meter
* (re)instrumentation & code_cache removed
* remove gas() host fn, continue clean-up
save
* address review comments
* move from CodeStorage&PrefabWasmModule to PristineCode&WasmBlob
* refactor: no reftime_limit&schedule passes, no CodeStorage
* bugs fixing
* fix tests: expected deposit amount
* fix prepare::tests
* update tests and fix bugs
tests::run_out_of_gas_engine, need 2 more
save: 2 bugs with gas syncs: 1 of 2 tests done
gas_syncs_no_overcharge bug fixed, test passes!
cleaned out debug prints
second bug is not a bug
disabled_chain_extension test fix (err msg)
tests run_out_of_fuel_host, chain_extension pass
all tests pass
* update docs
* bump wasmi 0.30.0
* benchmarks updated, tests pass
* refactoring
* s/OwnerInfo/CodeInfo/g;
* migration: draft, compiles
* migration: draft, runs
* migration: draft, runs (fixing)
* deposits repaid non pro rata
* deposits repaid pro rata
* better try-runtime output
* even better try-runtime output
* benchmark migration
* fix merge leftover
* add forgotten fixtures, fix docs
* address review comments
* ci fixes
* cleanup
* benchmarks::prepare to return DispatchError
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* store memory limits to CodeInfo
* ci: roll back weights
* ".git/.scripts/commands/bench-vm/bench-vm.sh" pallet dev pallet_contracts
* drive-by: update Readme and pallet rustdoc
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* use wasmi 0.29
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* use wasmi 0.30 again
* query memory limits from wasmi
* better migration types
* ci: pull weights from master
* refactoring
* ".git/.scripts/commands/bench-vm/bench-vm.sh" pallet dev pallet_contracts
* addressing review comments
* refactor
* address review comments
* optimize migration
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* another review round comments addressed
* ci fix one
* clippy fix
* ci fix two
---------
Co-authored-by: command-bot <>
2023-07-03 11:04:10 +00:00
PG Herveou
6ac8537436
Update contract multi-block migration ( #14313 )
...
* move migrate sequence to config
* remove commented out code
* Update frame/contracts/src/lib.rs
Co-authored-by: PG Herveou <pgherveou@gmail.com >
* remove Migrations generic
* make runtime use noop migrations
* restrict is_upgrade_supported
* Update contract multi-block migration
Ensure that we do as many steps as possible given the weight limit passed to on_idle
* undo is_upgrade_supported change
* Update bin/node/runtime/src/lib.rs
Co-authored-by: PG Herveou <pgherveou@gmail.com >
* wip
* fix comment (#14316 )
* fix test
* fix
* Update frame/contracts/src/migration.rs
Co-authored-by: Juan <juangirini@gmail.com >
* fix test doc
* Apply suggestions from code review
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Fix compilation with feature runtime-benchmarks
* fix example
* fix cargo doc --document-private-items
* private links
* Remove dup comment
* add doc for MigrationInProgress
* PR review remove duplicate asserts
* simplify upper bound
* fix link
* typo
* typo
* no unwrap()
* correct log message
* missing
* fix typo
* PR comment
* Add example with single element tuple
* Improve migration message
* Update frame/contracts/src/benchmarking/mod.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Update frame/contracts/src/migration.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Update frame/contracts/src/migration.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* use saturating_accrue instead of +=
* add more doc
* Contracts: Better migration types (#14418 )
* Add explicit error, if try-runtime runs a noop migration
* use mut remaining_weight
---------
Co-authored-by: Juan Girini <juangirini@gmail.com >
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
2023-06-20 13:16:28 +00:00
Bastian Köcher
53f4b4df76
Run all tests with try-runtime feature enabled ( #14396 )
...
* Run all tests with `try-runtime` feature enabled
There are some tests that are guarded behind the `try-runtime` feature which are currently not being
executed. This pull requests changes this and enables the feature for the test run.
* Add some docs
* Rename variable
2023-06-16 12:16:19 +02:00
Juan
112a0e7352
Move type Migrations to Config ( #14309 )
...
* move migrate sequence to config
* remove commented out code
* Update frame/contracts/src/lib.rs
Co-authored-by: PG Herveou <pgherveou@gmail.com >
* remove Migrations generic
* make runtime use noop migrations
* restrict is_upgrade_supported
* undo is_upgrade_supported change
* Update bin/node/runtime/src/lib.rs
Co-authored-by: PG Herveou <pgherveou@gmail.com >
* add rust doc example for `Migrations`
* feature gate NoopMigration
* fix example code
* improve example
---------
Co-authored-by: PG Herveou <pgherveou@gmail.com >
2023-06-09 11:04:31 +00:00
PG Herveou
c7c5fc709c
contracts: Multi block migrations ( #14045 )
...
* Frame Add translate_next
This works similarly to to `translate` but only translate a single entry.
This function will be useful in the context of multi-block migration.
* Move to lazy migration
* Updates
* simplify MockMigration
* wip
* wip
* add bench
* add bench
* fmt
* fix bench
* add .
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* Apply suggestions from code review
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Scalfold v10 / v11 fix tests
* PR comment
* tweak pub use
* wip
* wip
* wip
* misc merge master
* misc merge master
* wip
* rm tmp stuff
* wip
* wip
* wip
* wip
* wip
* fixes
* add state
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* fix
* fixed compilation
* clean up logs
* wip
* Revert "Frame Add translate_next"
This reverts commit 10318fc95c42b1f7f25efeb35e6d947ea02bed88.
* Fix v10 logic
* Apply suggestions from code review
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* wip
* fixes
* exercise del_queue
* bump sample size
* fmt
* wip
* blank line
* fix lint
* fix rustdoc job lint
* PR comment do not use dangerous into()
* Ad macros for updating mod visibility
* Add doc
* Add max_weight to integrity_test
* fix compilation
* Add no migration tests
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* fix clippy
* PR review
* Update frame/contracts/src/lib.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Fix master merge
* fix merge 2
* fix tryruntime
* fix lint
---------
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
Co-authored-by: command-bot <>
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
2023-05-31 14:19:31 +00:00
Sergej Sakac
df87bae1a9
BREAKING - Try-runtime: Use proper error types ( #13993 )
...
* Try-state: DispatchResult as return type
* try_state for the rest of the pallets
* pre_upgrade
* post_upgrade
* try_runtime_upgrade
* fixes
* bags-list fix
* fix
* update test
* warning fix
* ...
* final fixes 🤞
* warning..
* frame-support
* warnings
* Update frame/staking/src/migrations.rs
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com >
* fix
* fix warning
* nit fix
* merge fixes
* small fix
* should be good now
* missed these ones
* introduce TryRuntimeError and TryRuntimeResult
* fixes
* fix
* removed TryRuntimeResult & made some fixes
* fix testsg
* tests passing
* unnecessary imports
* Update frame/assets/src/migration.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
---------
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com >
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
2023-05-23 06:56:10 +00:00
Alexander Theißen
82cb69922f
contracts: Upgrade to wasmi 0.28 ( #13312 )
...
* Upgrade to wasmi 0.28
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* Update stale comment
* Renamed variants of `Determinism`
* Compile fix
---------
Co-authored-by: command-bot <>
2023-03-20 23:09:22 +00:00
Vivek Pandya
bc53b9a03a
Remove years from copyright notes. ( #13415 )
...
* Change copyright year to 2023 from 2022
* Fix incorrect update of copyright year
* Remove years from copy right header
* Fix remaining files
* Fix typo in a header and remove update-copyright.sh
2023-02-21 18:46:41 +00:00
Dino Pačandi
dff246e815
pallet-contracts migration pre-upgrade fix for v8 ( #12905 )
...
* Only run pre-v8 migration check for versions older than 8
* Logix fix
2022-12-13 12:09:26 +01:00
Alexander Theißen
3ae4be8662
contracts: Allow indeterministic instructions off-chain ( #12469 )
...
* Allow indetermistic instructions off-chain
* Apply suggestions from code review
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* fmt
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
2022-10-24 17:48:04 +00:00
Alexander Theißen
857c3bf37b
Make automatic storage deposits resistant against changing deposit prices ( #12083 )
...
* Require `FixedPointOperand` for Balances
* Delay deposit calculation
* Make refunds pro rata of consumed storage
* Add storage migration
* Fix clippy
* Add liquidity checks
* Fixe delayed deposit limit enforcement
* Defer charges
* Import Vec
* Add try-runtime hooks for migration
* Fix warning
* Adapt to new OnRuntimeUpgrade trait
* Apply suggestions from code review
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* fmt
* Apply suggestions from code review
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* More suggestions from code review
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
2022-09-21 17:31:22 +00:00
Shawn Tabrizi
1df4561676
Weight v1.5 Follow Ups ( #12155 )
...
* update api
* update
* remove unused
* remove `one` api
* fix unused
* fmt
* add saturating accrue
* remove `Weight::new()`
* use some macros
* div makes no sense
* Update weight_v2.rs
* missed some
* more patch
* fixes
* more fixes
* more fix
* more fix
* Update frame/support/src/weights/weight_v2.rs
* not needed
* fix weight file
2022-09-01 17:48:03 +00:00
Shawn Tabrizi
30951822ba
Weight v1.5: Opaque Struct ( #12138 )
...
* initial idea
* update frame_support
* update a bunch more
* add ord
* adjust RuntimeDbWeight
* frame_system builds
* re-export
* frame_support tests pass
* frame_executive compile
* frame_executive builds
* frame_system tests passing
* pallet-utility tests pass
* fix a bunch of pallets
* more
* phragmen
* state-trie-migration
* scheduler and referenda
* pallet-election-provider-multi-phase
* aura
* staking
* more
* babe
* balances
* bunch more
* sudo
* transaction-payment
* asset-tx-payment
* last pallets
* fix alliance merge
* fix node template runtime
* fix pallet-contracts cc @athei
* fix node runtime
* fix compile on runtime-benchmarks feature
* comment
* fix frame-support-test
* fix more tests
* weight regex
* frame system works
* fix a bunch
* more
* more
* more
* more
* more
* more fixes
* update templates
* fix contracts benchmarks
* Update lib.rs
* Update lib.rs
* fix ui
* make scalar saturating mul const
* more const functions
* scalar div
* refactor using constant functions
* move impl
* fix overhead template
* use compactas
* Update lib.rs
2022-08-31 11:26:13 +00:00
Gavin Wood
ecbd65fb95
Safe and sane multi-item storage removal ( #11490 )
...
* Fix overlay prefix removal result
* Second part of the overlay prefix removal fix.
* Report only items deleted from storage in clear_prefix
* Fix kill_prefix
* Formatting
* Remove unused code
* Fixes
* Fixes
* Introduce clear_prefix host function v3
* Formatting
* Use v2 for now
* Fixes
* Formatting
* Docs
* Child prefix removal should also hide v3 for now
* Fixes
* Fixes
* Formatting
* Fixes
* apply_to_keys_whle takes start_at
* apply_to_keys_whle takes start_at
* apply_to_keys_whle takes start_at
* Cursor API; force limits
* Use unsafe deprecated functions
* Formatting
* Fixes
* Grumbles
* Fixes
* Docs
* Some nitpicks 🙈
* Update primitives/externalities/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Formatting
* Fixes
* cargo fmt
* Fixes
* Update primitives/io/src/lib.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
* Formatting
* Fixes
Co-authored-by: Bastian Köcher <info@kchr.de >
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
2022-05-29 12:56:26 +01:00
Bastian Köcher
74428fa8ac
generate_storage_alias: Rewrite as proc macro attribute ( #11387 )
...
* generate_storage_alias: Rewrite as proc macro attribute
This rewrites the `generate_storage_alias!` declarative macro as proc-macro attribute. While doing
this the name is changed to `storage_alias`. The prefix can now also be the name of a pallet. This
makes storage aliases work in migrations for all kind of chains and not just for the ones that use
predefined prefixes.
* Fix compilation and FMT
* Moare fixes
* 🤦
* ......
* Rework the syntax and support instancing
* FMT
* Prefix variants with `Storage`
* Make it compile
* Fix where clause on rust stable
2022-05-17 18:45:56 -04:00
Qinxuan Chen
8bce841d70
frame_support::pallet_prelude: reexport StorageVersion ( #11408 )
...
* frame_support::pallet_prelude: reexport StorageVersion
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
* cargo fmt
Signed-off-by: koushiro <koushiro.cqx@gmail.com >
2022-05-17 20:28:34 +02:00
Alexander Theißen
bef9b79d7b
contracts: Add test to verify unique trie ids ( #10914 )
...
* Add test to verify unique trie ids
* Rename trie_seed to nonce
* Rename AccountCounter -> Nonce
* fmt
2022-03-10 11:28:00 +00:00
Kian Paimani
1344e43d2d
Remove all stale on_runtime_upgrade hooks in the runtime ( #10650 )
...
* Remove all stale on_runtime_upgrade hooks in the runtime
* add docs
* cleanup
* fix warn
* fix more warnings
* fix offence test
* overwrite the damn UItest
2022-01-19 20:58:47 +01:00
Bastian Köcher
f3662b4bba
Happy new year 2022 ( #10573 )
2022-01-03 09:22:14 +01:00
Gavin Wood
1e24e45ea1
Remove Default bound for AccountId ( #10403 )
...
* Remove Default for AccountId
* More removals of default
* Update frame/authorship/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update frame/authorship/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update frame/authorship/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update frame/authorship/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* More work
* More work
* Remove old code
* More work
* pallet-asset-tx-payment
* tips
* sc-consensus-babe
* sc-finality-grandpa
* sc-consensus-babe-rpc
* sc-cli
* make npos crates accept non-default account (#10420 )
* minimal changes to make npos pallets all work
* make this pesky reduce.rs a bit cleaner
* more work
* more work
* Tests build
* Fix imonline tests
* Formatting
* Fixes
* Fixes
* Fix bench
* Fixes
* Fixes
* Fixes
* Fixes
* Fixes
* Formatting
* Fixes
* Formatting
* Fixes
* Formatting
* Fixes
* Formatting
* Fixes
* Formatting
* Update client/keystore/src/local.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/finality-grandpa/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/keystore/src/local.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update client/keystore/src/local.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update frame/staking/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update frame/staking/src/lib.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Update primitives/runtime/src/traits.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
* Formatting
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: kianenigma <kian@parity.io >
2021-12-13 15:03:59 +01:00
Alexander Theißen
6863476603
contracts: Add storage deposits ( #10082 )
...
* 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: Michael Müller <michi@parity.io >
* 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: Andrew Jones <ascjones@gmail.com >
* 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: Andrew Jones <ascjones@gmail.com >
* Update `Storage::write` docs
* Improve doc
* Remove superflous conditional
* Typos
* Remove superflous clone (refactoring artifact)
* Apply suggestions from code review
Co-authored-by: Andrew Jones <ascjones@gmail.com >
Co-authored-by: Parity Bot <admin@parity.io >
Co-authored-by: Michael Müller <michi@parity.io >
Co-authored-by: Andrew Jones <ascjones@gmail.com >
2021-12-07 12:19:30 +00:00
Alexander Theißen
522e77e243
contracts: Remove state rent ( #9669 )
...
* 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: Parity Bot <admin@parity.io >
2021-09-06 16:40:58 +00:00
Bastian Köcher
4fe55f0bcb
Move PalletVersion away from the crate version ( #9165 )
...
* 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: Guillaume Thiolliere <gui.thiolliere@gmail.com >
* Update frame/support/src/traits/metadata.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com >
2021-07-27 21:21:27 +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
1ac95b6ba6
contracts: Move Schedule from Storage to Config ( #8773 )
...
* 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
2021-05-13 19:56:11 +00:00
François Garillot
052be8bbef
Simplify some Option / Result / ? operator patterns ( #8653 )
...
* Simplify some Option / Result / ? operator patterns
When those match a combinator exactly.
Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust ).
* adjust after review
* adjust post-review
2021-04-23 13:36:10 +00:00
Alexander Theißen
a4e8875897
contracts: Expose rent parameter to contracts ( #8231 )
...
* 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: Parity Benchmarking Bot <admin@parity.io >
2021-03-12 11:21:08 +00:00
Gavin Wood
af9083f53b
Refactor away from opaque hashes ( #5226 )
...
* System.BlockHash
* Fix hash
* Introduce K/V iteration in all _concat maps
Also move across:
- System.Account (blake2_128_concat)
- Balances.Locks (twox_64_concat)
- ElectionsPhragmen.VotesOf (twox_64_concat)
- ElectionsPhragmen.StakeOf (twox_64_concat)
- Identity.IdentityOf (twox_64_concat)
- Identity.SubsOf (twox_64_concat)
- Society.Payouts (twox_64_concat)
- Session.NextKeys (twox_64_concat)
- Identity.SuperOf (blake2_128_concat)
- Session.KeyOwner (blake2_128_concat)
- Society.SuspendedCandidates (twox_64_concat)
- Society.SuspendedMembers (twox_64_concat)
- Society.Vouching (twox_64_concat)
- Society.Strikes (twox_64_concat)
- System.EventTopics
- Balances.Account
* Build fixes
* Ensure migration happens in correct order
* Staking.*
* Vesting.* Offences.*
* Democracy.*
* Babe.* Collective.*
* Grandpa.*
* Assets.* Benchmark.* Contracts.* Elections.* Asset.* Nicks.*
Also introduce real account list
* ImOnline.*
* Treasury.*
* Recovery.*
* Final bits.
* Docs
* Fix one test
* Fix test
* All passing except the UI tests
* Remove linked_map part 1
* Remove linked_map
* Some iterator utils for double maps.
* Remove old migrations
* Introduce tombstone for LinkedMap type
* Migration for genesis hash
* Fix build
* Fix hash
* Rename Map is_linked -> unused, keeping backwards compat (#5256 )
* Update frame/balances/src/lib.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com >
* Update frame/elections/src/lib.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com >
* Remove old migration code.
* Update frame/system/src/lib.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com >
* Update bin/node/runtime/src/lib.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com >
* Fix hash
* fix session migration
* Fix watning
Co-authored-by: Jaco Greeff <jacogr@gmail.com >
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com >
Co-authored-by: Robert Habermeier <rphmeier@gmail.com >
2020-03-16 23:19:53 +01:00
Shawn Tabrizi
74f8db5def
Assign unique storage names to pallets. ( #5010 )
...
* Assign unique storage names to pallets.
* Bump spec
* Upgrade logic for finality tracker (untested)
* Logic for migrating Identity (untested)
* Logic for migrating transaction-payment
* Fix tests
* Fix `decl_storage` build
* Contract -> Contracts
* Update Cargo.lock
* bump spec
* update migration
* Fix merge error
* Migration for contracts
* Remove serde
* Remove some illegal spaces and Options
* Fix types in identity.
* Minor variable rename
Co-authored-by: Gavin Wood <gavin@parity.io >
2020-03-14 12:44:48 +01:00