Commit Graph

357 Commits

Author SHA1 Message Date
Pierre Krieger 67bdfc7d8e Small slots refactor (#2780)
* Deprecate SlotWorker::on_start

* start_slot_worker no longer needs an Arc

* start_slot_worker now always succeeds

* Removed on_exit parameter from start_*_worker

* Minor doc

* Fix node-template
2019-06-05 10:31:20 -04:00
Benjamin Kampmann eaa0ab014a Move import lock onto backend (#2797)
* Drop import_lock from client, move it into backend, impl default version via static mutex

* still need to allow depcretion because of client.backend

* additional docs

* Remove default impl of get_import_lock, impl on instances

* Bump parking_lot to 0.8.0 accross the board
2019-06-05 15:46:01 +02:00
Gavin Wood 22a00a3353 Sensible scheduling for referenda (#2753)
* Nonlinear locking and cleanups

* Bump runtime version

* Minor cleanup

* Fix tests

* Fix council tests

* Fix flaw in turnout counting

* Initial work on referendum schedules

* Refactor council-democracy interface.

* Fix build

* Update srml/democracy/src/lib.rs

Co-Authored-By: Luke Schoen <ltfschoen@users.noreply.github.com>

* Update srml/democracy/src/lib.rs

Co-Authored-By: Luke Schoen <ltfschoen@users.noreply.github.com>

* Tests compile again

* Tests!

* Update todo

* Fix build

* Ensure votes arer not double-counted on member-transitions

* Extra logic for normal council changes

* Typo

* A few grumbles addressed.
2019-06-05 12:36:28 +02:00
Pierre Krieger 89b312fe9c Revert #2745 (#2791)
* Revert #2745

* Fix error in merge resolve

* Fix compilation
2019-06-05 11:56:36 +02:00
Svyatoslav Nikolsky 012ce5878b Restore integration tests (#2620)
* restored test_consensus

* restored test_sync

* run integration tests only on CI

* use single test-thread for integration tests

* post-merge fix

* panic when integration test runs for too long

* add some traces to integration logs

* manual wait -> timeout

* post-merge fix

* post-merge fix
2019-06-05 09:16:14 +02:00
Bastian Köcher 4d9efbc1d5 Remove deprecated authorities function (#2785)
* Remove deprecated authorities function

* Bump spec

* Fixes compilation

* Remove last piece
2019-06-04 22:28:18 +02:00
Tomasz Drwięga 6112f815b3 JSON-RPC client generation (#2778)
* Bump jsonrpc & generate clients.

* Initial version of JSON-RPC client.

* Re-wort

* Remove spurious `#[derive(Encode, Decode)]`

They did not compile, since `Encode` and `Decode` are deliberately not
implemented for `usize`.

Fixes #2742.

* Re-write rpc-client example.

* Update to jsonrpc=12.0.0

* Remove unnecessary import

* Bump version.

* Revert version bump.

* Bump again.
2019-06-04 18:43:55 +02:00
Pierre Krieger 5df89a8a6f Client::info() no longer returns a Result (#2776) 2019-06-04 16:09:46 +02:00
DemiMarie-parity 53e8ad8728 Add runtime support for PreRuntime and Consensus digests (#2757)
* Try to fix runtime panic

Does not work

* Fix trivial typo

* Add runtime support for `PreRuntime` and `Consensus` digests

Fixes c7d1204ce5

* Fix silly compile error.

* Fix overly-long lines

Also remove some in-progress code that would not wind up being useful
anyway.

* Respond to review comments

* delete `unset RUSTC_WRAPPER` from scripts/common.sh
* delete unnecessary `use aura::AURA_ENGINE_ID` from
  `node/runtime/src/lib.rs`
* add comments explaining why `PreRuntime` and `Consensus` must be
  special-cased in `core/sr-primitives/lib.rs`
* switch to using `$crate::rstd::marker::PhantomData` in
  `impl_outer_log!`
* improve documentation of `DigestItem::Seal`

* Fix compilation and add proof that we do not panic

Also fix some warnings.

* Apply suggestions from code review

Mostly for readability

Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com>

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* $crate::rstd::marker::PhantomData → Default::default()

The import is still needed, as `Default::default()` can’t be used in
patterns.

* Bump `spec_version`

Also do some reformatting.
2019-06-04 15:59:47 +02:00
Shawn Tabrizi 6ce7c1c8c8 Add support for tuples in OnNewAccount hook (#2765)
* Add support for tuples in `OnNewAccount` hook

* Bump impl version

* Use `for_each_tuple` with `OnNewAccount` hook

* Update `OnFreeBalanceZero` to also use `for_each_tuple`

* Fix spelling/typo

* Bump spec again

* Update srml/support/src/traits.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update srml/system/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
2019-06-04 08:48:22 +02:00
Gavin Wood b88c46bfd1 Nonlinear locking and cleanups (#2733)
* Nonlinear locking and cleanups

* Bump runtime version

* Minor cleanup

* Fix tests

* Fix council tests

* Fix flaw in turnout counting

* fix: lock_voting_should_work_with_delegation test

* chore: fix comment refering to unexisting function
2019-06-03 16:47:48 +02:00
DemiMarie-parity fff90e86c0 Remove spurious #[derive(Encode, Decode)] (#2759)
They did not compile, since `Encode` and `Decode` are deliberately not
implemented for `usize`.
2019-06-03 10:34:38 -04:00
Tomasz Drwięga 308ab4f269 Offchain-worker APIs stubs (#2615)
* WiP: HTTP Apis.

* Working on the API.

* Add docs, clean up the API.

* Expose ext_ stuff as well.

* Implement HTTP helpers for offchain sr-io.

* Remove HTTP stuff.

* Revert "Remove HTTP stuff."

This reverts commit 7cca029d6ae93c5849b50edfcc6d2c313ba3e5bf.

* HTTP apis.

* Additional offchain methods.

* Make it compile.

* Implement wasm-ext boundary of offchain methods.

* Add stubs for offchain stuff to prevent panics.

* Fix tests.

* Addres some more issues.

* Introduce typedef, use unsafe from_utf8

* Bump runtime version.

* Introduce error to distinguish deadline and io errors.

* Add local_storage_cas

* Some tests for offchain stuff.

* Address more grumbles.

* Fix tests compilation.

* Fix borked merge.

* Improve docs for expected return values from ext functions.

* Adding new sign/enrypt/decrypt APIs.
2019-05-31 09:33:44 +02:00
DemiMarie-parity 683fd5d364 Update runtime dependencies (#2721) 2019-05-29 16:07:01 +02:00
Tomasz Drwięga 25b9c12c20 Remove InherentsPool and introduce non-propagateable transactions. (#2695)
* Remove InherentsPool.

* Introduce transactions that are not propagated over the network.

* Bump spec version.

* Use separate flag for propagation.

* Fix tests.
2019-05-29 16:06:49 +02:00
Gavin Wood fccc55160a Maps are appendable too (#2716)
* Maps are appendable too

* Update srml/support/src/storage/hashed/generator.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update srml/support/src/storage/mod.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Fix docs

* Make Appendable public

* Bump runtime version
2019-05-29 15:15:10 +02:00
Kian Peymani 810d2712da Limited Unbonding Chunks. (#2700)
* Limit number of unlocking chunks.

* Bump.
2019-05-29 14:17:58 +02:00
thiolliere 91a241ad5b derive codec for inherent data (#2714)
* derive codec for inherent data

* increase spec version
2019-05-29 14:16:37 +02:00
DemiMarie-parity c7d1204ce5 Introduce inherent digests (#2466)
* Introduce inherent digests

* Implement inherent digests

* fix silly error

* Implementation of inherent digests in BABE

All tests pass. There are still limitations:

1. The runtime strips out inherent digests, so BABE must re-add them.
2. The test runtime checks that it can re-compute all digests.  It
   can’t, so I had to comment out that test.

* Fix compilation and seal import

Seals were not imported correctly: the pre-digest was imported twice,
instead of both it and the seal being imported.  Also, other parts of
the code did not compile due to incomplete refactoring.

* Remove bogus assertion

* Fix testsuite compilation

* Remove unused import

* Fix compiler diagnostics

* Add inherent digest parameters to block constructors

This enforces that inherent digests are added first.

* Fixup Cargo.lock

* Fix build errors

* Re-add an incorrectly removed import

* Bump primitive-types version

* Update Cargo.lock

* Refactoring

* Use inherent digests for AuRa

They do reach the runtime, but get stripped.  I have not figured out
where.

* Fix compilation errors

* Fix compilation errors due to incorrect types

* Fix whitespace

Suggested-by: Tomasz Drwiega <tomasz@parity.io>

* Add preamble

Suggested-by: Tomasz Drwiega <tomasz@parity.io>

* Fix silly compile error

* Refactor pre-digest finding code into a separate function

* Remove unwanted assertion

It is too likely to bring down the entire blockchain.

Suggested-by: Tomasz Drwiega <tomasz@parity.io>

* Use `find_pre_digest` after runtime, too

Also, use `Member` trait rather than rolling our own requirements.

Suggested-by: Tomasz Drwiega <tomasz@parity.io>

* Fix various warnings

mostly due to upgrading the dependency on `error_chain`.

* Pre-digests nearly complete

This nearly completes the implementation of pre-runtime digests.

* `Seal2` → `Seal` and fix test suite

* Try to fix the storage error

* Try to fix storage (again)

* Fix tests

* Hopefully finish pre-runtime digests

The key is to pass *only* the pre-runtime digests to the runtime.  The
others must be stripped out by `initialize_block`.

* Fix silly typo

* Fix another silly mistake

* Remove unnecessary filtering of BABE pre-digests

We no longer get duplicate BABE pre-digests, so if they appear, the
header should be rejected outright.

* Update Cargo.lock files

* Reformatting

* Fix silly typo in inherent digest code

Also, revert `error.rs` files that contained calls to the `error_chain!`
macro.

* Try to keep the runtime from stripping pre-digests

Currently runs into the “Storage root must match that calculated”
assertion.

* Don’t compute storage root until storage changes are done.

Also, fix a compilation error.

* Fix compile-time error

* Fix compilation errors

* Fix more compile errors

* Hopefully it compiles this time…

* Fix compilation and add docs

* Prevent BABE from adding duplicate pre-runtime digests

Found by comparing with the AuRa code.  I also did some refactoring.

* Respond to review and fix some warnings

* Delete some dead code introduced earlier

* More dead code goes away

* `ref mut` → `&mut`

* Respond to review and fix some warnings

* Fix compilation error

* Remove unneeded `HashT` type parameter

Suggested-by: Robert Habermeier <robert@parity.io>

* Remove spurious #[allow(deprecated)]

* Document inherent digest parameter to `build_block`

* Delete `Simple` trait

It wasn’t needed

* delete wrongly added files

* Fix trait bounds

* Digest serialization tests

I also did some reformatting and cleanup.

* Apply suggestions from code review

Reformatting

Co-Authored-By: André Silva <andre.beat@gmail.com>

* Swap two arguments to `propose` and `propose_with`

Also, remove some needless unsafe code.

* Remove bogus `#![allow(deprecated)]` annotations

With the removal of the deprecated `Seal` variant, these are not needed.

* Add a missing `#[allow(deprecated)]` in the AuRa tests

* Fix silly compile error

* Fix silly compiler error

RLS did not tell me that I hadn’t fixed `babe/lib.rs`, so I missed it.

* Fixes made automatically by Cargo
2019-05-29 14:13:38 +02:00
Michael Müller a706d994cb Transaction factory (#2481)
* Fix typos

* Add transaction factory

`cargo run -- purge-chain -y --chain dev && cargo run -- --dev --transaction-factory 10`

* Fix comment and remove build deps

* Move crate to test-utils

* Switch from flag to subcommand

`cargo run -- factory --dev --num 5`

* Decouple factory from node specifics

* Introduce different manufacturing modes

* Remove unrelated changes

* Update Cargo.lock

* Use SelectChain to fetch best block

* Improve expect proof

* Panic if factory executed with unsupported chain spec

* Link ToDo comments to follow-up ticket

* Address comments and improve style

* Remove unused dependencies

* Fix indent level

* Replace naked unwrap

* Update node/cli/src/factory_impl.rs

* Fix typo

* Use inherent_extrinsics instead of timestamp

* Generalize factory and remove saturated conversions

* Format imports

* Make it clearer that database needs to be empty

* Ensure factory settings

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update test-utils/transaction-factory/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Fix match guard syntax

* Simplify import, remove empty line

* Update node/cli/Cargo.toml

* Update lockfile
2019-05-28 17:01:43 +02:00
Svyatoslav Nikolsky 549d9e1da1 Remove BlockNumber <-> u64 conversions from light-client related code (#2666)
* Remove As usage from CHT

* Remove As usage from CHT (continue)

* Restrict BN <-> int conversions in CT

* more BN <-> u64 conversions removed

* upd spec_version

* Apply suggestions from code review

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

* Apply suggestions from code review

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

* more grumbles

* fix last grumbles + compilation

* too long lines

* too long lines
2019-05-28 15:07:16 +02:00
Benjamin Kampmann 22d3043917 Silence known deprecation warnings (#2651)
* Silence known deprecation warnings

1. Prefixes known instances of usages of client.backend and client.import_lock with `#[allow(deprecated)]` to silence the warnings. 2. Remove file-global `#![allow(deprecated)]` used in these cases. Both to prevent us overlooking externally caused deprecation messages.

* fixing missing ;

* fix missing test cases

* move deprecated markers to make CI happy

* move deprecated markers to make CI happy

* attempt to fix the test

* bumping impl_version of node runtime

* Minor cleanup
2019-05-28 10:34:59 +02:00
Tomasz Drwięga c162fc5ff1 Expunge error-chain (feat. tomaka) (#2662)
* Remove error_chain

* Expunge error-chain from rpc and service.

* Expunge from transaction pool.

* Expunge from node/cli

* Expunge from keystore.

* Remove some boilerplate.

* Fix remaining stuff.

* Improve on deprecation message.

* Fix issues.

* Fix trnsaction pool tests.

* Fix the rest.

* Fix borked merge.

* Update lock
2019-05-24 10:35:31 +01:00
thiolliere ffce18b994 Contract restoration (#2502)
* partial impl

* more checks

* improve TestExternalities + tests

* make tombstone raw to derive Eq

* remove before merge

* add test

* fmt

* update test

* doc

* bump version

* fix testing

* update runtime

* Fix TrieIdGenerator

* fix dummy trie id generator

* update test

* bump version

* format

* Update core/state-machine/src/testing.rs

Co-Authored-By: cheme <emericchevalier.pro@gmail.com>

* document test

* Apply suggestions from code review

Co-Authored-By: DemiMarie-temp <50585338+DemiMarie-temp@users.noreply.github.com>

* refactor

* fix

* fmt

* address review

* impl last_write

* Fix storage size, test, remove size in tombstone

* fix

* Update srml/contract/src/lib.rs

Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com>

* comment

* child_storage_root as &[u8]
2019-05-23 15:09:16 +02:00
Pierre Krieger 6431cdf601 Remove TaskExecutor from the API of the informant (#2642)
* Remove TaskExecutor from the API of the informant

* Fix node-template
2019-05-23 09:44:36 +01:00
Gavin Wood 3860d7c810 Remove As (#2602)
* Start to remove the `As` bound on `SimpleArtithmetic`

This just introduces standard numeric bounds, assuming a minimum of
`u32`. Also included is a saturating from/into trait allowing ergonomic
infallible conversion when you don't care if it saturates.

* Remove As from Balances trait

* Remove As from Aura module

* Remove As from Babe module

* Expunge `As` from contract

* Council module

* Democracy

* Finality tracker

* Grandpa

* First bit of indices

* indices

* Line lengths

* session

* system

* Staking

* Square up all other uses of As.

* RHD update

* Fix build/test

* Remove As trait

* line widths

* Remove final As ref

* Update srml/staking/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update core/client/src/cht.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Update core/client/db/src/light.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* whitespace

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
Co-Authored-By: André Silva <andre.beat@gmail.com>

* Bring back u32 check for number on CLI
2019-05-22 23:11:38 +01:00
Amaury Martiny e24b18f844 Remove remains from metadata v0 (#2610)
* Remove rests for metadata v0

* bump impl_version
2019-05-17 10:49:08 +02:00
thiolliere aa2c496a65 Make perthings operate in type operator (#2501)
* perthings operate in type operator

* implementation with rem

* fmt

* doc

* better fmt

* bump version

* Tests for pet-things

* demonstrate output as type of operation

* Remove redundant assertions.

* rename test

* update lock

* bump impl version
2019-05-15 18:48:58 +02:00
André Silva e0a6a1f55a node: set protocol id for flaming fir (#2589) 2019-05-15 18:14:52 +02:00
Bastian Köcher fcf9a46bcc Forward the result in a sudo call (#2594)
* Forward the result in a sudo call

* Print the error of the wrapped call in `sudo`
2019-05-15 18:14:33 +02:00
thiolliere 2893a613c2 increase block gas limit (#2597) 2019-05-15 18:11:05 +02:00
Pierre Krieger 0d0fe6a0ea Add WebSocket addresses for bootnodes (#2578) 2019-05-14 16:30:16 +02:00
Svyatoslav Nikolsky 9a14ba0555 Fix light client startup (build_select_chain returns Result<Option>) (#2574)
* fix light client strtup (build_select_chain -> Option)

* fixed node template compilation

* Update core/service/src/lib.rs

Co-Authored-By: Benjamin Kampmann <ben.kampmann@googlemail.com>
2019-05-14 12:38:30 +01:00
André Silva 132984adf5 Introduce Flaming Fir testnet (#2526)
* node: replace emberic elm with flaming fir testnet

* update readme
2019-05-14 12:11:25 +02:00
Sergei Pepyakin d57f6f9305 Pass topics along with events (#2563)
* Introduce an IndexedEvent

* Plumb topics through the Ext interface.

* Add topics to ext_deposit_event

* Charging for events.

* Check the number of topics.

* Check for duplicate topics.

* Bump API version.

* Move derive(*Eq) under test.

* Use sorting for finding duplicates.
2019-05-14 12:09:51 +02:00
joe petrowski 580432d822 Fix over/under flow risk in OnDilution (#2548)
* fix over/under flow risk in OnDilution

* bump impl
2019-05-14 12:07:32 +02:00
Sergei Pepyakin 21773b3a07 Light client friendly events (#2491)
* Sketch of indexed events.

* Get EventIndex by holding another variable.

* Add some docs.

* Use DoubleMap to store reverse topic index

* Implement StorageDoubleMap::append

* Use append for EventTopics.

* Refactor.

* Avoid `mutate`

* Docs.

* Add topics to EventRecord

* Update tests.

* Rebuild.

* Bump version.

* Event topics test.

* Mix in BlockNumber to distinguish updates

* Fix srml-system test.

* Post merge fixes.

* Comments/TODO.
2019-05-13 20:56:01 +02:00
Joshy Orndorff 3b534c1cc6 Changed all occurences of referendums to referenda. Updated spec versions. (#2545) 2019-05-13 11:37:47 +02:00
Svyatoslav Nikolsky 22586113ea Light GRANDPA import handler (#1669)
* GrandpaLightBlockImport

* extract authorities in AuraVerifier

* post-merge fix

* restore authorities cache

* license

* new finality proof draft

* generalized PendingJustifications

* finality proof messages

* fixed compilation

* pass verifier to import_finality_proof

* do not fetch remote proof from light import directly

* FinalityProofProvider

* fixed authorities cache test

* restored finality proof tests

* finality_proof docs

* use DB backend in test client

* justification_is_fetched_by_light_client_when_consensus_data_changes

* restore justification_is_fetched_by_light_client_when_consensus_data_changes

* some more tests

* added authorities-related TODO

* removed unneeded clear_finality_proof_requests field

* truncated some long lines

* more granular light import tests

* only provide finality proof if it is generated by the requested set

* post-merge fix

* finality_proof_is_none_if_first_justification_is_generated_by_unknown_set

* make light+grandpa test rely on finality proofs (instead of simple justifications)

* empty_finality_proof_is_returned_to_light_client_when_authority_set_is_different

* missing trait method impl

* fixed proof-of-finality docs

* one more doc fix

* fix docs

* initialize authorities cache (post-merge fix)

* fixed cache initialization (post-merge fix)

* post-fix merge: fix light + GRANDPA tests (bad way)

* proper fix of empty_finality_proof_is_returned_to_light_client_when_authority_set_is_different

* fixed easy grumbles

* import finality proofs in BlockImportWorker thread

* allow import of finality proofs for non-requested blocks

* limit number of fragments in finality proof

* GRANDPA post-merge fix

* BABE: pos-merge fix
2019-05-13 11:36:52 +02:00
André Silva 9d23d2a25a Bump master to v2.0.0 (#2514)
* bump crates to v2.0.0

* fix crate authors

* bump node runtime spec_version

* remove unused import for no-std
2019-05-10 16:55:15 +02:00
cheme 0d8379d5d2 Child trie storage proof (#2433)
* proof on child trie

* higher level api for child storage proof

* boilerplate for proof from light fetch

* actually check proof on light fetch

* Do not break former encoding

* tabify

* tabify2

* Add child trie root tx to full_storage_root transaction.

* Shorten long lines.

* Temp rename for audit

* Make full_storage a trait method

* Name back and replace some code with full_storage where it looks fine.

* fix indentations, remove unused import

* flush child root to top when calculated

* impl +1
2019-05-10 14:31:41 +02:00
Svyatoslav Nikolsky 59be403730 Create AuthoritiesChange digest item in correct block (#2512)
* finalize srml modules in reverse order

* update runtime versions
2019-05-10 14:30:48 +02:00
thiolliere dfbaedd535 Allow modules to validate transaction, second attempt (#2463)
* first impl

* rename origin::inherent to none

* fix

* fix

* Apply suggestions from code review

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* comment

* better error

* doc

* (add unsigned module 🤦)

* doc

* fix

* implement for node-template as well

* add validated unsigned to executor

* fix

* fix

* bump version

* testing xt

* remove extraneous logic

* licence

* impl test
2019-05-10 14:13:04 +02:00
Benjamin Kampmann 18ca0170c3 Allow for customisation of chain selection systems (#2240)
* move SelectChain trait out of client

* Extend SelectChain, move longest chain implementation into it

* Bring SelectChain into service

* implement LongestChain SelectChain

* implement longest chain for node

* update Cargo.lock's

* in between erroring tests

* deprecate ::backend and ::import_lock

* Remove unneded space

Co-Authored-By: gnunicorn <ben.kampmann@googlemail.com>

* Remove unneded space

Co-Authored-By: gnunicorn <ben.kampmann@googlemail.com>

* Fixes test compilation

* remove todo

* re-enable client test

* add doc

* fixing tests

* Clarify SelectChain Interface, intended implementation and usage

* minor components cleanups

* minor cleanups

* Update lock files

* Implement cleaner interface for SelectChain

* addressing comments

* Updating tests

* bump node runtime impl version

* address grumbles
2019-05-10 14:08:12 +02:00
Kian Peymani 71426fb060 Reformat Validator Election (#2406)
* Add index caching to election

* Initial draft of the new phragmen API.

* Port post-processing to the new API.

* Fix tests and accuracy.

* Final fixes.

* Unify convert namings.

* Remove todo.

* Some typos.

* Bump.

* Add extended balance type doc.

* A bit more sophisticated weight compensation.

* Fix review feedbacks.

* Bump.

* Final updates
2019-05-09 19:05:45 +02:00
Bastian Köcher e67b653c85 Silence the deprecated warning in generated code (#2513)
`impl_runtime_apis!` is not only implementing the apis, it also calls
them internally and thus generates the warning. So, we just allow
depracted calls in the generated code.
2019-05-09 10:27:08 +02:00
Xiliang Chen 57164aa747 Remove As trait bound from Currency::Balance (#2205)
* remove As<64> bond

* Currency trait refactor

* bump spec version
2019-05-09 09:40:28 +02:00
Andrew Jones 9fc1db3280 Use saturating_pow for max digest interval (#2506)
* Use saturating_pow for max digest interval

* Impl version
2019-05-08 13:20:43 +02:00
thiolliere d380db706b actually update deduct_block when paying rent (#2490)
* actually update deduct_block when paying rent

* add test

* remove println

* same block call test

* bump version
2019-05-07 14:13:56 +02:00
Gavin Wood adba89913e Clean up random seed to make a bit more flexible (#2456)
* Reformulate random seed to be more random

- First 80 random values come from cycling the incomplete series (
  instead of filling with zeroes)
- Calculate random material each usage (use a single amalgamated
  ring buffer to store them for avoiding 81 lookups each time)
- Mutate inputs by hashing each with:
  - its index (into the 81)
  - an additional "subject" key provided by caller

This keeps the final output low-influence while still allowing
it to be used as the seed to independent contexts. (Hashing the
result to give the final seed is no better than using parent_hash).

* Docs

* Bump runtime

* Update notes

* Remove feature(alloc)

* Update srml/system/src/lib.rs

Co-Authored-By: gavofyork <github@gavwood.com>
2019-05-06 13:57:30 +02:00