* Move `create_inherents` into the block-builder
This moves the `create_inherents` call into the block-builder. This has
the advantage that `create_inherents` will be able to reuse the same
context that will be used when applying the extrinsics and we also save
one call to `on_initialize`. To make sure that `create_inherents` does
not modify any state, we execute it in a transaction that is
rolled-back after doing the runtime call.
* Feedback and build fix
* Update primitives/runtime/src/lib.rs
Co-authored-by: Sergei Shulepov <sergei@parity.io>
* Update client/block-builder/src/lib.rs
Co-authored-by: Sergei Shulepov <sergei@parity.io>
With the switch to `decode_all_with_depth_limit` we silently broken
support for functions with multiple arguments. The old generated code
tried to decode each parameter separately, which does not play well with
`decode_all`.
This pr adds a test to ensure that this does not happen again and fixes
the bug by decoding everything at once by wrapping it into tuples.
* 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>
* Drop client from sc-network and sc-client-db, move LongestChain to sc-client-api
* move leaves, cht, in_mem to sc-client-api, drop client from sc-finality-grandpa
* drop sc-service from sc-rpc
* drop sc-service from sc-consensus-aura
* drop sc-client from manual-seal and babe
* drop sc-client from utils/frame/rpc/system and utils/frame/benchmarking-cli
* drop sc-client from bin/node and bin/node-template
* drop sc-client
* fix tests
* remove check -p sc-client from gitlab.yml
* fix warnings
* fixes ui test
* fix light client tests
* adds associated Client type to AbstractService
* adds UsageProvider to Client
* fixed ui test, again
* tried and failed to get node-cli to compile for wasm
* thanks to tomaka for helping me get node-cli to compile for wasmm
* ui test pls pas 🙏🏾
* all tests passing 🪄
* no_run documentation code
* rm -f documentation code
* ClientProvider
* fix mega trait
* move LongestChain to sc-consensus, use adds minimal bounds to AbstractService::Client
* adds license to sc-consensus
Co-authored-by: Benjamin Kampmann <ben@parity.io>
* `decl_runtime_apis!` - check that a method without `changed_in` exists
This adds another check to the macro that ensures that not only methods
with `changed_in` exists, but there are also the default methods exist.
* Update primitives/api/proc-macro/src/decl_runtime_apis.rs
Co-Authored-By: Nikolay Volf <nikvolf@gmail.com>
* Fix test
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
* Implements mocking of runtime apis
This pr adds support for easily mock runtime api implementations for
tests by using the `mock_impl_runtime_apis!` macro. The syntax is
similar to `impl_runtime_apis!`. The mocked implementation automatically
implements `ApiExt`, `ApiErrorExt` and `Core` as these are required by
the runtime api traits, but not required in tests or only a subset of them.
* Fix warnings
* Update primitives/api/proc-macro/src/utils.rs
Co-Authored-By: Nikolay Volf <nikvolf@gmail.com>
* Review feedback
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
* 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`.
* 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>
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
* 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