* Add transactional storage functionality to OverlayChanges
A collection already has a natural None state. No need to
wrap it with an option.
* Add storage transactions runtime interface
* Add frame support for transactions
* Fix committed typo
* Rename 'changes' variable to 'overlay'
* Fix renaming change
* Fixed strange line break
* Rename clear to clear_where
* Add comment regarding delete value on mutation
* Add comment which changes are covered by a transaction
* Do force the arg to with_transaction return a Result
* Use rust doc comments on every documentable place
* Fix wording of insert_diry doc
* Improve doc on start_transaction
* Rename value to overlayed in close_transaction
* Inline negation
* Improve wording of close_transaction comments
* Get rid of an expect by using get_or_insert_with
* Remove trailing whitespace
* Rename should to expected in tests
* Rolling back a transaction must mark the overlay as dirty
* Protect client initiated storage tx from being droped by runtime
* Review nits
* Return Err when entering or exiting runtime fails
* Documentation fixup
* Remove close type
* Move enter/exit runtime to excute_aux in the state-machine
* Rename Discard -> Rollback
* Move child changeset creation to constructor
* Move child spawning into the closure
* Apply suggestions from code review
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Fixup for code suggestion
* Unify re-exports
* Rename overlay_changes to mod.rs and move into subdir
* Change proof wording
* Adapt a new test from master to storage-tx
* Suggestions from the latest round of review
* Fix warning message
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Enable the `runtime-wasm` for wasm builds
This enables the `runtime-wasm` feature for wasm builds. The feature is
not mandatory and will only be activated if it exists in the
`Cargo.toml`.
* Fix compilation
* Update docs
* Uprgade version
* Apply suggestions from code review
* switching to released wasmtime
* update depdencies in general
* Update fdlimit
* Update parity common deps
* Also update schnorrkel
* update kvdb-rocksdb
* update further dependents
* also update primitive types
* update cargo.lock
* update merlin
* Bumping evm version
* Version bump
* Split generate_changelog.sh into separate script
Can be run in the format `generate_changelog.sh $previous_version $version`.
* remove early exit from publish_draft_release.sh
* adding changelog
* ci: change last_github_release to also find pre-releases
Co-authored-by: Martin Pugh <pugh@s3kr.it>
* Use CLI to configure max instances cache
* Fix tests
* Move default value into CLI
* Use SmallVec
* Apply review comments
* Get rid of `SmallVec`
Co-authored-by: Bastian Köcher <git@kchr.de>
* Don't include `:code` by default in storage proofs (#5060)
* Adds test to verify that the runtime currently is always contained in
the proof
* Start passing the runtime wasm code from the outside
* Fix compilation
* More build fixes
* Make the test work as expected now :)
* Last fixes
* Fixes benchmarks
* Review feedback
* Apply suggestions from code review
Co-Authored-By: Sergei Pepyakin <sergei@parity.io>
* Review feedback
* Fix compilation
Co-authored-by: Sergei Pepyakin <s.pepyakin@gmail.com>
* Fix compilation and change the way `RuntimeCode` works
* Fix tests
* Switch to `Cow`
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>
Co-authored-by: Sergei Pepyakin <s.pepyakin@gmail.com>
This reduces the usage of `Blake2Hasher` in the code base and replaces
it with `BlakeTwo256`. The most important change is the removal of the
custom extern function for `Blake2Hasher`. The runtime `Hash` trait is
now also simplified and directly requires that the implementing type
implements `Hashable`.
This updates `parity-scale-codec` to `1.2.0`, which includes multiple
performance improvements and a fix that bounds the capacity of a vector
at decoding.
* setting first batch of descriptions
* fix what I just broke
* next batch
* and pallets, too
* last batch
* set cargo.lock
* keep'em dev-deps
* bump version to alpha.2
* repro ui bug
* fix the tests
* test with the new image
* test without CARGO_HOME
* test without fixes
* test again
* fix trybuild old versions
* bump CArgo.lock
* fix trybuild newest versions
* bump Cargo.lock
* trying on the latest image
* bump Cargo.lock
* run with the old image
* ci will be green on the image from 2020-02-19 [skip ci]
* bump Cargo.lock
* adding unleash to ci
* fixing formatting
* with a dot please
* alpha.3 now
* do not publish testing helpers
* remove old test-helpers cruft
* fix cargo.lock
* with alpha 4
* do not publish runtime-interface-test either
* disable more test crates from publishing
* switch to alpha.5
* replace tempdir with tempfile
* update lru
* switch to bytes 0.5
* release script fixes
* switch on and to latest alpha
* BUT THE SPACES
* setting versions to development pre-release
fixing version in dependencies
* unset already released wasm-builder
* do not publish test crates
* adding licenses
* setting homepage metadata
* set repository url
* Fix memory leak in runtime interface
We used `slice::from_raw_parts` in runtime-interface which did not free
the memory afterwards. This pr changes it to `Vec::from_raw_parts` to
make sure `drop` is called properly and the values are freed.
* Check that `len` is non-zero
* Adds comment
* WASM runtime switch to import memory
Up to now runtimes have exported their memory. To unify it with
sandboxing, this pr switches runtimes to import memory as well.
From a functional perspective, exporting/importing memory makes no
difference to the runtime.
To provide backwards compatibility, WASM exported memory is still supported.
* Revert debug stuff
* Revert some stuff
* Support `u128`/`i128` in runtime interface
This implements support for `u128`/`i128` as parameters/return value in
runtime interfaces. As we can not pass them as identity, as for the
other primitives types, we pass them as an pointer to an `[u8; 16]` array.
* Remove some unsafe code usage
* Make debug builds more usable
This pr makes debug builds more usable in terms of `cargo run -- --dev`.
1. `--dev` activates `--execution native`, iff `--execution` is not
given or no sub `--execution-*` is given.
2. It was probably a mistake to compile WASM in debug for a debug build.
So, we now build the WASM binary always as `release` (if not requested
differently by the user). So, we trade compilation time for a better
debug experience.
* Make sure we only overwrite default values
* Make it work
* Apply suggestion
By using `cfg(doc)`, we can generate docs for modules which are only
available from `no_std`. This drastically improves the documentation for
the developers.