Commit Graph

557 Commits

Author SHA1 Message Date
Arkadiy Paronyan 847f29ff8b PoC-1 backwards compatibility (#281)
* Poc-1 justification compatibility

* Poc-1 version compatibility

* Fixed comment placement
2018-07-05 20:09:44 +02:00
Gav Wood 7b175ea0a9 Update versions, docs. (#282) 2018-07-05 17:03:08 +02:00
Benjamin Kampmann c8b4b61412 Improve Runtime execution by caching runtime lookup (#276)
* Improve Runtime execution by caching runtime lookup

Cache whether the native or wasm runtime should be used for a given
code and if the latter, keep around the parsed wasmi::Module for faster
execution.

* Additional comment and code style fixes

* Fallback to WASM runtime if we can't call the version function

* The previous assumption that the wasm-code was compiled with rustc might be wrong now, that the code comes from the blockchain. Added Notes about that.
2018-07-05 14:37:48 +02:00
Sergey Pepyakin 181e7313d2 Bump wasmi to 0.3.0 (#278) 2018-07-04 15:47:16 +02:00
Sergey Pepyakin 2510774f3b Prevent account storage leakage (#270)
* WIP

* Iteration over all keys with the specified prefix

* Add clear_prefix in runtime-io

* Introduce a custom storage impl: Double Map

* Remove prefix

* Impl for_keys_with_prefix for light client

* Fix wasm_executor

* Test storage removal leads to removal of stroage

* Check for ok result in storage tests.

* Add docs.

* Remove commented code under decl_storage!

* Add clear_prefix test in runtime-io

* Add test for wasm_executor

* Prefix walking test.

* Rebuild binaries.
2018-07-03 20:52:08 +02:00
Arkadiy Paronyan aa747e3fae Block import and export (#272)
* Block export and import

* Export and import using std streams

* Made AuthorituId::from_slice private
2018-07-03 20:20:53 +02:00
Arkadiy Paronyan 12268ae700 Runtime version (#256)
* Runtime version

* Updated genesis.wasm

* Minor fixes

* Fresh runtime

* Default version for pre Poc-2; Fixed authorship interface check

* Fixed authoring check
2018-07-03 17:44:43 +02:00
Sergey Pepyakin e6a7c64518 Bump wabt to 0.4. (#274) 2018-07-03 16:38:39 +02:00
Arkadiy Paronyan 9b885ba092 Serialisable genesis config (#229)
* Genesis serialization

* Custom type for AuthorityId

* Merge w master

* Fixed a few minor issues

* Fixed unmerged file

* Renamed tag

* Deferred genesis loading

* Upated wasm runtime

* Minor issues
2018-07-03 15:56:01 +02:00
Gav Wood 276c464b50 Gav display addrs (#267)
* Tidy up warnings

* Better Display for AccountId
2018-06-29 17:50:53 +02:00
Svyatoslav Nikolsky 1aa7cb680d DB-based light client backend (#250)
* use db in light clients

* fixed comment

* fixed grumbles
2018-06-29 16:10:10 +02:00
Gav Wood 159ff27a5d Fix runtime (#266)
* Fix runtime

* Fix type.
2018-06-29 12:12:59 +02:00
Arkadiy Paronyan b4a0140c6d State pruning (#216)
* Started work on state db

* Updated for a new hash type

* Pruning and tests

* Generalize on the block hash/key type

* Integrate with the client backend

* Merge w master

* CLI options

* Updated for light client refactoring

* Used IntoIterator

* Fixed invalid input hadling
2018-06-28 17:30:24 +02:00
Gav Wood e263c8cf5d Squashed changes. (#262) 2018-06-28 17:29:58 +02:00
Gav Wood 5ed1549bee Fix transaction submission for hex (#259)
* Fix transaction submission for hex

* Fix grumbles.
2018-06-28 16:42:25 +02:00
Gav Wood 079a448454 Rewards and slashing, early-exit of bad sessions (#234)
* Recompile runtime.

* Introduce and enforce block time

* Introduce early session ending.

* Report most of staking module

* rewards, proper early exit and slashing

* Fix build & session logic, introduce tests

* Fixed staking tests.

* Initial test for reward

* Fix test

* Tests for slashing

* Update/fix preset configs

* Fix some tests.

* Fix some staking tests

* Minor fix

* minor cleanups

* Fix build

* Rename timestamp::Value -> Moment

* Require final block of session to be timely
2018-06-28 16:41:11 +02:00
Gav Wood f7db1a0db2 Create CODE_OF_CONDUCT.md (#255) 2018-06-27 13:19:49 +02:00
Liu-Cheng Xu 323c055d5a Use #!/usr/bin/env bash instead of #!/bin/bash (#254)
Refer to https://github.com/dylanaraps/pure-bash-bible#shebang
2018-06-27 11:40:22 +02:00
Tomasz Drwięga bb8344b76b Handle AccountIndices in transaction pool (#225)
* Merge remote-tracking branch 'origin/master' into gav-xts-dont-panic

* Update wasm.

* consensus, session and staking all panic-safe.

* Democracy doesn't panic in apply.

* Fix tests.

* Extra helper macro, council depanicked.

* Fix one test.

* Fix up all council tests. No panics!

* Council voting depanicked.

* Dispatch returns result.

* session & staking tests updated

* Fix democracy tests.

* Fix council tests.

* Fix up polkadot parachains in runtime

* Fix borked merge

* More Slicable support

Support general `Option` and array types.

* Basic storage types.

* Existential deposit for contract creation

* Basic implemnetation along with removals

* Fix tests.

* externalities builder fix.

* Tests.

* Fix up the runtime.

* Fix tests.

* Add generic `Address` type.

* Initial function integration of Address into Extrinsic.

* Fix build

* All tests compile.

* Fix (some) tests.

* Fix signing.

* Push error.

* transfer can accept Address

* Make Address generic over AccountIndex

* Fix test

* Make Council use Address for dispatch.

* Fix build

* Bend over backwards to support braindead derive.

* Repot some files.

* Fix tests.

* Fix grumbles

* Remove Default bound

* Fix build for new nightly.

* Make `apply_extrinsic` never panic, return useful Result.

* More merge hell

* Doesn't build, but might do soon

* Serde woes

* get substrate-runtime-staking compiling

* Polkadot builds again!

* Fix all build.

* Fix tests & binaries.

* Reserve some extra initial byte values of address for future format changes

* Make semantic of `ReservedBalance` clear.

* Fix panic handler.

* Integrate other balance transformations into the new model

Fix up staking tests.

* Fix runtime tests.

* Fix panic build.

* Tests for demonstrating interaction between balance types.

* Repot some runtime code

* Fix checkedblock in non-std builds

* Get rid of `DoLookup` phantom.

* Attempt to make transaction_pool work with lookups.

* Remove vscode settings

* New attempt at making transaction pool work.

* It builds again!

* --all builds

* Fix tests.

* New build.

* Test account nonce reset.

* polkadot transaction pool tests/framework.

* Address grumbles.

* Pool support non-verified transactions.

* Revert bad `map_or`

* Rebuild binaries, workaround.

* Avoid casting to usize early.

* Make verification use provided block_id.

* Fix tests.

* Alter tests to use retry.

* Fix tests & add call to re-verify.

* Semi-refactor.

* Integrate new queue with the rest of the code.

* Fix tests.

* Add reverify_transaction method.

* Use result.
2018-06-26 11:45:57 +02:00
Gav Wood 651c2114d1 Newline after version (#248) 2018-06-26 11:18:51 +02:00
Tomasz Drwięga e6995cc997 Bump error-chain (#245)
* Bump error-chain

* Fix compilation errors
2018-06-25 19:41:33 +02:00
Sergey Pepyakin b3e2a9e89c Restore previous version of ext_sandbox_invoke (#236)
* Restore previous version of ext_sandbox_invoke.

* Rebuild binaries.
2018-06-25 12:12:27 +02:00
Sergey Pepyakin 2f9ffb78e4 Update README.md (#242)
* Update README.md

* clang is not required
2018-06-25 11:42:33 +02:00
Sergey Pepyakin 9804056c4e Refactor travis: Build on minimal image (#243)
* Attempt 1

* minimal → generic

* Add -y to rustup script

* Remove clang

* Refactor.

* Remove CARGO_TARGET_DIR for now

* Display versions of tools from the rust toolchain

* Fix
2018-06-25 11:41:52 +02:00
Brian Anglin 86b8adc25d Fix on darwin build (#239) 2018-06-24 15:26:25 +02:00
Gav Wood 88696998b1 Fix. (#240) 2018-06-24 15:24:04 +02:00
Gav Wood cd4a1e2211 Revert "Introduce and enforce block time (#232)" (#233)
This reverts commit ad392a0ef0.
2018-06-22 19:04:50 +02:00
Gav Wood ad392a0ef0 Introduce and enforce block time (#232)
* Recompile runtime.

* Introduce and enforce block time
2018-06-22 19:04:18 +02:00
Gav Wood d8acd4a1eb Fix telemetry (#231)
* Fix telemetry

* Correct default telemetry

* Extra logging
2018-06-22 18:26:22 +02:00
Robert Habermeier 4082d660ba store all future messages in BFT (#228) 2018-06-22 17:52:23 +02:00
Arkadiy Paronyan 6a56c65a5e Made block message compatible with poc-1 (#226) 2018-06-22 15:30:10 +02:00
Gav Wood 60f7b897a8 Dump genesis to JSON file (#218)
* Merge remote-tracking branch 'origin/master' into gav-xts-dont-panic

* Update wasm.

* consensus, session and staking all panic-safe.

* Democracy doesn't panic in apply.

* Fix tests.

* Extra helper macro, council depanicked.

* Fix one test.

* Fix up all council tests. No panics!

* Council voting depanicked.

* Dispatch returns result.

* session & staking tests updated

* Fix democracy tests.

* Fix council tests.

* Fix up polkadot parachains in runtime

* Fix borked merge

* More Slicable support

Support general `Option` and array types.

* Basic storage types.

* Existential deposit for contract creation

* Basic implemnetation along with removals

* Fix tests.

* externalities builder fix.

* Tests.

* Fix up the runtime.

* Fix tests.

* Add generic `Address` type.

* Initial function integration of Address into Extrinsic.

* Fix build

* All tests compile.

* Fix (some) tests.

* Fix signing.

* Push error.

* transfer can accept Address

* Make Address generic over AccountIndex

* Fix test

* Make Council use Address for dispatch.

* Fix build

* Bend over backwards to support braindead derive.

* Repot some files.

* Fix tests.

* Fix grumbles

* Remove Default bound

* Fix build for new nightly.

* Make `apply_extrinsic` never panic, return useful Result.

* More merge hell

* Doesn't build, but might do soon

* Serde woes

* get substrate-runtime-staking compiling

* Polkadot builds again!

* Fix all build.

* Fix tests & binaries.

* Reserve some extra initial byte values of address for future format changes

* Make semantic of `ReservedBalance` clear.

* Fix panic handler.

* Integrate other balance transformations into the new model

Fix up staking tests.

* Fix runtime tests.

* Fix panic build.

* Tests for demonstrating interaction between balance types.

* Repot some runtime code

* Fix checkedblock in non-std builds

* Get rid of `DoLookup` phantom.

* Attempt to make transaction_pool work with lookups.

* Remove vscode settings

* New attempt at making transaction pool work.

* It builds again!

* --all builds

* Fix tests.

* New build.

* Test account nonce reset.

* polkadot transaction pool tests/framework.

* Initial draft (working).

* Address grumbles.

* Revert bad `map_or`

* Rebuild binaries, workaround.

* Avoid checking in vscode

* reconnecting, shared, slog

* CLI options for name and telemetry url

* ensure telemetry url imples enabled

* Avoid casting to usize early.

* Provide on-connect event for session message

* Better port

* heartbeat and some renaming

* transaction pool stuff

* minor renaming.

* report telemetry

* cleanups.

* Fix for previous cleanup

* dump genesis, dev mode, renaming

* Rework chain spec/config &c. to allow for genesis file loading.

* Avoid producing genesis storage when unneeded

* Allow reading JSON genesis state dumps

* tests work again

* better logging.

* Fix wasm build.

* Introduce PoC-1 spec

* Made block message compatible with poc-1

* Squashed changes for dumping genesis block.

* Binaries.

* Made block message compatible with poc-1

* Remove dead code.

* Fix bad merge.

* Argument passing and returning values when invoking sandboxed funcs (#189)

* Fixed block download sequence (#223)

* Trie-based execution proof (#177)

* TrieBasedBackend

* trie tests

* redunant return_value removed

* use Trie::get_with to record trie proofs

* Relaying tx/blocks by light clients (#190)

* do not import external transactions into light tx pool

* do not announce blocks on light clients

* blocks_are_not_announced_by_light_nodes
2018-06-21 19:18:05 +02:00
Svyatoslav Nikolsky 2d99855ef7 Relaying tx/blocks by light clients (#190)
* do not import external transactions into light tx pool

* do not announce blocks on light clients

* blocks_are_not_announced_by_light_nodes
2018-06-21 16:42:01 +02:00
Svyatoslav Nikolsky 3d0bd2ce62 Trie-based execution proof (#177)
* TrieBasedBackend

* trie tests

* redunant return_value removed

* use Trie::get_with to record trie proofs
2018-06-21 15:23:48 +02:00
Arkadiy Paronyan 504bcc0cae Fixed block download sequence (#223) 2018-06-21 15:12:49 +02:00
Gav Wood 09fddbc80b Telemetry (Slog + WS) (#217)
* Merge remote-tracking branch 'origin/master' into gav-xts-dont-panic

* Update wasm.

* consensus, session and staking all panic-safe.

* Democracy doesn't panic in apply.

* Fix tests.

* Extra helper macro, council depanicked.

* Fix one test.

* Fix up all council tests. No panics!

* Council voting depanicked.

* Dispatch returns result.

* session & staking tests updated

* Fix democracy tests.

* Fix council tests.

* Fix up polkadot parachains in runtime

* Fix borked merge

* More Slicable support

Support general `Option` and array types.

* Basic storage types.

* Existential deposit for contract creation

* Basic implemnetation along with removals

* Fix tests.

* externalities builder fix.

* Tests.

* Fix up the runtime.

* Fix tests.

* Add generic `Address` type.

* Initial function integration of Address into Extrinsic.

* Fix build

* All tests compile.

* Fix (some) tests.

* Fix signing.

* Push error.

* transfer can accept Address

* Make Address generic over AccountIndex

* Fix test

* Make Council use Address for dispatch.

* Fix build

* Bend over backwards to support braindead derive.

* Repot some files.

* Fix tests.

* Fix grumbles

* Remove Default bound

* Fix build for new nightly.

* Make `apply_extrinsic` never panic, return useful Result.

* More merge hell

* Doesn't build, but might do soon

* Serde woes

* get substrate-runtime-staking compiling

* Polkadot builds again!

* Fix all build.

* Fix tests & binaries.

* Reserve some extra initial byte values of address for future format changes

* Make semantic of `ReservedBalance` clear.

* Fix panic handler.

* Integrate other balance transformations into the new model

Fix up staking tests.

* Fix runtime tests.

* Fix panic build.

* Tests for demonstrating interaction between balance types.

* Repot some runtime code

* Fix checkedblock in non-std builds

* Get rid of `DoLookup` phantom.

* Attempt to make transaction_pool work with lookups.

* Remove vscode settings

* New attempt at making transaction pool work.

* It builds again!

* --all builds

* Fix tests.

* New build.

* Test account nonce reset.

* polkadot transaction pool tests/framework.

* Initial draft (working).

* Address grumbles.

* Revert bad `map_or`

* Rebuild binaries, workaround.

* Avoid checking in vscode

* reconnecting, shared, slog

* CLI options for name and telemetry url

* ensure telemetry url imples enabled

* Avoid casting to usize early.

* Provide on-connect event for session message

* Better port

* heartbeat and some renaming

* transaction pool stuff

* minor renaming.

* report telemetry

* cleanups.

* Fix for previous cleanup

* Initial draft (working).

* Avoid checking in vscode

* reconnecting, shared, slog

* CLI options for name and telemetry url

* ensure telemetry url imples enabled

* Provide on-connect event for session message

* Better port

* heartbeat and some renaming

* transaction pool stuff

* minor renaming.

* report telemetry

* cleanups.

* Fix for previous cleanup

* Address grumble

* Final grumble and repot telemetry to substrate

* Fix comment

* Please build, travis...
2018-06-20 18:49:01 +02:00
Sergey Pepyakin f1b851871e Argument passing and returning values when invoking sandboxed funcs (#189) 2018-06-19 16:24:08 +03:00
Dmitry Kashitsyn a5eb2643e9 Moves polkadot/keystore to substrate (#221)
* Moves polkadot/keystore to substrate

* Fixes email

* Fixes header comment
2018-06-19 11:28:43 +02:00
Dmitry Kashitsyn ac0b8b1b45 Reverts wee_alloc to a normal versioning scheme (#222)
* Reverts wee_alloc to a normal versioning scheme

* Removes `global_allocator` attribute, since it's now on by default

This feature has been stable since 1.28.0. Attribute no longer needed.
2018-06-19 11:27:33 +02:00
Gav Wood e53c17d646 Enumeratable accounts (#195)
* Merge remote-tracking branch 'origin/master' into gav-xts-dont-panic

* Update wasm.

* consensus, session and staking all panic-safe.

* Democracy doesn't panic in apply.

* Fix tests.

* Extra helper macro, council depanicked.

* Fix one test.

* Fix up all council tests. No panics!

* Council voting depanicked.

* Dispatch returns result.

* session & staking tests updated

* Fix democracy tests.

* Fix council tests.

* Fix up polkadot parachains in runtime

* Fix borked merge

* More Slicable support

Support general `Option` and array types.

* Basic storage types.

* Existential deposit for contract creation

* Basic implemnetation along with removals

* Fix tests.

* externalities builder fix.

* Tests.

* Fix up the runtime.

* Fix tests.

* Add generic `Address` type.

* Initial function integration of Address into Extrinsic.

* Fix build

* All tests compile.

* Fix (some) tests.

* Fix signing.

* Push error.

* transfer can accept Address

* Make Address generic over AccountIndex

* Fix test

* Make Council use Address for dispatch.

* Fix build

* Bend over backwards to support braindead derive.

* Repot some files.

* Fix tests.

* Fix grumbles

* Remove Default bound

* Fix build for new nightly.

* Make `apply_extrinsic` never panic, return useful Result.

* More merge hell

* Doesn't build, but might do soon

* Serde woes

* get substrate-runtime-staking compiling

* Polkadot builds again!

* Fix all build.

* Fix tests & binaries.

* Reserve some extra initial byte values of address for future format changes

* Make semantic of `ReservedBalance` clear.

* Fix panic handler.

* Integrate other balance transformations into the new model

Fix up staking tests.

* Fix runtime tests.

* Fix panic build.

* Tests for demonstrating interaction between balance types.

* Repot some runtime code

* Fix checkedblock in non-std builds

* Get rid of `DoLookup` phantom.

* Attempt to make transaction_pool work with lookups.

* Remove vscode settings

* New attempt at making transaction pool work.

* It builds again!

* --all builds

* Fix tests.

* New build.

* Test account nonce reset.

* polkadot transaction pool tests/framework.

* Address grumbles.

* Revert bad `map_or`

* Rebuild binaries, workaround.

* Avoid casting to usize early.

* reenable sync tests
2018-06-18 20:23:41 +02:00
Sergey Pepyakin aebfd38250 Merge pull request #214 from paritytech/dk-pwasm-alloc-fix
Fixes `WasmAllocator` to reflect recent nightly API changes
2018-06-15 13:10:05 +03:00
Dmitry Kashitsyn 9b330fdce2 Override wee_alloc dependency to use recent state
Revision 4e9f23f points to a master after https://github.com/rustwasm/wee_alloc/pull/45 was merged
2018-06-15 16:08:26 +07:00
Dmitry Kashitsyn 3dc129b6db Removes unneeded global_allocator attribute 2018-06-14 19:14:40 +07:00
Dmitry Kashitsyn 39440341fe Removes unneeded feature attrs 2018-06-13 22:03:43 +07:00
Dmitry Kashitsyn 3347bf8962 Removes unneeded feature and crate import 2018-06-13 22:00:48 +07:00
Dmitry Kashitsyn e6c7149f4a Fixes WasmAllocator to reflect recent nightly API changes 2018-06-13 21:47:47 +07:00
Sergey Pepyakin 4dc6af8019 Merge pull request #210 from paritytech/ser-refactor-build
Refactor build scripts.
2018-06-11 13:15:56 +03:00
Gav Wood d89d9f8227 Update README.md 2018-06-09 21:04:36 +02:00
Sergey Pepyakin ca48416968 Refactor build scripts. 2018-06-08 19:59:15 +03:00
Sergey Pepyakin 14675edcbc Build parachains (#207)
* Fix build of test-chains.

* Add test-chains into build and publish scripts
2018-06-08 12:52:58 +02:00