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
Alexandru Vasile
3da9449067
Bump sp-crates from latest crates.io version + release ( #14265 )
...
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
2023-05-31 12:11:01 +00:00
dependabot[bot]
a8edaf47d5
Bump quote from 1.0.27 to 1.0.28 ( #14253 )
...
* Bump quote from 1.0.27 to 1.0.28
Bumps [quote](https://github.com/dtolnay/quote ) from 1.0.27 to 1.0.28.
- [Release notes](https://github.com/dtolnay/quote/releases )
- [Commits](https://github.com/dtolnay/quote/compare/1.0.27...1.0.28 )
---
updated-dependencies:
- dependency-name: quote
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
* bump ci
---------
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sam Johnson <sam@durosoft.com >
2023-05-29 18:13:48 +00:00
Alexandru Vasile
98a0550ea2
Release: Bump SP crates to release on crates.io ( #14237 )
...
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
2023-05-29 10:40:59 +00:00
Bastian Köcher
05da6d8e84
HoldReason: Improve usage ( #13869 )
...
* HoldReason: Improve usage
`HoldReason` was switched recently to use the `composite_enum` attribute that will merge the enums
from all pallets in the runtime to `RuntimeHoldReason`. `pallet-nis` was still requiring that the
variant was passed as constant to call `hold`. The proper implementation is to use the `HoldReason`
from inside the pallet directly when calling `hold`. This is done by adding a `RuntimeHoldReason` as
type to the `Config` trait and requiring that `Currency` is using the same reason. Besides that the
pr changes the name `HoldIdentifier` in `pallet_balances::Config` to `RuntimeHoldReason`.
* Update frame/nis/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Review comment
* Fixes
---------
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2023-05-24 21:59:34 +00:00
dependabot[bot]
acadc6d147
Bump syn from 2.0.15 to 2.0.16 ( #14196 )
...
Bumps [syn](https://github.com/dtolnay/syn ) from 2.0.15 to 2.0.16.
- [Release notes](https://github.com/dtolnay/syn/releases )
- [Commits](https://github.com/dtolnay/syn/compare/2.0.15...2.0.16 )
---
updated-dependencies:
- dependency-name: syn
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 15:55:41 +02: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
Sasha Gryaznov
d2575f0e5a
add error logging to call_runtime ( #14082 )
2023-05-05 14:34:21 +00:00
juangirini
b8a01127d7
contracts: add events to ContractResult ( #13807 )
...
* contracts: add events to ContractResult
* contracts: add encoded events to ContractResult
* contracts: add generic Event to ContractResult
* contracts: test bare_call events
* contracts: update bare_call test name
* contracts: add better comments to dry run events
* contracts: fix pallet contracts primitives implementation
* contracts: add EventRecord generic to ContractInstantiateResult
* contracts: make event collection optional
* contracts: impreved notes on `collect_events`
* contracts: update benchmarking calls
* contracts: change bare_call and bare_instantiate to accept enums instead of bools
* contracts: add partial eq to new enums
* contracts: improve comments
* contracts: improve comments
* contracts: fix bare_call benchmarking
* contracts: fix bare call and instantiate in impl_runtime_apis
* contracts: add api versioning to new ContractsApi functions
* contracts: modify api versioning to new ContractsApi functions
* contracts: create new contracts api trait
* contracts: clean up code
* contracts: remove the contract results with events
* contracts: undo contracts api v3
* contracts: remove commented out code
* contracts: add new test bare call result does not return events
* contracts: add code review improvements
* contracts: remove type imports
* contracts: minor code review improvements
2023-05-03 13:45:04 +00:00
juangirini
5db4119f93
contracts: Make Origin information available ( #13708 )
...
* contracts: allow root calls
* contracts: update ContractOrigin
* contracts: test allow root calls
* contracts: rustfmt
* contracts: test root caller traps
* contracts: add Caller enum
* contracts: improve some comments
* contracts: improve some comments
* contracts: format code with +nightly
* contracts: fix failing tests
* contracts: improve charte instantiate call when root origin
* contract: refactor common, call and instantiate inputs
* contracts: fix some failing test
* contracts: trap caller when there is no account id
* Update frame/contracts/src/lib.rs
Co-authored-by: PG Herveou <pgherveou@gmail.com >
* Update frame/contracts/src/exec.rs
Co-authored-by: PG Herveou <pgherveou@gmail.com >
* contracts: make `into_deposit` return zero when the origin is root
* contracts: cargo fmt
* contracts: charging and terminating tests refactored
* contracts: improved errors
* contracts: refactor & merge ContractOrigin cand Caller enums
* Update frame/contracts/src/lib.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* contracts: apply suggested pr changes
* contracts: rename Caller to Origin
* contracts: refactor run fn
* contracts: cr improvements
* contracts: allow root to use delegate call
* contracts: add caller_is_root weight
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* contracts: add caller_is_root benchmarking
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* contracts: add caller_is_root benchmarking
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* contracts: add some minor improvements
* contracts: make caller_is_root runtime fn unstable
* contracts: fix failing wasm test
* contracts: update benchmarking for origin_is_root
* contracts: improve seal_caller_is_root benchmarking
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* contracts: add small pr improvements
* contracts: fix broken tests after master merge
* contracts: acknowledge the default storage deposit limit
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* contracts: move origin to CommonInput
* contracts: add some extra tests
* contracts: move ensure origin logic inside invokable::run_guarded
* contracts: add minor improvements
* contracts: fix caller_is_root benchmarking
* contracts: improve function description
* Update frame/contracts/src/lib.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Update frame/contracts/src/lib.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Update frame/contracts/src/wasm/runtime.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* contracts: improve function description
---------
Co-authored-by: parity-processbot <>
Co-authored-by: PG Herveou <pgherveou@gmail.com >
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
2023-05-02 16:45:14 +00:00
PG Herveou
4df004d0d4
Contracts: runtime_call and storage_deposit ( #13990 )
...
* wip
* add comments
* fix comment
* comments
* comments
* PR comment
* field orders
* Update frame/contracts/src/tests.rs
* Update frame/contracts/fixtures/call_runtime_and_call.wat
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Apply suggestions from code review
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Apply suggestions from code review
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Update frame/contracts/src/tests.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Validate fees of failed call
* Update frame/contracts/src/tests.rs
* Update frame/contracts/src/tests.rs
* Update frame/contracts/src/tests.rs
* bubble up refund error
* rename fixture file
---------
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
Co-authored-by: parity-processbot <>
2023-04-29 16:07:55 +00:00
PG Herveou
ac6e43e628
contracts Fix store-call test path ( #14028 )
2023-04-27 10:01:12 +00:00
PG Herveou
34780b1b2b
contracts Add storage_deposit test ( #14003 )
...
* contracts Add storage_deposit test
* fix comments
* PR comments
2023-04-27 08:23:01 +02:00
Sasha Gryaznov
356b752d58
fix a test ( #14021 )
2023-04-26 13:46:44 +00:00
Sasha Gryaznov
60310de7d6
[contracts] Port host functions to Weight V2 and storage deposit limit ( #13565 )
...
* added [unstable][seal2] call()
* updated test to cover new seal_call proof_limit
* docs updated
* add [seal2][unstable] instantiate() and test
* add [seal2][unstable] weight_to_fee() + docs and test
* add [seal2][unstable] gas_left() + docs and test
* update benchmarks
* add DefaultDepositLimit to pallet Config
* specify deposit limit for nested call
add test for nested call deposit limit
save: separate deposit limit for nested calls
* specify deposit limit for nested instantiate
save: works with test
cleaned up debugging outputs
* update benchmarks
* added missing fixtures
* fix benches
* pass explicit deposit limit to storage bench
* explicit deposit limit for another set_storage bench
* add more deposit limit for storage benches
* moving to simplified benchmarks
* moved to simplified benchmarks
* fix seal_weight_to_fee bench
* fix seal_instantiate benchmark
* doc typo fix
* default dl for benchmarking
more dl for tests
dl for tests to max
deposit_limit fix in instantiate bench
fix instantiate bench
fix instantiate benchmark
fix instantiate bench again
remove dbg
fix seal bench again
fixing it still
seal_instantiate zero deposit
less runs to check if deposit enough
try
try 2
try 3
try 4
* max_runtime_mem to Schedule limits
* add default deposit limit fallback check to test
* weight params renaming
* fmt
* Update frame/contracts/src/benchmarking/mod.rs
Co-authored-by: PG Herveou <pgherveou@gmail.com >
* prettify inputs in tests
* typestate param refactored
---------
Co-authored-by: PG Herveou <pgherveou@gmail.com >
2023-04-26 11:27:13 +00:00
PG Herveou
c11cb1b274
contracts Add LOG_TARGET constant ( #14002 )
...
* contracts Add LOG_TARGET constant
* Update frame/contracts/src/lib.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
---------
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
2023-04-25 11:46:20 +00:00
PG Herveou
0824b060b4
Update macro use and optimize storage collection ( #13970 )
2023-04-21 17:24:12 +02:00
Sasha Gryaznov
3c1fb62621
stabilize call_runtime ( #13901 )
2023-04-13 13:57:28 +00:00
Oliver Tale-Yazdi
ebfe00d590
Fixes PoV over-estimation ( #13766 )
...
* Align log
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use max instead of sum
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Make comment ordering deterministic
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Dont add Pov overhead when all is ignored
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update test pallet weights
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Re-run weights on bm2
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix test
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Actually use new weights
Fucked up the merge for this file...
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update contract weights
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2023-04-13 13:11:58 +00:00
Sam Johnson
b83bf4784e
Globally upgrade to syn 2.x and latest quote and proc_macro2 1x versions ( #13846 )
...
* globally upgrade quote to latest 1.0.x (1.0.26)
* globally upgrade syn to final 1.0.x version (1.0.109)
* globally upgrade proc-macro2 to 1.0.56
* upgrade to syn v2.0.13 and fix everything except NestedMeta
* fix parse nested metadata code in decl_runtime_apis.rs
* Port more stuff to syn 2.0
* Make the rest compile
* Ignore error
* update to syn 2.0.14
---------
Co-authored-by: Bastian Köcher <info@kchr.de >
2023-04-12 18:42:22 +00:00
PG Herveou
03c99fe003
contracts: add sr25519_verify ( #13724 )
...
* wip
* fix
* wip
* fix lint
* rm fixture fix
* missing comment
* fix lint
* add comment to the wsm file
* fix comment
* Apply suggestions from code review
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* wip
* wip weights
* wip weights
* PR comment: test with return code
* wip
* PR review add mock test
* remove
* lint
* Update frame/contracts/fixtures/sr25519_verify.wat
* fix comments
* Update frame/contracts/src/benchmarking/mod.rs
* Update frame/contracts/src/wasm/runtime.rs
* Update frame/contracts/fixtures/sr25519_verify.wat
* Update frame/contracts/src/benchmarking/mod.rs
* fix lint
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* Update frame/contracts/src/wasm/runtime.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* PR: review use unstable + remove arbitrary index 4
* Add benchmark for calculating overhead of calling sr25519_verify
* fix message length encoding
* fix weights
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* Apply suggestions from code review
* Update frame/contracts/src/wasm/runtime.rs
* Update frame/contracts/src/wasm/runtime.rs
* Update frame/contracts/src/benchmarking/mod.rs
* Update frame/contracts/src/benchmarking/mod.rs
* Update frame/contracts/src/schedule.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Update frame/contracts/src/schedule.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Update frame/contracts/src/wasm/runtime.rs
* Update frame/contracts/src/wasm/runtime.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* PR review
---------
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
Co-authored-by: command-bot <>
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
2023-04-12 14:49:10 +00:00
Roman Useinov
376a288fb6
[Deps] Bump scale-info to match cumulus and polkadot ( #13873 )
...
* [Deps] Bump scale-info to match cumulus and polkadot
* fix Cargo.lock
* fix identity
* more fixes
* fix
* fixes
* more fixes
2023-04-12 14:14:06 +02:00
Sasha Gryaznov
d3f5c70dde
update links to ink! ( #13819 )
2023-04-05 04:34:42 +00:00
Oliver Tale-Yazdi
36957d6760
Deprecate V1 Weights ( #13699 )
...
* Remove deprecated pallet calls
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Deprecate old weight
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update Runtime API
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Delete shitty code
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix doctest
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update frame/alliance/src/lib.rs
Co-authored-by: Koute <koute@users.noreply.github.com >
* Add doc
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* contracts: Use u64 as old weight type
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update frame/contracts/src/lib.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Koute <koute@users.noreply.github.com >
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
Co-authored-by: parity-processbot <>
2023-04-04 18:57:21 +00:00
PG Herveou
8d802eece0
contracts: make test work with debugger ( #13776 )
...
* contracts: make test work with debugger
* fix path
* PR review
* Add comment
* space
* Update frame/contracts/src/tests.rs
* lint
* spelling
2023-03-31 19:44:29 +02:00
PG Herveou
1bd5d2f78d
[Contracts] Overflowing bounded DeletionQueue allows DoS against contract termination ( #13702 )
...
* [Contracts review] Overflowing bounded `DeletionQueue` allows DoS against contract termination
* wip
* wip
* wip
* wip
* wip
* fix doc
* wip
* PR review
* unbreak tests
* fixes
* update budget computation
* PR comment: use BlockWeights::get().max_block
* PR comment: Update queue_trie_for_deletion signature
* PR comment: update deletion budget docstring
* PR comment: impl Default with derive(DefaultNoBound)
* PR comment: Remove DeletedContract
* PR comment Add ring_buffer test
* remove missed comment
* misc comments
* contracts: add sr25519_recover
* Revert "contracts: add sr25519_recover"
This reverts commit d4600e00934b90e5882cf5288f36f98911b51722.
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* PR comments update print_schedule
* Update frame/contracts/src/benchmarking/mod.rs
* Update frame/contracts/src/storage.rs
* Update frame/contracts/src/storage.rs
* rm temporary fixes
* fix extra ;
* Update frame/contracts/src/storage.rs
Co-authored-by: juangirini <juangirini@gmail.com >
* Update frame/contracts/src/storage.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/lib.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Update frame/contracts/src/lib.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* Support stable rust for compiling the runtime (#13580 )
* Support stable rust for compiling the runtime
This pull request brings support for compiling the runtime with stable Rust. This requires at least
rust 1.68.0 to work on stable. The code is written in a way that it is backwards compatible and
should automatically work when someone compiles with 1.68.0+ stable.
* We always support nightlies!
* 🤦
* Sort by version
* Review feedback
* Review feedback
* Fix version parsing
* Apply suggestions from code review
Co-authored-by: Koute <koute@users.noreply.github.com >
---------
Co-authored-by: Koute <koute@users.noreply.github.com >
* github PR commit fixes
* Revert "Support stable rust for compiling the runtime (#13580 )"
This reverts commit 0b985aa5ad114a42003519b712d25a6acc40b0ad.
* Restore DeletionQueueMap
* fix namings
* PR comment
* move comments
* Update frame/contracts/src/storage.rs
* Update frame/contracts/src/storage.rs
* fixes
---------
Co-authored-by: command-bot <>
Co-authored-by: juangirini <juangirini@gmail.com >
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
Co-authored-by: Bastian Köcher <git@kchr.de >
Co-authored-by: Koute <koute@users.noreply.github.com >
2023-03-31 11:03:56 +00:00
Kasper Ziemianek
acec84cc1e
contracts: proper event link in docs ( #13729 )
2023-03-28 16:38:13 +02:00
PG Herveou
836f544c86
contracts: Add host function tracing ( #13648 )
2023-03-27 19:33:59 +02:00
Alexander Theißen
27ccf17db5
contracts: Follow up for benchmark simplification ( #13635 )
...
* Rename BATCHES -> RUNS
* Reduce runs of slow benchmarks
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
---------
Co-authored-by: command-bot <>
2023-03-21 10:46:25 +01: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
Davide Galassi
480396fe06
Keystore overhaul (iter 2) ( #13634 )
...
* Remove bloat about remote keystore
* Update docs and remove unused 'KeystoreRef' trait
* Use wherever possible, MemoryKeystore for testing
* Remove unrequired fully qualified method syntax for Keystore
2023-03-20 18:21:26 +00:00
Gavin Wood
5d81f23f8f
Deprecate Currency; introduce holds and freezing into fungible traits ( #12951 )
...
* First reworking of fungibles API
* New API and docs
* More fungible::* API improvements
* New ref-counting logic for old API
* Missing files
* Fixes
* Use the new transfer logic
* Use fungibles for the dispatchables
* Use shelve/restore names
* Locking works with total balance.
* repotting and removal
* Separate Holds from Reserves
* Introduce freezes
* Missing files
* Tests for freezing
* Fix hold+freeze combo
* More tests
* Fee-free dispatchable for upgrading accounts
* Benchmarks and a few fixes
* Another test
* Docs and refactor to avoid blanket impls
* Repot
* Fit out ItemOf fully
* Add events to Balanced traits
* Introduced events into Hold traits
* Fix Assets pallet tests
* Assets benchmarks pass
* Missing files and fixes
* Fixes
* Fixes
* Benchmarks fixes
* Fix balance benchmarks
* Formatting
* Expose fungible sub modules
* Move NIS to fungible API
* Fix broken impl and add test
* Fix tests
* API for `transfer_and_hold`
* Use composite APIs
* Formatting
* Upgraded event
* Fixes
* Fixes
* Fixes
* Fixes
* Repot tests and some fixed
* Fix some bits
* Fix dust tests
* Rename `set_balance`
- `Balances::set_balance` becomes `Balances::force_set_balance`
- `Unbalanced::set_balance` becomes `Unbalances::write_balance`
* becomes
* Move dust handling to fungibles API
* Formatting
* Fixes and more refactoring
* Fixes
* Fixes
* Fixes
* Fixes
* Fixes
* Fixes
* Fixes
* Fixes
* Fixes
* Use reducible_balance for better correctness on fees
* Reducing hold to zero should remove entry.
* Add test
* Docs
* Update frame/support/src/traits/tokens/fungibles/hold.rs
Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com >
* Update frame/support/src/traits/tokens/fungibles/regular.rs
Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com >
* Update frame/support/src/traits/tokens/fungible/hold.rs
Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com >
* Update frame/support/src/traits/tokens/fungible/regular.rs
Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com >
* Docs
* Docs
* Docs
* Fix NIS benchmarks
* Doc comment
* Remove post_mutation
* Fix some tests
* Fix some grumbles
* Enumify bool args to fungible(s) functions
* Fix up assets and balances
* Formatting
* Fix contracts
* Fix tests & benchmarks build
* Typify minted boolean arg
* Typify on_hold boolean arg; renames
* Fix numerous tests
* Fix dependency issue
* Privatize dangerous API mutate_account
* Fix contracts (@alext - please check this commit)
* Remove println
* Fix tests for contracts
* Fix broken rename
* Fix broken rename
* Fix broken rename
* Docs
* Update frame/support/src/traits/tokens/fungible/hold.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* remove from_ref_time
* Update frame/executive/src/lib.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Update frame/executive/src/lib.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Reenable test
* Update frame/support/src/traits/tokens/fungibles/hold.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Update frame/support/src/traits/tokens/fungible/hold.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Update frame/support/src/traits/tokens/fungible/hold.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Update frame/support/src/traits/tokens/fungible/hold.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Update frame/support/src/traits/tokens/currency.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Update frame/lottery/src/tests.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Update frame/support/src/traits/tokens/fungible/mod.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Update frame/support/src/traits/tokens/fungible/regular.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Update frame/support/src/traits/tokens/fungibles/freeze.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Update frame/support/src/traits/tokens/fungible/regular.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Update frame/support/src/traits/tokens/fungibles/hold.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Update frame/support/src/traits/tokens/fungibles/hold.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Update frame/support/src/traits/tokens/fungibles/hold.rs
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
* Rename UnwantedRemoval to UnwantedAccountRemoval
* Docs
* Formatting
* Update frame/balances/src/lib.rs
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update primitives/runtime/src/lib.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
* handle_raw_dust oes nothing
* Formatting
* Fixes
* Grumble
* Fixes
* Add test
* Add test
* Tests for reducible_balance
* Fixes
* Fix Salary
* Fixes
* Disable broken test
* Disable nicely
* Fixes
* Fixes
* Fixes
* Rename some events
* Fix nomination pools breakage
* Add compatibility stub for transfer tx
* Reinstate a safely compatible version of Balances set_balance
* Fixes
* Grumble
* Update frame/nis/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_balances
* disable flakey tests
* Update frame/balances/src/lib.rs
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
* Grumbles
* Grumble
---------
Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com >
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
Co-authored-by: Anthony Alaribe <anthonyalaribe@gmail.com >
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com >
Co-authored-by: command-bot <>
2023-03-18 14:47:55 +00:00
PG Herveou
8fcd235e38
contracts: Refactor trait Ext::*_storage_transparent functions ( #13600 )
...
* Refactor _transparent methods
rewrote commits, stashed the typo changes to remove some diff noise
fixed my unverified email commit
* remove type alias
* Get rid of From<Fix/VarSizedKey> impl blocks
* Get rid of KeyType impl block
* remove unnecessary Key export
* Update frame/contracts/src/exec.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* PR review comment
---------
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
2023-03-17 23:17:21 +01:00
PG Herveou
f5773795e9
Fix typos in pallet-contracts ( #13629 )
...
* Fix typos in pallet-contracts
2023-03-17 16:31:51 +01:00
Davide Galassi
f110941b7f
Keystore overhaul ( #13615 )
...
* Remove 'supported_keys' 'sign_with_any' and 'sign_with_all' from keystore trait
* Remove the aync keystore
* Renaming:
- SyncCryptoStore -> Keystore
- SyncCryptoStorePtr -> KeystorePtr
- KeyStore -> MemoryKeystore
* Fix authority discovery worker and tests
* Rename 'insert_unknown' to 'insert'
* Remove leftover
2023-03-17 11:24:14 +00:00
Alexander Theißen
91bb2d29ca
contracts: Simplify benchmarks ( #13595 )
...
* Remove batching
* Benchmark in bytes not kilobytes
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* Add rationale for picking batch numbers
---------
Co-authored-by: command-bot <>
2023-03-16 19:19:48 +00:00
Oliver Tale-Yazdi
3a3d93afee
Update all weights ( #13614 )
...
* Empty commit
* ".git/.scripts/commands/bench/bench.sh" all
---------
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
Co-authored-by: command-bot <>
2023-03-16 17:57:45 +01:00
Sasha Gryaznov
f85d6dc6dd
[contracts] Forbid calling back to contracts after switching to runtime ( #13443 )
...
* save: compiles and tests pass
* save: added global
* done + test
* cleanup
* changelog update
* cleanup
* address feedback, step 1
* address feedback, step 2
* address feedback, step 3
* returned updated gas_estimation_call_runtime test
* clippy fix
* address feedback, step 4
* address feedback, step 5
* move data from context to inputs
* docs fix
* Apply suggestions from code review
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* address feedback, step 6
---------
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
2023-03-06 08:40:03 +00:00
Oliver Tale-Yazdi
9e56e1acdd
Deprecate Weight::from_{ref_time, proof_size} ( #13475 )
...
* Deprecate Weight::from_{ref_time, proof_size}
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update templates
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use from_parts
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use from_parts
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Dont revert comment 🤦
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_balances
* Update weight files
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* More fixes
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Adapt to Master changes
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: command-bot <>
2023-03-02 21:28:17 +00:00
Piotr Mikołajczyk
9720a8749a
Expose ChargedAmount ( #13488 )
...
* Expose `ChargedAmount`
* Fix imports
2023-03-01 14:35:32 +01: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
Sasha Gryaznov
ac13aaeb2f
rename call_runtime() returned error ( #13412 )
2023-02-20 16:45:54 +01:00
Alexander Theißen
330484bb19
contracts: Don't rely on reserved balances keeping an account alive ( #13369 )
...
* Move storage deposits to their own account
* Take ed for contract's account from origin
* Apply suggestions from code review
Co-authored-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Update stale docs
* Use 16 bytes prefix for address derivation
* Update frame/contracts/src/address.rs
Co-authored-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
* Fix merge
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* Update frame/contracts/primitives/src/lib.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
---------
Co-authored-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
Co-authored-by: command-bot <>
2023-02-16 15:58:28 +00:00
Alexander Theißen
1c04ab0f6f
contracts: Use proof_size from benchmarks ( #13268 )
...
* Avoid reading contract code when it is supplied in the extrinsic
* Remove custom proof size injection from schedule
* Set benchmarks pov_mode to Measure
* Reduce overestimation of code size on re-instrument
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* Do not override proof size from benchmark
* Do not charge proof size for basic block
* Incrase gas limit for tests
* Fix deletion queue to also use `proof_size`
* Fix tests
* Update frame/contracts/src/schedule.rs
Co-authored-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
* Fix wrong schedule macro invocations
* Remove stale docs
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* Handle zero components
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* Fix instruction weight
---------
Co-authored-by: command-bot <>
Co-authored-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
2023-02-15 22:56:50 +01:00
Sasha Gryaznov
53b7778599
[contracts] make debug_message execution outcome invariant to node debug logging setting ( #13197 )
...
* update benchmark for seal_debug_message
* add seal_debug_message_per_kb benchmark
* un-fallable debug buffer: silently drops excessive and wrong utf-8 encoded messages
* charge debug_message per byte of the message
* improved benchmark
* cap debug_message
* ".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 >
* fix applied buggy suggestion
* make sure i*1024 < MaxDebugBufferLen
* fix schedule for our non-batched benchmark
* Switch to a `wasmtime` fork with LTO linking failure workaround
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
---------
Co-authored-by: command-bot <>
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
Co-authored-by: Jan Bujak <jan@parity.io >
2023-02-14 18:28:34 +00:00
Alexander Theißen
00d626c801
Rework generated API docs ( #13178 )
2023-02-08 16:40:45 -03:00
Oliver Tale-Yazdi
fc2fda8d19
Rename pallet-random-collective-flip to Insecure... ( #13301 )
...
* Rename pallet-random-collective-flip to Insecure...
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* fmt
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2023-02-06 18:12:06 +00:00
Alexandru Vasile
4b2cc67fc6
Metadata V15: Derive TypeInfo for describing runtime types ( #13272 )
...
* scale_info: Derive TypeInfo for types present in runtime API
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
* cargo: Update Cargo.lock
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
---------
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io >
2023-02-02 19:14:40 +02:00
Sam Johnson
c9361bed1a
migrate new benchmarking syntax from frame_support::benchmarking to frame_benchmarking::v2 ( #13235 )
...
* * re-export frame_support::benchmarking in frame_benchmarking::
* prefer use frame_benchmarking::*; in examples, etc
* switch to frame_benchmarking::v2
* completely migrate new benchmarking code out of frame_support
* fix doc links
* remove unneeded return
Co-authored-by: Bastian Köcher <git@kchr.de >
* remove another unneeded return
Co-authored-by: Bastian Köcher <git@kchr.de >
* properly export all macros in v1
* refactor existing frame_benchmarking imports to use ::v1
---------
Co-authored-by: Bastian Köcher <git@kchr.de >
2023-01-27 20:59:39 +00:00
Dan Henton
ae8ef86ec0
Use non-binary pronouns in comments. ( #13209 )
...
* use non binary pronouns in comments
* cargo fmt
* fix the use of "it" with "they" when dealing about an opperations identity
2023-01-27 12:31:17 +01:00