Commit Graph

518 Commits

Author SHA1 Message Date
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
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
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
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
Pierre Krieger 094b2568b2 Amend #205 (#206) 2018-06-07 13:39:11 +02:00
Luke Schoen 4307f456ad docs: Fixes #204. Update Readme. Add command to switch to Rust stable. Append binaries to installation command (#205)
* docs: Fixes #204

* Add command to switch to a stable version of Rust before installing Polkadot PoC-1 since error occurs when trying to install using Rust Nightly, which some users may have configured as their active toolchain
* Append ` polkadot subkey` to the command that installs the latest version of Polkadot PoC-1 to overcome error

* Update README.md
2018-06-07 09:29:41 +02:00
Gav Wood b94cf078af Make substrate generic (#169)
* Some initial work on RPC and client

* Rephrase as params

* More work on traitifying substrate.

* Traitify in_mem.rs

* traitify client.rs

* Make new primitives (mainly traits) build again.

* Many (superficial) build fixes throughout.

* Fix remaining build issues up to bft interface.

* Make bft primitives be generic.

* Switch out MisBehaviorReport for generic version.

* Merge Hashing into Header.

* Update runtime for new generics (with Hashing).

* Update demo runtime.

* Make runtime compile.

* Build fixes for runtime

* Remove old modules.

* port substrate-bft to use generic substrate types

* port client

* port substrate-test-runtime

* mostly port test-runtime to get compiling for std

* Ensure `AccountId` has a `Default`.

* Fix type deps.

* finish porting

* initialize test_runtime from genesis correctly

* remove commented code

* maybe unsigned signatures

* runtimes compile

* port over most of network

* serialization for generic types

* fix comment

* remove some unnecessary trait bounds

* network compiles

* tests compile for sync

* fix deserialization

* temporarily remove deserialize derives

* workarounds for serde issues for deriving deserialization

* get demo-runtime compiling on std

* port extrinsic-pool

* primitives reshuffling

* get network compiling again

* remove debugging file

* runtime tests now passing

* port client-db

* start to port over substrate-rpc

* mostly port over PolkadotApi

* test_runtime follows normal conventions

* substrate runtime tests pass

* deal with inherent extrinsics correctly in polkadot-api

* port transaction-pool

* port polkadot-consensus

* port substrate-rpc

* everything compiles

* tests compile

* fix grumbles

* test-runtime uses its own transfer type

* switch to master branch of jsonrpc

* fix network tests and some warnings

* all tests pass locally

* [ci-skip] add another comment about issue

* remove some curlies
2018-06-06 17:58:45 +02:00
Jerome de Tychey 4e844760a3 Update README.md (#203)
added the Rust version
2018-06-06 11:13:52 +02:00
Sergey Pepyakin ff0d9c3359 Extract smart-contract runtime into the separate crate (#179)
* Apply inversion of control to contract module.

* Extract contract to it's own crate.

* Rebuild binaries.
2018-06-05 14:18:08 +02:00
Sergey Pepyakin 68e468f59c Use #[panic_implementation] attribute that was landed in the recent nightly (#199)
* Use [panic_implementation] instead of lang item

* Rebuild binaries.
2018-06-04 19:11:42 +02:00
Gav Wood a306074eb7 Runtime dispatch calls return Result (#192)
* 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
2018-06-01 18:32:40 +02:00
Tomasz Drwięga 1dada4f7a0 Extrinsic pool (#182)
* Use latest version of txpool.

* Initial version of the pool.

* Fix abstraction.

* Implement watchers and notifications.

* Return hash from RPC.

* Remove commented code.

* Remove client dep.

* Fix tests.
2018-05-31 22:49:17 +02:00
Gav Wood 44eaa4a180 Public extrinsic apply doesn't panic (#178)
* 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.

* utilise hygene
2018-05-31 22:11:09 +02:00
Arkadiy Paronyan 32d85fbecf Fixed consensus message garbage collection (#191)
* Fixed garbage collection logic

* Track block being imported

* mod tests
2018-05-31 18:17:18 +02:00
Gav Wood 66affa2b95 Use a simpler increment seed iterator. (#186)
* Use a simpler increment seed iterator.

* Use more secure seeding.
2018-05-30 17:40:16 +02:00
Gav Wood c831e7c511 Key generation utility (#176)
* RPCs for versioning.

* Build fix for bad merge.

* Add system_name RPC

* Fix tests.

* Fix demo build.

* Remove BadFormat.

* Add ss58check encoding and subkey.

* Improvements.

* Update Cargo.toml
2018-05-29 18:05:50 +02:00
Gav Wood 757e5beb8d Balance is 128-bit value (#162)
* Replace 128-bit shim with real type.

* Remove unneeded code.

* Remove superfluous deps

* Reinstate deps.
2018-05-29 13:48:01 +02:00
Gav Wood 1204a560aa RPCs for versioning (#175)
* RPCs for versioning.

* Build fix for bad merge.

* Add system_name RPC

* Fix tests.

* Fix demo build.

* Remove BadFormat.
2018-05-29 09:58:48 +01:00
Svyatoslav Nikolsky 58ba901ccc Preparing light client structure [v2] (#150)
* light client structure + remote call requests
2018-05-28 10:27:59 +03:00
Wei Tang 4808077674 Update transaction-pool dependency and remove ethereum-types (#174) 2018-05-26 12:14:47 +01:00
Robert Habermeier 27aafb0a04 Minimal parachain framework part 1 (#113)
* dynamic inclusion threshold calculator

* collators interface

* collation helpers

* initial proposal-creation future

* create proposer when asked to propose

* remove local_availability duty

* statement table tracks includable parachain count

* beginnings of timing future

* finish proposal logic

* remove stray println

* extract shared table to separate module

* change ordering

* includability tracking

* fix doc

* initial changes to parachains module

* initialise dummy block before API calls

* give polkadot control over round proposer based on random seed

* propose only after enough candidates

* flesh out parachains module a bit more

* set_heads

* actually introduce set_heads to runtime

* update block_builder to accept parachains

* split block validity errors from real errors in evaluation

* update WASM runtimes

* polkadot-api methods for parachains additions

* delay evaluation until candidates are ready

* comments

* fix dynamic inclusion with zero initial

* test for includability tracker

* wasm validation of parachain candidates

* move primitives to primitives crate

* remove runtime-std dependency from codec

* adjust doc

* polkadot-parachain-primitives

* kill legacy polkadot-validator crate

* basic-add test chain

* test for basic_add parachain

* move to test-chains dir

* use wasm-build

* new wasm directory layout

* reorganize a bit more

* Fix for rh-minimal-parachain (#141)

* Remove extern "C"

We already encountered such behavior (bug?) in pwasm-std, I believe.

* Fix `panic_fmt` signature by adding `_col`

Wrong `panic_fmt` signature can inhibit some optimizations in LTO mode.

* Add linker flags and use wasm-gc in build script

Pass --import-memory to LLD to emit wasm binary with imported memory.

Also use wasm-gc instead of wasm-build.

* Fix effective_max.

I'm not sure why it was the way it was actually.

* Recompile wasm.

* Fix indent

* more basic_add tests

* validate parachain WASM

* produce statements on receiving statements

* tests for reactive statement production

* fix build

* add OOM lang item to runtime-io

* use dynamic_inclusion when evaluating as well

* fix update_includable_count

* remove dead code

* grumbles

* actually defer round_proposer logic

* update wasm

* address a few more grumbles

* grumbles

* update WASM checkins

* remove dependency on tokio-timer
2018-05-25 16:16:01 +02:00
Gav Wood 24d7d38c62 Introduce 128-bit shim for u128/i128 and use it for Balance (#163)
* Add 128-bit shim and use for balance.

* Fix tests.

* Fix wasm build.
2018-05-24 16:24:09 +02:00
Sergey Pepyakin 5f9aca2137 Contracts: Memory and Module instance teardowns (#171)
* Add teardowns.

* Rebuild binaries.
2018-05-24 13:18:55 +01:00