Squirrel
be8e626806
Set clippy lints in workspace (requires rust 1.74) ( #2390 )
...
We currently use a bit of a hack in `.cargo/config` to make sure that
clippy isn't too annoying by specifying the list of lints.
There is now a stable way to define lints for a workspace. The only down
side is that every crate seems to have to opt into this so there's a
*few* files modified in this PR.
Dependencies:
- [x] PR that upgrades CI to use rust 1.74 is merged.
---------
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com >
Co-authored-by: Branislav Kontur <bkontur@gmail.com >
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com >
2023-12-13 15:11:07 +01:00
Andrew Jones
dfd7b15eff
Contracts: make benchmark dependencies optional in std feature ( #2576 )
...
`wasm-instrument` and `rand` are optional and only used in benchmarking,
so should not be pulled in by default as part of the `std` feature.
2023-12-01 13:19:09 +02:00
Liam Aharon
4a293bc5a2
Enforce consistent and correct toml formatting ( #2518 )
...
Using taplo, fixes all our broken and inconsistent toml formatting and
adds CI to keep them tidy.
If people want we can customise the format rules as described here
https://taplo.tamasfe.dev/configuration/formatter-options.html
@ggwpez, I suggest zepter is used only for checking features are
propagated, and leave formatting for taplo to avoid duplicate work and
conflicts.
TODO
- [x] Use `exclude = [...]` syntax in taplo file to ignore zombienet
tests instead of deleting the dir
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Co-authored-by: Bastian Köcher <git@kchr.de >
2023-12-01 07:38:02 +00:00
PG Herveou
2135fa872b
Contracts: use compiled rust tests ( #2347 )
...
see #2189
This PR does the following:
- Bring the user api functions into a new pallet-contracts-uapi (They
are currently defined in ink!
[here])(https://github.com/paritytech/ink/blob/master/crates/env/src/engine/on_chain/ext.rs )
- Add older api versions and unstable to the user api trait.
- Remove pallet-contracts-primitives and bring the types it defined in
uapi / pallet-contracts
- Add the infrastructure to build fixtures from Rust files and test it
works by replacing `dummy.wat` and `call.wat`
- Move all the doc from wasm/runtime.rs to pallet-contracts-uapi.
This will be done in a follow up:
- convert the rest of the test from .wat to rust
- bring risc-v uapi up to date with wasm
- finalize the uapi host fns, making sure everything is codegen from the
source host fns in pallet-contracts
---------
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
2023-11-29 22:12:19 +01:00
PG Herveou
f517900a48
Contracts expose pallet-xcm ( #1248 )
...
This PR introduces:
- XCM host functions `xcm_send`, `xcm_execute`
- An Xcm trait into the config. that proxy these functions to to
`pallet_xcm`, or disable their usage by using `()`.
- A mock_network and xcm_test files to test the newly added xcm-related
functions.
---------
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com >
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
Co-authored-by: command-bot <>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com >
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
2023-11-14 22:32:14 +02:00
PG Herveou
64effd0e6f
Contracts move fixtures to new crate ( #2246 )
...
Small PR that introduce a new crate that will host RISC-V & wasm
fixtures for testing pallet-contracts
2023-11-10 13:22:47 +02:00
PG Herveou
3148063a6f
Contracts: Add benchmarks to include files ( #2022 )
...
Project that includes pallet-contracts via crates.io will fail to run
```bash
cargo check --features=runtime-benchmarks
```
without the currently not included benchmarks files
2023-10-25 09:47:54 +02:00
Bastian Köcher
f3bf5c1acd
xcm: Change TypeInfo::path to not include staging (#1948 )
...
The `xcm` crate was renamed to `staging-xcm` to be able to publish it to
crates.io as someone as squatted `xcm`. The problem with this rename is
that the `TypeInfo` includes the crate name which ultimately lands in
the metadata. The metadata is consumed by downstream users like
`polkadot-js` or people building on top of `polkadot-js`. These people
are using the entire `path` to find the type in the type registry. Thus,
their code would break as the type path would now be [`staging_xcm`,
`VersionedXcm`] instead of [`xcm`, `VersionedXcm`]. This pull request
fixes this by renaming the path segment `staging_xcm` to `xcm`.
This requires: https://github.com/paritytech/scale-info/pull/197
---------
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com >
2023-10-20 11:21:19 +02:00
Lulu
391591b6a4
Fix mistakes in Cargo.toml ( #1504 )
2023-09-12 12:41:34 +02:00
Alexander Theißen
3f92be2cc2
contracts: Update to wasmi 0.31 ( #1350 )
...
* contracts: Update to wasmi 0.31
* ".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_contracts
---------
Co-authored-by: command-bot <>
2023-09-02 14:41:33 +02:00
Oliver Tale-Yazdi
dcda0e50f5
Fix build profiles ( #1229 )
...
* Fix build profiles
Closes https://github.com/paritytech/polkadot-sdk/issues/1155
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Manually set version to 1.0.0
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use workspace repo
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* 'Authors and Edition from workspace
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2023-08-29 13:39:41 +02:00
alvicsam
f441a5fc93
Diener workspacify
...
Signed-off-by: alvicsam <alvicsam@gmail.com >
2023-08-25 11:05:17 +02:00
PG Herveou
cd464f9cfd
Contracts: Update Config::Debug ( #14789 )
...
* Update Debug trait
* Rename
* tweak
* fmt
* Better namings
* rm unsafe-debug
* rework doc
* nit
* fix comment
* clippy
* update naming
* Rename file
* fmt fixes
* rename
* Move tracing behind umbrella Debugging trait
* fix
* fix comment
* reorder imports
* comment
* update doc
* add missing doc
* add missing doc
* Update Debugging -> Debugger
* Update bin/node/runtime/Cargo.toml
2023-08-24 07:56:28 +00:00
Oliver Tale-Yazdi
8b9455465b
Format and Sort features in Cargo.toml files ( #14803 )
...
* CI: Add feature sorting check
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Sort all features
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add some mistakes
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Revert "Add some mistakes"
This reverts commit b2b1099f979f6decb22d09b46689c1554bb72e81.
* CI job naming
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add oneliner formatting
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Explain tool
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use latest version
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Better erorr message
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Format after master merge
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use --check option
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Messed up the merge commit...
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
---------
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2023-08-23 14:21:52 +00:00
Piotr Mikołajczyk
b24b66c991
Cross-contract calling: simple debugger ( #14678 )
...
* Provide basic breakpoints
* Rename to Observer
* Rename feature. Single trait. Borrow-checker
* : frame_system::Config
* Confused type name
* Minor bugs
* pub trait
* No unnecessary cloning
* Make node compile with all features
* Move everything debug-related to a single module
* Add docs and implementation for ()
* fmt
* Make it feature-gated or for tests
* Prepare testing kit
* Testcase
* Fmt
* Use feature in dev-deps
* ?
* feature propagation
* AAAA
* lol, that doesn't make much sense to me
* Turn on
* clippy
* Remove self dep
* fmt, feature-gating test
* Noop to trigger CI
* idk
* add feature to pipeline
* Corrupt test to see if it is actually being run
* Revert change
* Doc for conf type
* Review
* Imports
* ...
* Remove debug for kitchen-sink
* Move test
* Fix imports
* I must have already tried this one...
2023-08-05 14:15:03 +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
Oliver Tale-Yazdi
77321288c3
Fix Substrate features ( #14660 )
...
* Fix std, runtime-benchmarks and try-runtime features
zepter lint propagate-feature --feature try-runtime --left-side-feature-missing=ignore --workspace --fix --feature-enables-dep="try-runtime:frame-try-runtime"
zepter lint propagate-feature --feature runtime-benchmarks --left-side-feature-missing=ignore --workspace --fix --feature-enables-dep="runtime-benchmarks:frame-benchmarking"
zepter lint propagate-feature --feature std --left-side-feature-missing=ignore --workspace --fix
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add propagate feature CI check
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Test CI by adding an error
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Use --locked
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add help msg
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Revert "Test CI by adding an error"
This reverts commit cf4ff6cc0632269b0a109e547686e5e3314b02de.
* Test CI by adding an error
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* No newline in help msg
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Revert "Test CI by adding an error"
This reverts commit 5daa06ada8e01f5bebafb9d1c76804dd79bc1006.
* Test CI by adding an error
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Revert "Test CI by adding an error"
This reverts commit ca15de5729507a564f140a10ec2e87b19516ec4c.
* Fix msg
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Revert back to master
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Re-do with Zepter v0.7.4
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Update Zepter to 0.7.4
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Disable rococo try-runtime check
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <git@kchr.de >
* More review fixes
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: Bastian Köcher <git@kchr.de >
2023-08-01 20:25:59 +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
Qinxuan Chen
e8e2048b88
chore: update some deps to prune duplicated deps ( #14515 )
...
* chore: update some deps to prune duplicated deps
- array-bytes: 4.1.0 => 6.1.0
- cid: 0.8.6 => 0.9.0
* fix
2023-07-06 16:46:44 +02:00
Sasha Gryaznov
f83fdeab53
contracts: switch from parity-wasm-based to wasmi-based module validation ( #14449 )
...
* 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
* save: scan_exports ported, compiles
* save (wip, not compiles)
* 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
* scan_imports ported
* scan_export ported, other checks removed
* tests fixed
tests fixed
* drop wasmparser and parity-wasm dependencies
* typo fix
* 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
* allow stored modules to have no memory imports
* rollback: allow stored modules to have no memory imports
* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
* address review comments
---------
Co-authored-by: command-bot <>
2023-07-04 21:38:47 +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
Koute
9d1741eb3c
Bump parity-scale-codec to 3.6.1 ( #14428 )
2023-06-21 11:37:11 +00:00
Andrew Jones
31f9593324
Bump version of pallet-contracts-primitives for release ( #14288 )
...
* Bump version of `pallet-contracts-primitives` for release
* Cargo.lock
2023-06-02 15:01:45 +01: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
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
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
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
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
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
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
Alexander Theißen
cce6d406bf
Remove fixtures from crate ( #13181 )
2023-01-19 17:56:35 -03:00
Gavin Wood
2d7fa18e73
Make DispatchError impl MEL ( #13169 )
...
* Make DispatchError impl MEL
* Upgrade SCALE codec to support `codec(skip)` for MEL
Co-authored-by: Bastian Köcher <info@kchr.de >
2023-01-19 16:47:47 +00:00
Sasha Gryaznov
c336eae64a
[contracts] Add per local weight for function call ( #12806 )
...
* Add per local weight for function call
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
* Update frame/contracts/src/benchmarking/mod.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* apply suggestions from code review
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
* Update frame/contracts/src/benchmarking/mod.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
* tune the benchmark
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
* fix benches
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
Co-authored-by: command-bot <>
Co-authored-by: Alexander Theißen <alex.theissen@me.com >
2022-12-06 09:52:12 +00:00
Alexander Theißen
edce3ead3b
contracts: Replace cargo feature unstable-interface with config ( #12787 )
...
* Replace cargo feature with config
* Update frame/contracts/proc-macro/src/lib.rs
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
2022-11-30 14:19:14 +00:00
Alexander Theißen
0068716b5a
contracts: Don't put unstable functions in special module ( #12781 )
...
* Don't put unstable functions in special module
* Apply suggestions from code review
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* cargo fmt
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
2022-11-27 12:27:03 +01:00
Alexander Theißen
08657f14b7
contracts: Replace sp-sandbox and wasmi-validation by newest wasmi ( #12501 )
...
* Replace sp-sandbox and wasmi-validation by just wasmi
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
* Re-check original code on re-instrumentation
* Fix clippy
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
* Apply suggestions from code review
Co-authored-by: Robin Freyler <robin.freyler@gmail.com >
* Replace wasmi by ::wasmi
* Bump wasmi to 0.20
* Add explanation for `unreachable`
* Change proof
* Fixup master merge
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
* Fixup naming inconsistencies introduced by reentrancy PR
* Fix `scan_imports` docs
* Apply suggestions from code review
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Fixup suggestions
* Remove unnecessary &mut
* Fix test
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
* Fix benchmark merge fail
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
* Fix docs as suggested by code review
* Improve docs for `CodeRejected`
* Apply suggestions from code review
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
* Fix logic bug when setting `deterministic_only`
* Don't panic when module fails to compile
* Apply suggestions from code review
Co-authored-by: Robin Freyler <robin.freyler@gmail.com >
Co-authored-by: command-bot <>
Co-authored-by: Robin Freyler <robin.freyler@gmail.com >
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com >
2022-11-24 23:51:36 +01:00
Andrew Jones
d5a5f3673e
Release sp-keyring and pallet-contracts-primitives 7.0.0 ( #12716 )
...
* Bump sp-keyring
* Bump pallet-contracts-primitives
* Cargo.lock
2022-11-16 10:07:56 +00:00
Niklas Adolfsson
2b8af8cb1a
release sp-core 7.0.0 and sp-runtime 7.0.0 ( #12599 )
...
* chore(release): sp-core v7.0.0
* chore(release): sp-runtime v7.0.0
* fix bad merge
2022-11-15 14:54:14 +00:00
Alexander Theißen
261c5fd6dd
Use Option<Weight> for contract dry-runs ( #12429 )
2022-10-06 08:11:53 +00:00
Alexander Theißen
bb9d2fa75a
Remove contracts RPCs ( #12358 )
...
* Remove contracts RPCs
* Remove serde as RPC serialization is no longer needed
* Rename folder to match crate name
* Compile fix
* Remove Byte wrapper
2022-10-02 15:16:45 +00:00
Xavier Lau
86198c5471
Use array-bytes for All Array/Bytes/Hex Operations ( #12190 )
...
* Use `array-bytes` for All Array/Bytes/Hex Operations
Signed-off-by: Xavier Lau <xavier@inv.cafe >
* Reorder
* Self Review
* Format
* Fix Tests
* Bump `array-bytes`
* Optimize large test res
Signed-off-by: Xavier Lau <xavier@inv.cafe >
Co-authored-by: parity-processbot <>
2022-09-21 06:12:20 +00:00
Alexander Theißen
4a6e78b8df
Bump wasm-instrument ( #12234 )
...
* Bump wasm-instrument
* Fix benchmarks
2022-09-15 06:00:11 +00:00
Oliver Tale-Yazdi
45966d509e
Fix Rust features ( #11976 )
...
* Add std feature
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix features
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* WIP
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix features
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fmt
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix features
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Cleanup
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Impl function also in tests
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Make compile
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Fix sp-trie feature
Something makes the bench regression guard fail, maybe this?
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Add runtime-benchmarks feature to sc-service
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
* Revert "Fix sp-trie feature"
This reverts commit f2cddfe41bc72e6f2f8133795ec9408ba0c3ec63.
Was already fixed, only needed a CI retry.
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io >
2022-09-14 16:31:58 +00:00
Alexander Theißen
5afe00d89c
Upgrade wasm crate dependencies ( #12173 )
...
* Upgrade wasm crate dependencies
* New wasmi version changed error output a bit
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
Co-authored-by: command-bot <>
2022-09-08 12:48:19 +00:00
Alexander Theißen
8dbfcd3928
contracts: Composable ChainExtension ( #11816 )
...
* Add `RegisteredChainExtension`
* Add tests
* Update frame/contracts/src/chain_extension.rs
Co-authored-by: Michael Müller <michi@parity.io >
* Add more docs
* Remove debugging leftover
* Make ChainExtension-registry lowercase
* Apply suggestions from code review
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
* Improve clarity of test inputs
Co-authored-by: Michael Müller <michi@parity.io >
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com >
2022-07-14 18:14:28 +00:00
dependabot[bot]
a5d0a65bf4
Bump scale-info from 2.0.1 to 2.1.1 ( #11420 )
...
Bumps [scale-info](https://github.com/paritytech/scale-info ) from 2.0.1 to 2.1.1.
- [Release notes](https://github.com/paritytech/scale-info/releases )
- [Changelog](https://github.com/paritytech/scale-info/blob/master/CHANGELOG.md )
- [Commits](https://github.com/paritytech/scale-info/commits/v2.1.1 )
---
updated-dependencies:
- dependency-name: scale-info
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-16 10:07:00 +02:00
dependabot[bot]
ee084279c8
Bump scale-info from 2.0.0 to 2.0.1 ( #10965 )
...
Bumps [scale-info](https://github.com/paritytech/scale-info ) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/paritytech/scale-info/releases )
- [Changelog](https://github.com/paritytech/scale-info/blob/master/CHANGELOG.md )
- [Commits](https://github.com/paritytech/scale-info/commits )
---
updated-dependencies:
- dependency-name: scale-info
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>
2022-03-02 21:13:24 +01:00
Andrew Jones
a3a7fe9041
Release primitive crates ( #10937 )
...
* cargo set-version --bump major -p pallet-contracts-primitives
* cargo set-version --bump major -p sp-core
* cargo set-version --bump major -p sp-runtime-interface
* cargo set-version --bump major -p sp-wasm-interface
* cargo set-version --bump major -p sp-runtime
* cargo set-version --bump major -p sp-storage
* cargo set-version --bump major -p sp-rpc
* cargo set-version --bump major -p sp-io
* cargo set-version --bump major -p sp-trie
* cargo set-version -p sp-state-machine -- 0.12.0
* cargo set-version -p sp-externalities -- 0.12.0
* cargo set-version -p sp-keystore -- 0.12.0
* cargo set-version --bump major -p sp-keyring
* cargo set-version --bump major -p sp-version
* cargo set-version --bump major -p sp-tracing
* cargo set-version --bump major -p sp-application-crypto
* cargo set-version --bump major -p sp-arithmetic
* cargo unleash version bump-major -p sp-runtime-interface-proc-macro
* Add codec max-encoded-len feature to sp-arithmetic
* cargo unleash version bump-major -p sp-core-hashing-proc-macro
2022-03-01 14:35:23 +01:00
wigy
535325d2e6
Upgrading parity-scale-codec to v3 ( #10825 )
...
* Upgraded dependencies
* Adapting code to scale v3
* Empty commit to trigger CI
* Triggering CI
* Fixing UI test
* Remove superfluous dev-dep added by #9228
* Cryout for CI
2022-02-24 15:34:34 +01:00
Davide Galassi
a2b80edf12
Replace libsecp256k1 with k256 in FRAME related code ( #10883 )
...
* Replace libsecp256k1 with k256 in beefy-mmr
* Port of FRAME `contracts` benchmarking from `libsecp256k1` to `k256`
* Newtype to allow `Pcg32` rng usage with `k256` in contracts benchmarks
* Use `sp-io::crypto` to generate dummy keys in `contracts` bechmarks
* More compact code
* Cargo fmt
* Build `sp-keystore` only for dev profile
* Move public key generation back to the `map`
2022-02-23 10:17:47 +01:00