* Refactor sr-api to not depend on client anymore
* Fix benches
* Apply suggestions from code review
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Apply suggestions from code review
* Adds first version of traits for generating the host functions
* First steps of the procedural macro
* Implements generation of the host extern functions
* Prefix ext host function with snake case trait name
* Implement host functions implementation on the host
* Change `HostFunctions` interface
* Implement `HostFunctions` for tuples
* Make `WasmExecutor` generic over the host functions
* Begin to add a test and make it compile
* Make the test succeed
* Add test to ensure that host functions are not found
* It's alive! Make the `set_storage` test work
* Add test for mutable references
* Code cleanup and documentation etc
* Add marker trait for types that should be passed as SCALE encoded
* Inherit the visibility from the trait and more improvements
* More impls and move them into their own file
* Code simplification by dropping one trait
* Give it a better name
* Implement traits for arrays
* Refactor code to support pass by codec/inner
* Docs
* Implement pass by inner for some crypto types and add a test
* Implement exchangeable function support
* Rewrite sr-io with as runtime interface
* Start reworking after master merge
* Adds `PassByCodec` derive
* Adds `PassByInner` derive
* Fix compilation errors
* More implementations
* Implement runtime interface traits for `str`
* Make `sr-io` compile again
* Fix more compilation errors
* More progress on getting stuff back to compile
* More compilation fixes
* Fix warnings
* Remove le conversions
* Add support for `wasm_only` interfaces
* Implement `Allocator` interface
* Improve error message
* Move `WasmAllocator` to `sr-io` and more clean ups
* Use correct function signature for wasm functions
* Store the host functions with the Wasm runtime
* Docs update
* Fix compilation after master merge
* Remove `sr-io/without_std`
* Make `srml-support` tests run again
* More compilation error fixes
* Use correct doc syntax
* Fix test-runtime
* Fix compilation
* Catch native panics when executing the wasm runtime
As with the native runtime, we now catch all native panics when we
execute the wasm runtime. The panics inside the wasm runtime were
already catched before by the wasm executor automatically, but any panic
in the host functions could bring down the node. The recent switch to
execute the native counterpart of the host function in `sr-io`, makes
this change required. The native `sr-io` functions just `panic` when
something is not provided or any other error occured.
* Fix compilation
* Don't panic in a panic
* Move `sr-sandbox` to new runtime interface
* Fixes tests after sandbox changes
* Make sure we detect invalid utf8
* Fixes after master merge
* Adds pass by enum strategy
* Fix wasmtime integration
* Some macro structure clean up
* Rework and test exchangebale host functions
* PassBy derive macros documentation
* Docs for `runtime_interface` macro
* Support wild card argument names
* Adds ui tests
* Make sure that we are backwards compatible to the old runtime interfaces
* Documentation
* Fixes after latest master merge
* Make `wasmtime` happy
* Make `full_crypto` work
* Make the new interface versionable
* Rename `Sanboxing` to `Sandbox`
* Don't finalize in test while importing
* Fix Performance regression
* Fix test
* grandpa: Write Grandpa authorities to well known key.
Instead of requiring execution proofs for Grandpa authorities, this
enables much simpler storage proofs.
* grandpa: Introduce named AuthorityList type.
* grandpa: Storage migration for srml-grandpa module.
* Remove no-longer-used GrandpaApi runtime API.
* grandpa: Write AuthorityList to storage with encoding version.
We expect the AuthorityList type may change (eg. key changes). To make
upgrades smoother, include a version in the stored value.
* Bump node runtime spec version.
* Update srml/grandpa/src/lib.rs
Co-Authored-By: André Silva <andre.beat@gmail.com>
* Remove footgun around session keys/handlers
- `OpaqueKeys` now has an associated type `KeyTypeIdProviders`. This can
be used in the runtime as input for `SessionHandler` from the session
trait.
- `impl_opaque_keys` now works with modules and extracts the `KeyTypeId`
from the module directly.
- Added some checks to the `session` storage initialization that checks
that the `SessionHandler` and `Keys` use the same number of keys and
that the order is equal.
* Update core/sr-primitives/src/traits.rs
* fix node-template
Use MultiSignature to maintain compatibility with substrate-node
Reset version to 1
Remove unused const
* fix chain_spec
* line width
* Wasm-builder-runner unset `CARGO_TARGET_DIR` and release 1.0.4
`CARGO_TARGET_DIR` needs to be unset or otherwise cargo deadlocks,
because cargo always holds an exclusive lock on target dir.
* Commit missing version up
* Lock file
* Initial draft that compiles
* Extract payment stuff from balances
* Extract multiplier update stuff from system
* Some fixes.
* Update len-fee as well
* some review comments.
* Remove todo
* bump
This function executes the given closure in a context where the test
externalities are set. This makes the srml tests easier to write, as the
test externalities need to be created anyway.
* Move `Externalities` into `substrate-externalities`
- `Externalities` now support generic extensions
- Split of `primtives-storage` for storage primitive types
* Move the externalities scoping into `substrate-externalities`
* Fix compilation
* Review feedback
* Adds macro for declaring extensions
* Fix benchmarks
* Introduce `ExtensionStore` trait
* Last review comments
* Implement it for `ExtensionStore`
* Update all dependencies
* Upgrade dependencies whenever “easy”
“easy” means that there are no major changes required.
* Fix build and bump paste dependency to 0.1.6
* Remove dead code
* Re-add = dependency for futures-preview
* Add missing std features for runtime-io
* Remove git dependencies
as updated versions have been published to crates.io
* try to debug bug
* For sr-io, "std" should imply "no_oom" and "no_panic_handler".
Otherwise, rustc complains (correctly) about duplicate lang items.
* Add missing "runtime-io/std" features
* Fix compilation errors
* Prevent duplicate lang items
Rust does not allow duplicate lang items. When compiled without the
`std` feature, `sr-io` defines two lang items. Therefore, `sr-io`
compiled without `feature = "std"` must not be linked with `std`.
However, `pwasm-utils` and `wasmi-validation` both bring in `std` unless
compiled with `default-features = "false"`. This caused a duplicate
lang item error. Building both with `default-features = "false"`
prevents this error. When building with `feature = "std"`, they should
both be built with the `std` feature, so this feature needs to be
explicitly depended on.
* Bump `impl_version`
* Make tests pass
Three tests used 1 less gas than they had previously.
* Try to un-break build
* Add a Cargo.lock file
* Revert offchain code
* Revert "Revert offchain code"
This reverts commit d216d08cc6ca0344614669c1d24cde3aa5c0d4e2.
* Don’t try to send a body with a GET request
without adding a Transfer-Encoding or Content-Length header.
This has always been wrong, but hyperium/hyper#1925 hid the bug until
hyper was upgraded to 0.12.35.
* Change some more GET requests to POST requests
* Fix excess line width and remove an `extern crate`
* Delete commented-out extern crate
Co-Authored-By: Sergei Pepyakin <sergei@parity.io>
* Fix regression in Cargo.toml files
dev-dependencies need `default-features = false`, too.
* Bump parity-wasm dependency
* Bump `futures-preview`
* Apply suggestions from code review
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Update Cargo.lock files
* Apply suggestions from code review
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Update core/service/src/chain_ops.rs
Co-Authored-By: Sergei Pepyakin <sergei@parity.io>
* always fetch epoch from runtime
* node integration tests don't test light nodes
* give stand-in full node a FULL role
* rejig babe APIs
* introduce next-epoch-descriptor type
* overhaul srml-BABE epoch logic
* ensure VRF outputs end up in the right epoch-randomness
* rewrite `do_initialize` to remove unnecessary loop
* begin accounting for next epoch in epoch function
* slots passes header to epoch_data
* pass slot_number to SlotWorker::epoch_data
* begin extracting epoch-change logic into its own module
* aux methods for block weight
* aux methods for genesis configuration
* comment-out most, refactor header-check pipeline
* mostly flesh out verifier again
* reinstantiate babe BlockImport implementation
* reinstate import-queue instantiation
* reintroduce slot-worker implementation
* reinstate pretty much all the rest
* move fork-choice logic to BlockImport
* fix some, but not all errors
* patch test-runtime
* make is_descendent of slightly more generic
* get skeleton compiling when passing is_descendent_of
* make descendent-of-builder more succinct
* restore ordering of authority_index / slot_number
* start fiddling with tests
* fix warnings
* improve initialization architecture and handle genesis
* tests use correct block-import
* fix BABE tests
* fix some compiler errors
* fix node-cli compilation
* all crates compile
* bump runtime versions and fix some warnings
* tweak fork-tree search implementation
* do backtracking search in fork-tree
* node-cli integration tests now work
* fix broken assumption in test_connectivity
* babe tests fail for the right reasons.
* test genesis epoch logic for epoch_changes
* test that epochs can change between blocks
* First BABE SRML test
* Testing infrastructure for BABE
Also includes a trivial additional test.
* Apply suggestions from code review
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* A little more test progress
* More work on BABE testing
* Try to get the tests working
* Implement `UintAuthorityId`-based test mocks
* Fix compilation errors
* Adjust to upstream changes
* Block numbers are ignored in BABE epoch calculation
* authority_index() should ignore invalid authorities
* Fix compile error
* Add tests that session transitions happen
* Check if BABE produces logs
It currently does not.
* Fix test suite
This was really nasty, due to a type confusion that showed up as an
off-by-1 buffer error.
* Add additional tests
Most of these were derived from the current output, so they are only
useful to guard against regressions.
* Make the tests more readable
Also bump impl_version.
* Fix excessive line width
* Remove unused imports
* Update srml/babe/src/lib.rs
Co-Authored-By: André Silva <andre.beat@gmail.com>
* try to fix imports
* Fix build errors in test suite
* tests did not pass
* Try to get at least one digest to be output
Currently, the code emits either no digests (if I don’t call
`Session::rotate_session()` or two digests (if I do), which is wrong.
* More tests
They still don’t work, but this should help debugging.
* fix silly error
* Don’t even try to compile a broken test
* remove broken check_epoch test and add one for genesis epoch
* Check that the length of the pre-digests is correct
* Bump `impl_version`
* use epoch_for_descendent_of even for genesis
* account for competing block 1s
* finish srml-babe docs
Co-Authored-By: André Silva <andre.beat@gmail.com>
* address grumbles
* Implement support for `patch` section in wasm-builder
* Update core/utils/wasm-builder/src/wasm_project.rs
* Support patch by path
* Go down to the actual data
* srml-system checks
* wip
* more modules compiles
* node-runtime checks
* build.sh passes
* include dispatch error in failed event
* revert some unnecessary changes
* refactor based on comments
* more compile error fixes
* avoid unnecessary into
* reorder code
* fixes some tests
* manually implement encode & decode to avoid i8 workaround
* more test fixes
* more fixes
* more error fixes
* Apply suggestions from code review
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* address comments
* test for DispatchError encoding
* tyep alias for democracy
* make error printable
* line width
* fix balances tests
* fix executive test
* fix system tests
* bump version
* ensure consistent method signature
* Apply suggestions from code review
Co-Authored-By: Gavin Wood <github@gavwood.com>
* changes based on review
* Add issue number for TODOs
* fix
* line width
* fix test
* Update core/sr-primitives/src/lib.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Update core/sr-primitives/src/traits.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Update srml/council/src/motions.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Update srml/council/src/motions.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* update based on review
* More concrete macro matching
* fix test build issue
* Update hex-literal dependency version. (#3141)
* Update hex-literal dep version.
* Update lock file.
* Start to rework the new error handling
* More work to get it back compiling
* Start to fix after master merge
* The great transaction error handling refactoring
* Make `decl_error` errors convertible to `&'static str`
* Make srml-executive build again
* Fix `sr-primitives` tests
* More fixes
* Last round of fix ups
* Fix build
* Fix build
* Apply suggestions from code review
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Rename some stuff
* Fixes after master merge
* Adds `CheckBlockGasLimit` signed extension
* Remove debug stuff
* Fix srml-balances test
* Rename `InvalidIndex` to `CannotLookup`
* Remove weird generic parameters
* Rename function again
* Fix import
* Document the signed extension
* Change from `Into` to `From`
* Update srml/contracts/src/lib.rs
Co-Authored-By: Sergei Pepyakin <sergei@parity.io>
* Fix compilation
* Update srml/contracts/src/lib.rs
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Update core/sr-primitives/src/transaction_validity.rs
Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
* Remove unused code
* Fix compilation
* Some cleanups
* Fix compile errors
* Make `TransactionValidity` a `Result`
* Apply suggestions from code review
Co-Authored-By: Gavin Wood <gavin@parity.io>
* Beautify the code a little bit and fix test
* Make `CannotLookup` an inherent error declared by `decl_error!`
* Adds some documentation
* Make `ApplyOutcome` a result
* Up the spec_version
* Apply suggestions from code review
Co-Authored-By: Gavin Wood <gavin@parity.io>
Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>
* Adds `WASM_TARGET_DIRECTORY` env variable to `wasm-builder`
* Create the `wasm-builder-runner`'s in a common workspace
* Make `wasm-builder` trigger less rebuilds
* Version up
* Adds script for building only the WASM files
* Apply suggestions from code review
Co-Authored-By: André Silva <andre.beat@gmail.com>
Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>
In order to have authorities (validators) discover each other, they need
to publish their public addresses by their ip address on the Kademlia
Dht indexed by their public key. This payload needs to be signed by a
key identifying them as a valid authority.
Code inside `/core` does not know the current set of authorities nor
can it assume what kind of cryptography primitives are currently in use.
Instead it can retrieve its public key and the current set of
authorities from the runtime and have it sign and verify Dht payloads.
This commit enables code in `/core` to do so by introducing a srml
module and runtime api to:
1. Retrieve own public key.
2. Retrieve public keys of current authority set.
3. Sign a Dht payload.
4. Verify a Dht payload.
This commit makes the logic from the previous commit
(`core/consensus/common/primitives.ConsensusApi`)
cf80af9255 obsolete and thus removes it.
* Remove offline slashing logic from staking.
* Initial version of reworked offence module, can report offences
* Clean up staking example.
* Commit SlashingOffence
* Force new era on slash.
* Add offenders in the SlashingOffence trait.
* Introduce the ReportOffence trait.
* Rename `Offence`.
* Add on_before_session_ending handler.
* Move offence related stuff under sr-primitives.
* Fix cargo check.
* Import new im-online implementation.
* Adding validator count to historical session storage as it's needed for slash calculations
* Add a comment about offence.
* Add BabeEquivocationOffence
* GrandpaEquivocationOffence
* slash_fraction and fix
* current_era_start_session_index
* UnresponsivnessOffence
* Finalise OnOffenceHandler traits, and stub impl for staking.
* slash_fraction doesn't really need &self
* Note that offenders count is greater than 0
* Add a test to ensure that I got the math right
* Use FullIdentification in offences.
* Use FullIndentification.
* Hook up the offences module.
* Report unresponsive validators
* Make sure eras have the same length.
* Slashing and rewards.
* Fix compilation.
* Distribute rewards.
* Supply validators_count
* Use identificationTuple in Unresponsivness report
* Fix merge.
* Make sure we don't slash if amount is zero.
* We don't return an error from report_offence anymo
* We actually can use vec!
* Prevent division by zero if the reporters is empty
* offence_forces_new_era/nominators_also_get_slashed
* advance_session
* Fix tests.
* Update srml/staking/src/lib.rs
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
* slashing_performed_according_exposure
* Check that reporters receive their slice.
* Small clean-up.
* invulnerables_are_not_slashed
* Minor clean ups.
* Improve docs.
* dont_slash_if_fraction_is_zero
* Remove session dependency from offences.
* Introduce sr-staking-primitives
* Move offence under sr_staking_primitives
* rename session_index
* Resolves todos re using SessionIndex
* Fix staking tests.
* Properly scale denominator.
* Fix UnresponsivnessOffence
* Fix compilation.
* Tests for offences.
* Clean offences tests.
* Fix staking doc test.
* Bump spec version
* Fix aura tests.
* Fix node_executor
* Deposit an event on offence.
* Fix compilation of node-runtime
* Remove aura slashing logic.
* Remove HandleReport
* Update docs for timeslot.
* rename with_on_offence_fractions
* Add should_properly_count_offences
* Replace ValidatorIdByIndex with CurrentElectedSet
ValidatorIdByIndex was querying the current_elected set in each call, doing loading (even though its from cache), deserializing and cloning of element.
Instead of this it is more efficient to use `CurrentElectedSet`. As a small bonus, the invariant became a little bit easier: now we just rely on the fact that `keys` and `current_elected` set are of the same length rather than relying on the fact that `validator_id_by_index` would work similar to `<[T]>::get`.
* Clarify babe equivocation
* Fix offences.
* Rename validators_count to validator_set_count
* Fix squaring.
* Update core/sr-staking-primitives/src/offence.rs
Co-Authored-By: Gavin Wood <gavin@parity.io>
* Docs for CurrentElectedSet.
* Don't punish only invulnerables
* Use `get/insert` instead of `mutate`.
* Fix compilation
* Update core/sr-staking-primitives/src/offence.rs
Co-Authored-By: Gavin Wood <gavin@parity.io>
* Update srml/offences/src/lib.rs
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
* Update srml/im-online/src/lib.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Update srml/im-online/src/lib.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Update srml/im-online/src/lib.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Update srml/babe/src/lib.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Update core/sr-staking-primitives/src/offence.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Update core/sr-staking-primitives/src/offence.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Update core/sr-staking-primitives/src/offence.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Update core/sr-staking-primitives/src/offence.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Update core/sr-staking-primitives/src/offence.rs
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Add aura todo.
* Allow multiple reports for single offence report.
* Fix slash_fraction calculation.
* Fix typos.
* Fix compilation and tests.
* Fix staking tests.
* Update srml/im-online/src/lib.rs
Co-Authored-By: Logan Saether <x@logansaether.com>
* Fix doc on time_slot
* Allow slashing only on current era (#3411)
* only slash in current era
* prune journal for last era
* comment own_slash
* emit an event when old slashing events are discarded
* Pave the way for pruning
* Address issues.
* Try to refactor collect_offence_reports
* Other fixes.
* More fixes.
* Scale trait and move to u32 blocknumbers.
* Fixes
* Cleanups
* Update node/runtime/src/lib.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Fix up some of the factory stuff.
* Update core/sr-primitives/src/traits.rs
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>
* Move Nonce/Index to u32 (#3361)
* Force a non-borked version of upstream crate
* Line lengths and runtime version bump
* Using child storage, (srml-support only), test failing .
* fix simple tests.
* Enumerable by requiring owned struct (previous form only allow
&'static).
Broken tests are from genesis init.
* implement for_child_keys_with_prefix
* indent
* clear_child_prefix fix.
* clear_child_prefix fix 2.
* fix for storage_impl, if/when allowing child and not child this could be
reverted.
* Fix lot of urlinked child genesis, still need to look upon actual
genesis srml module code.
Probably still a lot of broken code needing debugging.
* switch well_known_key to their associated module child trie.
Fix a genesis init (balance).
Complete some testing.
Comment some tests before using.
* fixing test runtime child keys
* latest commit fix broken genesis init
* fix system balances child name.
* Important fix: storage_root from test externalities need children (it is
already the case for ext).
* executive root with child calculation
* Avoid empty trie on test ext.
* Symetric removal of key for system.
* commenting changes related tests.
* Remove child module specifics.
* fix issues.
* fix some formatting
* fix bench and bump runtime
* Remove extend_storage_overlays, assimilate_storage do the same as is
proper considering srml macro.
* Fix warning for assimilate.
* Removing kill as they do not impact any test cases.
* Use tuple of storage map instead of two parameters. This changes the
behavior of decl_storage genesis build closure (breaking api).
* Do not use build storage before assimilate.
* fix error
* Update core/state-machine/src/backend.rs
* Add Call type to extensible transactions.
Cleanup some naming
* Merge Resource and BlockExhausted into just Exhausted
* Fix
* Another fix
* Call
* Some fixes
* Fix srml tests.
* Fix all tests.
* Refactor crypto so each application of it has its own type.
* Introduce new AuthorityProvider API into Aura
This will eventually allow for dynamic determination of authority
keys and avoid having to set them directly on CLI.
* Introduce authority determinator for Babe.
Experiment with modular consensus API.
* Work in progress to introduce KeyTypeId and avoid polluting API
with validator IDs
* Finish up drafting imonline
* Rework offchain workers API.
* Rework API implementation.
* Make it compile for wasm, simplify app_crypto.
* Fix compilation of im-online.
* Fix compilation of im-online.
* Fix more compilation errors.
* Make it compile.
* Fixing tests.
* Rewrite `keystore`
* Fix session tests
* Bring back `TryFrom`'s'
* Fix `srml-grandpa`
* Fix `srml-aura`
* Fix consensus babe
* More fixes
* Make service generate keys from dev_seed
* Build fixes
* Remove offchain tests
* More fixes and cleanups
* Fixes finality grandpa
* Fix `consensus-aura`
* Fix cli
* Fix `node-cli`
* Fix chain_spec builder
* Fix doc tests
* Add authority getter for grandpa.
* Test fix
* Fixes
* Make keystore accessible from the runtime
* Move app crypto to its own crate
* Update `Cargo.lock`
* Make the crypto stuff usable from the runtime
* Adds some runtime crypto tests
* Use last finalized block for grandpa authority
* Fix warning
* Adds `SessionKeys` runtime api
* Remove `FinalityPair` and `ConsensusPair`
* Minor governance tweaks to get it inline with docs.
* Make the governance be up to date with the docs.
* Build fixes.
* Generate the inital session keys
* Failing keystore is a hard error
* Make babe work again
* Fix grandpa
* Fix tests
* Disable `keystore` in consensus critical stuff
* Build fix.
* ImOnline supports multiple authorities at once.
* Update core/application-crypto/src/ed25519.rs
* Merge branch 'master' into gav-in-progress
* Remove unneeded code for now.
* Some `session` testing
* Support querying the public keys
* Cleanup offchain
* Remove warnings
* More cleanup
* Apply suggestions from code review
Co-Authored-By: Benjamin Kampmann <ben.kampmann@googlemail.com>
* More cleanups
* JSONRPC API for setting keys.
Also, rename traits::KeyStore* -> traits::BareCryptoStore*
* Bad merge
* Fix integration tests
* Fix test build
* Test fix
* Fixes
* Warnings
* Another warning
* Bump version.
* Add test from original bug report
Original is from @pepyakin in 3d7b27f3421818e8d6de568e02fbc2947a06246b.
I adapted it to work with the latest master.
* No longer cleanup module instance
* Replace runtime cache with synchronous clone
* Fix test
* Preserve initial runtime memory and restore it on fetch
* Remove leftover comment
* Fix style
* Improve variable naming
* Replace get_into() with get()
* Handle missing memory export better
* Return earlier when creating runtime first time
* Improve comments
* fmt
* Fix#2967.
* Eradicate `code` from `Error::InvalidCode`
* tidy
* A state snapshot doc.
* Store multiple runtimes by hash.
* Get rid of deref.
* Docs
* Use Self for instantiate_module
* REVERT ME
* Should be ok
* Commit
* Remove dbg
* Use fast-memory's erase
* Clean and undo hacks.
* Introduce a dedicated error for heap_base
* Ban the start function.
* Clean, docs and refactor
* Add rustflags.
* Update Cargo.lock
* Apply Basti's suggestions
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Rename allocates_huge_stack_array
* Extend TestClientBuilder with set_heap_pages
* Update the test.
* Update core/executor/src/wasm_executor.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Update core/executor/src/wasm_runtimes_cache.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Update core/executor/src/error.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Update core/executor/src/error.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Fix tests.
* Update cargo-lock
* Use wasmi master
* Use master wasmi
* Move tests.
* Use wasmi crates.io
* Update Cargo.lock
* Fix build.rs
* Bump runtime version
* Revert initial_heap_pages renaming
* Bump wasmi up to 0.5.0
* Bump runtime version
* Don't restore an instance every now and then
* Update core/executor/src/wasm_runtimes_cache.rs
Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>
* Propagate error in CacheError
* Clarify the get_heap_base call in instantiation
* Supply --export=__heap_base
See https://reviews.llvm.org/D62744
Co-authored-by: Jim Posen <jim.posen@gmail.com>
* Bump version.
* Use combinators for segments.
* Fix build.rs
* Fix build.rs for runtime-test
* Make extrinsics extensible.
Also Remove old extrinsic types.
* Rest of mockup. Add tips.
* Fix some build issues
* Runtiem builds :)
* Substrate builds.
* Fix a doc test
* Compact encoding
* Extract out the era logic into an extension
* Weight Check signed extension. (#3115)
* Weight signed extension.
* Revert a bit + test for check era.
* Update Cargo.toml
* Update node/cli/src/factory_impl.rs
* Update node/executor/src/lib.rs
* Update node/executor/src/lib.rs
* Don't use len for weight - use data.
* Operational Transaction; second attempt (#3138)
* working poc added.
* some fixes.
* Update doc.
* Fix all tests + final logic.
* more refactoring.
* nits.
* System block limit in bytes.
* Silent the storage macro warnings.
* More logic more tests.
* Fix import.
* Refactor names.
* Fix build.
* Update srml/balances/src/lib.rs
* Final refactor.
* Bump transaction version
* Fix weight mult test.
* Fix more tests and improve doc.
* Bump.
* Make some tests work again.
* Fix subkey.
* Remove todos + bump.
* First draft of annotating weights.
* Refactor weight to u64.
* More refactoring and tests.
* New convert for weight to fee
* more tests.
* remove merge redundancy.
* Fix system test.
* Bring back subkey stuff.
* a few stress tests.
* fix some of the grumbles.
* Final nits.
* Update srml/system/src/lib.rs
Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>
* Scale weights by 1000.
* Bump.
* Fix decl_storage test.
* Make extrinsics extensible.
Also Remove old extrinsic types.
* Rest of mockup. Add tips.
* Fix some build issues
* Runtiem builds :)
* Substrate builds.
* Fix a doc test
* Compact encoding
* Extract out the era logic into an extension
* Weight Check signed extension. (#3115)
* Weight signed extension.
* Revert a bit + test for check era.
* Update Cargo.toml
* Update node/cli/src/factory_impl.rs
* Update node/executor/src/lib.rs
* Update node/executor/src/lib.rs
* Don't use len for weight - use data.
* Operational Transaction; second attempt (#3138)
* working poc added.
* some fixes.
* Update doc.
* Fix all tests + final logic.
* more refactoring.
* nits.
* System block limit in bytes.
* Silent the storage macro warnings.
* More logic more tests.
* Fix import.
* Refactor names.
* Fix build.
* Update srml/balances/src/lib.rs
* Final refactor.
* Bump transaction version
* Fix weight mult test.
* Fix more tests and improve doc.
* Bump.
* Make some tests work again.
* Fix subkey.
* Remove todos + bump.
* Ignore expensive test.
* Bump.
* Fix grammar and typo
* Extend network service
* Extend offchain API
* Support creating unsigned UncheckedExtrinsic
* Introduce srml/im-online
* Bump impl and spec version
* Fix web-wasm test
* Apply suggestions from code review
Remove parity-multiaddr dependency
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
* Replace transmute with from_raw_parts
* Replace PeerId.to_string() with .to_base58()
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
* Update Cargo.lock
* Bump impl and spec version (again)
It was updated in master in the meantime.
* Apply suggestions from code review
Co-Authored-By: Sergei Pepyakin <sergei@parity.io>
* Address comments
* Add public function is_online_in_current_session()
* Bump spec_version
* Fix doc tests
* Improve comments
* Remove superfluous line
* Name parameters consistently
* Implement comments
* Switch From to TryFrom
* Use Vec instead of HashSet
* Fix tests
* Revert me: local testing
* Fix check if already sent during session
We gossip each session, hence we need to check
if already sent in this session (not era).
* Fix typos
* Consistent terminology
* Revert "Revert me: local testing"
This reverts commit 73fbc29ff3e5ed71d99436318260b4f007e837f4.
* Introduce IsMember trait
* Implement misc comments
* Remove unused function
* Fix test
* Fix external_addresses being written
* Fix test
* Add necessary trait bound
* Do not increment version
* Update lib.rs
* srml: system: prune block number to hash mapping
* srml: system: add test for block hash mapping pruning
* node: bump runtime version
* srml: system: wrap long line
* srml: system: use parameter type for block hash count
* srml: system: prune block hash mapping before storage root calculation
* srml: system: keep the genesis hash in block number map
* End build when `wasm-builder` does not find a prerequisite
Using `compile_error!` was a stupid idea by me, as rust would not
re-execute the build.rs.
* Increment the `wasm-builder` version
* Update core/utils/wasm-builder/src/lib.rs
Co-Authored-By: André Silva <andre.beat@gmail.com>
* Introduce `wasm-builder` and `wasm-builder-runner` to retire `build.sh`
Make use of `wasm-builder` in `test-runtime`.
* Add build script and remove the wasm project
* Port `node-runtime` to new wasm-builder
* Make `substrate-executor` tests work with `wasm-builder`
* Move `node-template` to `wasm-builder`
* Remove `build.sh` :)
* Remove the last include_bytes
* Adds the missing build.rs files
* Remove `build.sh` from CI
* Debug CI
* Make it work in CI
* CI attempt 3
* Make `substrate-runtime-test` compile on stable
* Ahhh, some missed `include_bytes!`
* AHH
* Add suggestions
* Improve search for `Cargo.lock` and don't panic if it is not found
* Searching from manifest path was no good idea
* Make the `wasm-builder` source better configurable
* Expose the bloaty wasm binary as well
* Make sure to rerun WASM recompilation on changes in dependencies
* Introduce new `WASM_BUILD_TYPE` env and make sure to call `build.rs` on
changes to env variables
* Remove `build.sh` from READMEs
* Rename the projects
* Fixes CI
* Update lock file
* Fixes merge-conflict
* Apply suggestions from code review
Co-Authored-By: TriplEight <denis.pisarev@parity.io>
* Try to make windows happy
* Replace all back slashes in paths with slashes
* Apply suggestions from code review
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
* Use cargo from `CARGO` env variable
* Fix compilation
* Use `rustup` for running the nightly build
* Make individual projects skipable
* Fix compilation
* Fixes compilation
* Build all WASM projects in one workspace
* Replace more back slashes!
* Remove `inlcude_bytes!`
* Adds some documentation
* Apply suggestions from code review
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>
* Apply suggestions from code review
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>
* More review comments
* Update `Cargo.lock`
* Set license
* Apply suggestions from code review
Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* More review comments + adds `TRIGGER_WASM_BUILD` env
* Fix doc tests
* Increase version + update README
* Switch crates.io version of `wasm-builder`
* Update README
* Switch to released version of `wasm-builder-runner`
* Initial work on exposing pre-runtime digests
This provides the primitive API, as well as exposing it from BABE.
* Initial work on using pre-digests in runtimes
This includes both code to expose them from `srml_system`, as well as
using it in (currently dead) code in `srml_babe`.
* Bump `{spec,impl}_version`
* Add `u64_backend` feature to curve25519-dalek
Otherwise, it errors out at compile-time.
* Bump `Cargo.lock`
* Do not depend on the schnorrkel crate in the runtime
The schnorrkel crate does not work on `#![no_std]`, but the runtime only
needs constants from it. This adds our own definitions of those
constants, and checks them for correctness at compile-time.
* Actually implement storage of VRF outputs
* Trivial formatting change
* Provide a `hash_randomness` function in BABE
for processing VRF outputs.
* Implement a basic randomness generating function
It just XORs the VRF outputs together.
* Actually implement on-chain randomness
Blake2b is used for hashing.
* Update dependencies
* Run `cargo update` where needed
* Re-add a newline at EOF
* Remove broken and unsafe code
XOR is not a hash function, and must not be used as such. The
implementation was also needlessly unsafe.
* Run `cargo update` where needed
* Remove spurious dependency
* Document security guarantees of BABE randomness
* Add a `RandomnessBeacon` trait
* Document `RandomnessBeacon::random`
* Fix silly compile error (unexpected type arguments)
* Fix BABE randomness
* Implement `FindAuthor` for `babe::Module`
* Apply suggestions from code review
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
* Respond to suggestions from code review and fix bugs
* Store an authority index, not the authority itself.
* Avoid unnecessary decoding.
* Implement relative slots and BABE randomness fully and correctly.
* Remove spurious dependency
* Fix error reported by rust-analyzer
* Update Cargo.lock files
* `wrapping_add` → `checked_add`
The epoch index will not overflow. Panic if it does.
* Move randomness documentation to trait
* Fix compile error in test suite
* Explain 2^64 limit
Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>