Commit Graph

1336 Commits

Author SHA1 Message Date
gabriel klawitter 8aae19e2db fix cache clearing error (#1703) 2019-02-06 12:40:36 +01:00
Bastian Köcher 190393d476 Make API backwards compatible with CC (#1697)
* Rework how a runtime api calls into the runtime

Now we generate a default implementation for each api call that calls
a generated method `method_runtime_api_impl`. This newly generated
method is the one that will be implemented by the `impl_runtime_apis`
macro in the runtime for the client side.

* Support `changed_in` to change runtime api function signatures

* Update documentation

* Fixes tests

* Implement checking the api version with a predicate

* Make the implementation backwards compatible with CC

* Update wasm files after merge

* Check for wasm runtime differences by building master and current branch

* Update spec_version and wasm files

* Fixes

* Revert my changes

* Remove `patch.crates-io` from test-runtime
2019-02-06 11:47:47 +01:00
Wei Tang 1ba7e35c18 Support multi-hash in multi-trie via PlainDB (#1106)
* Temporarily pin trie to #2

* Use generic and delay trait object casting

Rust does not support super-trait upcasting

* Add PlainDB impl for Ephemeral

* Add PlainDB trait alias for completeness

* Use PlainDB for test TrieBackendStorage fetch

We always check overlay first for a storage fetch, which already checked null data. Using PlainDB here makes it work
nicer with other PlainDB overlays.

* Update trie reference

* Use HashDBRef in places when approriate

* Use PlainDBRef in places when approriate

* Update trie crate reference

* Remove unused HashDB::keys

* Patch dependencies

* Fix cargolock

* Update cargo lock again
2019-02-06 11:16:40 +01:00
Gav Wood fa2e323478 Add OnInitialise handler. (#1690)
* Add OnInitialise handler.

Closes #1686

* Fix typo

* Fix wasm build

* Add tests for initialise and finalise.
2019-02-06 10:01:28 +01:00
Gav Wood 0eeef28382 Offline/Slashing improvements (#1665)
* Initial logic

* Fix tests

* Don't punish at all when everyone skipped

* Typo

* Fix tests.

* Update srml/aura/src/lib.rs

Co-Authored-By: gavofyork <github@gavwood.com>

* Simplification.

* Bump runtime verions
2019-02-05 22:11:40 +01:00
Bastian Köcher 471b7431bc Move CODE directly into TestExternalities (#1682)
* Move `CODE` directly into `TestExternalities`

This change allows tests to modify CODE in storage.

* Update more hashes

* Test

* Move `code` back into a field of `TestExternalities`

* Update wasm after master merge
2019-02-05 21:16:11 +01:00
André Silva 7c33728510 Lower log level of grandpa until_imported message (#1691)
* core: gossip: add missing docs

* core: grandpa: lower log level on until_imported
2019-02-05 15:37:04 -03:00
Stanislav Tkach 1cb02c318b Migrate srml-assets, srml-aura, srml-balances and srml-consens to the 2018 edition (#1633) 2019-02-05 18:26:58 +01:00
Andrew Jones 0242cee284 Update to latest jsonrpc-derive: fixes aliases (#1689) 2019-02-05 14:11:04 +00:00
Stanislav Tkach df685c9e53 Rename and use --max-heap-pages parameter (#1666) 2019-02-05 12:35:12 +01:00
gabriel klawitter 888e7bb76f add test for wasm runtime changes (#1612)
* add test for wasm runtime changes

* use default container

* disable cache for runtime source test

* compare spec_versions directly
2019-02-05 10:50:44 +01:00
Andrew Jones 822c7ded45 Convert to jsonrpc-derive, use jsonrpc-* from crates.io (#1679)
* use local version of jsonrpc to test

* Convert rpcs to test out in progress jsonrpc-derive api

* Revert "Convert rpcs to test out in progress jsonrpc-derive api"

This reverts commit 69231784171180d9bdb1bde1fcfd20f233357b17.

* Convert to new jsonrpc-derive macro

* Add RPC trait Metadata comment

* Break up long pubsub attr lines

* Update to 10.0.1 jsonrpc-* from crates.io

* Remove typed::Subscriber prefixes

* Remove empty comment
2019-02-04 20:18:24 +01:00
André Silva 57ac31a0aa Split substrate-finality-grandpa (#1675)
* core: grandpa: move consensus_changes to its own submodule

* core: grandpa: move justification to its own submodule

* core: grandpa: move environment to its own submodule

* core: grandpa: move block import to its own submodule
2019-02-04 13:54:14 -03:00
Michael Müller bf49b00c90 Replace allocator with freeing-bump allocator (#1656)
* Link substrate issue tracker in panic

* Replace allocator with freeing-bump allocator

* Revert me: Panic on double allocate/free

* Revert me: Add shallow benchmark for a first impression

* Revert "Revert me: Add shallow benchmark for a first impression"

This reverts commit 5f0d4df39395eb55c9ec2d6fe1ed992533475fec.

* Revert "Revert me: Panic on double allocate/free"

This reverts commit a114df7d6cfc21d60af396ccca02e5c8205db6ce.

* Rename heap to FreeingBumpHeapAllocator

* Rename heap.rs to allocator.rs

* Use sandbox heap

* Move functions

* Move variables into constructor

* Revert "Move variables into constructor"

This reverts commit f46fa0d0cdf4ea97760ccce58003b0d33f433743.

* Remove unnecessary casts

* Add comment for new parameter

* Improve typing

* Move variables into constructor

* Avoid dynamic allocation

* Remove unused variables

* Revert "Link substrate issue tracker in panic"

This reverts commit 32dfa1d02bcf881d1d514a930fcc0fdf3c5f8e08.

In the meantime this was fixed in https://github.com/paritytech/substrate/pull/1667.

* Improve naming

* Only assert in debug mode

* Remove dynamic allocation
2019-02-04 16:23:12 +01:00
Arkadiy Paronyan 38d7eb66a7 Fixed pruning detection in archive mode (#1670) 2019-02-04 15:30:05 +01:00
Wei Tang 1a3fa9eb68 Refactor aura and generalize slot worker (#1632)
* Refactor aura and generalize slot worker

* Fix bound issues

* Change copyright to 2019

* Write deps minor version

* Don't pass inherent_data_providers

* Revert "Write deps minor version"

This reverts commit 6d886702a899bfbdbbc609c0536e8abab2bc012c.

* Fix merge issues
2019-02-04 11:32:21 +01:00
Bastian Köcher 4ea3ac1c4a Use absolute path in native_executor for Blake2Hasher (#1671) 2019-02-04 11:26:51 +01:00
Arkadiy Paronyan 6c341f4e9d Fixed panic handling (#1667) 2019-02-04 09:11:29 +01:00
Stanislav Tkach 87f0f6fd8f Migrate srml-support to the 2018 edition (#1663) 2019-02-03 11:42:12 +01:00
James Ray ddb44db551 Add links to the README for further info (#1661)
* Add links for further info

* Fix typo
2019-02-03 11:38:11 +01:00
James Ray dee1e6e3df Intro and add an intro link (#1662) 2019-02-03 11:37:58 +01:00
James Ray 1b5e311b05 Fix Telemetry link (#1660) 2019-02-03 11:37:49 +01:00
Bastian Köcher ef4dc12a5d Don't panic if parameter can not be converted between node and native runtime (#1659)
* Don't panic if parameter can not be converted between node and native runtime

* FIxes after merge

* Use correct copyright year
2019-02-02 14:13:50 +01:00
André Silva 4983f113e6 Reduce consensus spam (#1658)
* core: fix predicate for dropping grandpa round messages

* core: grandpa: drop commits topic on authority set change

* core: gossip: only drop known messages based on expiration time

* core: grandpa: don't broadcast commit messages

* core: gossip: don't assume topics are header hashes

* core: gossip: expire messages more agressively

* core: grandpa: fix test environment

* core: gossip: fix tests

* core: gossip: track dead topics (and ignore messages)

* core: gossip: test dead topic pruning
2019-02-01 14:25:07 -03:00
Arkadiy Paronyan 641bb7cb46 Stop authoring blocks when offline (#1655)
* Don't author blocks when offline

* Increased canonicalization delay

* Fixed test
2019-02-01 17:17:53 +01:00
Robert Habermeier 2155e44e13 grandpa: consistent argument ordering in rebroadcast vs. network (#1647)
* grandpa: consistent argument ordering in rebroadcast vs. network

* use a round type
2019-02-01 17:17:43 +01:00
Arkadiy Paronyan 1ea56905cf Fixed state-db block insertion and added forks trace (#1657) 2019-02-01 17:17:31 +01:00
Tomasz Drwięga ecdd33a367 Allow both consensus and runtime to limit block building (#1581)
* Limit block size in runtime,

* Add test for basic authorship.

* Store length of extrinsics instead of computing it.

* Don't rely on note_extrinsic

* Use hashed version of storage and write test.

* Recompile runtime.
2019-02-01 13:58:23 +01:00
Svyatoslav Nikolsky 381cf26f55 Make genesis state locally-available on light client (#1622)
* make genesis state available on light client

* RemoteOrLocalCallExecutor

* code_is_executed_locally_or_remotely

* OnDemandOrGenesisState tests

* some comments
2019-02-01 10:27:54 +01:00
Joshy Orndorff 5d82cf243e Fix minor error in chain-spec generation command in readme (#1644)
* Fix minor error in chainspec generation command in readme

* Fixed up remaining typo
2019-01-31 22:36:55 +01:00
Gav Wood a58de5d0ff Transaction signing payload is hashed first (#1624)
* Transaction signing payload is hashed first

* Fix tests

* Rebuild wasm

* Fix tests

* Only take payload hash when payload.len > 256 bytes.

* Fix tests
2019-01-31 18:39:20 +01:00
Arkadiy Paronyan 4bcc8eda41 Check for disposed blocks when creating a state. (#1636)
* Check for disposed blocks

* fixed changes_tries_with_digest_are_pruned_on_finalization

* Indent

Co-Authored-By: arkpar <arkady.paronyan@gmail.com>
2019-01-31 14:06:10 -03:00
Stanislav Tkach da029c87b7 Replace ⭳ and ⭱ characters with ⬇ and ⬆ (#1635) 2019-01-31 14:18:40 +01:00
Sergei Pepyakin 80d4a0a21b Declare storage in contracts module (#1591)
* Declare storage in contracts module

This adds storage declarations of the contract module to the runtime metadata and this ultimately gives ability to inspect the storage of contract module (except contracts storage) for polkadot ui

* Bump the runtime version to 17.

* Rebuild the binaries.

* Rebuild

* Rebuild [2]
2019-01-31 12:19:28 +01:00
Wei Tang fc41825fb6 Support edition 2018 for storage_items macro (#1625)
* Support edition 2018 for storage_items macro

* Fix handle_wrap_internal
2019-01-31 11:34:16 +01:00
thiolliere 9de35fa7d5 update rhododendron trie-bench for parity-codec 3.0 (#1613)
* update rhd and tri

* .lock and wasm build
2019-01-31 11:04:41 +01:00
Gav Wood 6cf382f8b0 Update the date (#1627)
* Update the date

* fixed compilation
2019-01-31 08:54:07 +01:00
Pierre Krieger ec790acf4d Print the local node address again (#1628) 2019-01-30 23:33:14 +01:00
cheme ea2a03b7bb Merge metadata by module (#1428)
Clean up metadata format. Merge events metadata into runtime metadata. Remove low value info (internal macro identifier and counters).
2019-01-30 19:34:08 +01:00
Arkadiy Paronyan 742f030ddd Transactional updates in the state-db (#1616) 2019-01-30 16:58:25 +01:00
Stanislav Tkach f98f9ac58a Migrate state-db, state-machine, telemetry, test-client and test-runtime to the 2018 edition (#1623) 2019-01-30 15:51:59 +01:00
Svyatoslav Nikolsky 2037c52fbe make --port 30334 work again (#1620) 2019-01-30 14:46:39 +01:00
Svyatoslav Nikolsky a4756710c5 fixed aux modifications on light client (#1621) 2019-01-30 14:44:29 +01:00
Michael Müller aa5e0658f8 Fix consensus error between wasm and native (#1595)
* Decrease bucket size

A bucket size of 8192 bytes is quite large and it turned
out that this can exhaust the available heap space too
too quickly.

This is because even for allocating 1 byte a bucket of
8192 bytes is allocated/wasted.

* Return 0 if requested size too large

* Improve test

The test didn't use an offset when setting up the heap.
Hence the first successfully allocated pointer was
always `0`.

This is unfortunate since `0` is also the return value
when there is an error.

This lead to us not noticing that the test was failing,
because it did not distinguish between success and error.

* Revert to linear allocator
2019-01-30 14:37:32 +01:00
Benjamin Kampmann 15ae7cfef6 Document more TODOs as tickets (#1418)
Went through the TODOs, removed a bunch, which are outdated or nothing more than a regular comment, documented a bunch more as actual tickets and made them FIXMEs and unified their structure (`FIXME #TICKETNO DESC` for local tickets, `FIXME: DESC LINK` for external tickets) for easier in-editor support. Further more remove unnecessary remarks and related old code that I noticed in that instance.
2019-01-30 10:29:48 +01:00
Tomasz Drwięga d2cfd7b9dc Allow runtime to return transaction validation error codes (#1534)
* Allow runtime to return more detailed transaction validation errors.

* Re-use ApplyError codes and update test-runtime.

* Fix pool tests.

* Revert using Compact for validity.
2019-01-29 19:06:05 +01:00
Stanislav Tkach 473721f959 Migrate node (cli, executor, primitives and runtime) to the 2018 edition (#1589) 2019-01-29 17:57:56 +01:00
Stanislav Tkach d796e09f02 Migrate tx-graph, tx-pool and trie to the 2018 edition (#1611) 2019-01-29 16:25:03 +01:00
Stanislav Tkach e6839d2d41 Migrate executor, xinherens, keyring and keystore to 2018 edition (#1585) 2019-01-29 14:30:07 +01:00
thiolliere ecffe0c371 impl Mul + saturating_mul by converting in u64 (#1610) 2019-01-29 13:36:34 +01:00