Commit Graph

805 Commits

Author SHA1 Message Date
Bastian Köcher fd2ec13ed8 Improve event json metadata (#710)
* Introduce `impl_event!` for declaring the Event/RawEvent for a module

* Implements a function for generating the event json metadata

* Update runtime `json_metadata` to include the new event json metadata

* Switch to `impl_event!` for new modules

* Remove unused module declaration in `impl_event!`

* Rename `impl_event!` to `decl_event!`

* Fixes some style nits
2018-09-11 14:05:09 +02:00
Chevdor da56ae7e46 Remove polkadot doc from substrate (#700)
* Improve doc

- convert some md to adoc
- include contrib docs to the main readme
- add readme for some packages and include them

* Bring changes from 46c9333fff into the replacing adoc file

* Minor fixes

* Remove files irrelevant for substrate

* Remove old polkadot related doc
2018-09-11 12:57:19 +02:00
Guanqun Lu c3d8c52e17 enhance the environmental macro (#683) 2018-09-11 10:51:53 +02:00
Sergey Pepyakin d7d591cf54 Try to remove the caching from the build (#701) 2018-09-11 10:51:17 +02:00
Gav Wood 91c2b8e462 Fix treasury minting (#707)
* Fix minting to do what it's meant to.

* Fix tests

* Note and fix total issuance.

* Undo last non-fix.

* More doc
2018-09-11 10:50:01 +02:00
Gav Wood 597a7411ae Don't use Ext outside of runtime!!! (#704) 2018-09-10 21:11:54 +02:00
Gav Wood c9845f33d8 Council events (#703)
* Initial bits

* More stuff

* Cleave voting from council

* More events

* Rearrange council a little

* Fix demo

* More info in events
2018-09-10 21:11:47 +02:00
Sergey Pepyakin 6c1b2c27d1 Integrate contracts into substrate-demo runtime (#675)
* Introduce data and salt into ContractAddressFor

* Accept salt arg in ext_create.

* Integrate contracts into the demo runtime

* Make libcontract compile to wasm

* Remove salt parameter.

This now is concern of userspace.

* Rebuild binaries.
2018-09-10 19:45:19 +02:00
Svyatoslav Nikolsky 0e1023ae42 DigestItem trait (v3) (#687)
* DigestItem v4

* tests

* wording
2018-09-10 18:34:51 +02:00
Maciej Hirsz 153439aeea Flag if the node is an Authority for Telemetry (#702) 2018-09-10 18:34:38 +02:00
Bastian Köcher ba23d033a1 Implements json_metadata RPC call (#692)
* Adds `impl_json_metadata!` for generating all metadata of a runtime

* Adds `json_metadata` RPC call

* Adds simple test for the `json_metadata` RPC call

* Implements json metadata in the demo runtime

* Fix indent

* Adds missing copyright headers

* Dispatch json metadata renamings and improvements

* Replaces `format!` & `String` with `Vec<JSONMetadata`

* Implements `Encode` and `Decode` for JSONMetadata

* Make `impl_json_metadata!` compileable on `no_std`

* Adapt the client to decode the correct type for `json_metadata`

* Fixes compile error and warning

* Whitespace
2018-09-10 18:34:17 +02:00
Arkadiy Paronyan fea750511e Bring substrate-demo up to date (#658)
* Updating substrate-demo

* Consenus fixes

* Reverted toolchain change

* Adjusted timeout formula

* Simplfied proposal creation

* Fixed tests

* Fixed a few small issues

* 2017->2018

* Style

* More style

* Renamed demo executable to substrate

* Style

* Fixed compilation after merge

* Style
2018-09-10 17:54:32 +02:00
Gav Wood bcc26dd30a Council motions for approving treasury proposals (#694)
* Treasury in runtime, generic approve/reject

* Add logic for council origin

* Add tests.

* Configurable number of members in EnsureMembers

* Fix grumbles

* Fix spelling

* Comment
2018-09-10 16:02:59 +02:00
Chevdor 7b112dee7c Remove docker from Substrate (#699) 2018-09-10 16:01:58 +02:00
Gav Wood 0aefb50689 Democracy module events (#697)
* Democracy module events

* Fix demo runtime

* Fix

* Extra event in balances

* Missing event

* Fix test

* Fix council

* Fix test
2018-09-10 14:40:35 +02:00
David 393c3b5af7 LocalCallExecutor and RemoteCallRequest generic over Hasher and NodeCodec (#573)
* LocalCallExecutor and RemoteCallRequest generic over Hasher and NodeCodec

* Fix client/db

* Use new triehash

* Use new triehash
Don't use ethereum-types from rlp

* New triehash

* Use new triehash

* fixes and rlp without ethereum-types

* Lockfile

* lockfile

* Rename enumerated_trie_root to keccak_rlp_enumerated_trie_root

* Rename ordered_trie_root -> keccak_rlp_ordered_trie_root
Rename trie_root -> keccak_rlp_trie_root

* Fix panic message

* Kick the ball one step up the ladder

* Normalize function signatures between wasm and native

* Sort out compilation and test errors

* Cleanup

* Constrain the wasm-version using an ExternTrieCrypto trait that is implemented only for KeccakHasher

* hashdb is not optional

* lockfile

* Runtimes

* Missing bounds

* wasm binaries

* lockfiles

* binaries

* LocalCallExecutor uses concrete hasher/codec

* Use binaries from master

* Externalities is concrete
RuntimeInfo is not generic

* whitespace grumble

* lockfile

* lockfile and binaries
2018-09-09 14:56:50 +02:00
Guanqun Lu ea7aeb8409 add mutate api (#695)
* runtime-storage: add 'mutate' api

* support mutate for StorageValue

* try adding 'mutate' for map

* dispatch on Option<> type

* add check for prev_some

* consolidate the wrap type

* unify wrap type handling

* add sample for StorageValue
2018-09-09 13:32:15 +02:00
Arkadiy Paronyan 6fb9b5a0ba Fixed sync stalling when import queue is full (#691) 2018-09-07 21:45:44 +02:00
Gav Wood 761bc9f763 New extrinsic dispatch model (#678)
* System and Balances switched to new call model

* Fixed up executive for new pardigm

* Consensus works with Origin

* Timestamp ported over

* Session now compatible

* Ported staking

* Treasury compatible

* Expunge MaybeEmpty

* Make democracy work

* Council compatible

* Remove some aux-dispatch stuff and fix balances

* Rename aux -> origin, fix contracts

* Fix test

* Fix example

* Update macro to remove superfluous cruft

* Make work with new macro

* Tests

* Fix some tests

* Tests

* Fix grumbles

* Final grumble
2018-09-07 19:28:18 +02:00
Guanqun Lu 6571842c99 remove parachain's Cargo.lock (#682) 2018-09-07 19:12:48 +02:00
Bastian Köcher 6bc48fdafc Implement json metadata for outer events (#672)
Progress on: #535
2018-09-07 18:59:04 +02:00
Pierre Krieger abf64386bb Improvements to the Kademlia system (#688) 2018-09-07 18:56:38 +02:00
Pierre Krieger 28d3c2afe9 Use BufReader and BufWriter (#684)
* Use BufReader and BufWriter

* Add TODOs
2018-09-07 18:54:51 +02:00
ddorgan 9cdd52f327 Switch to using parity/rust:substrate which has rust nightly-2018-08-31 (#686) 2018-09-07 13:26:49 +02:00
Pierre Krieger af3ad2109f Update to latest libp2p (#673) 2018-09-06 14:56:41 +02:00
Bastian Köcher b538733a24 Implement storage json metadata (#670)
* `decl_storage!` exposes json metadata about the storage

The metadata can be accessed by calling `store_json_metadata()`.

* Hide internal macros in the documentation

* Include the function documentation in the store json metadata

* Adapt the storage declarations to use doc comments
2018-09-05 22:53:18 +02:00
David 07a59621cc impl MaybeEmpty for H256 and u64 (aka AccountId in prod/tests) (#665)
* impl MaybeEmpty for H256 and u64 (aka AccountId in prod/tests)

* binaries
2018-09-05 22:51:11 +02:00
Arkadiy Paronyan b50196b389 Speedup compilation (#671) 2018-09-05 18:31:47 +02:00
Bastian Köcher c3e2983af3 Remove requirement of function indices for decl_module! (#666) 2018-09-05 13:41:57 +02:00
Svyatoslav Nikolsky be7cb74b06 DigestItem trait (v2) (#650)
* DigestItem trait

* removed autoimpl in impl_outer_log

* StubDigestItem -> ()
2018-09-05 13:36:23 +02:00
Gav Wood 101f5ec393 Revert "Install llvm-tools-preview component (#643)" (#644)
This reverts commit 2601392d6a.
2018-09-05 12:13:10 +02:00
Gav Wood 33a2e27c47 Revert "fix wasm executor compile error (#631)" (#642)
This reverts commit b7ef395cc1.
2018-09-05 12:12:59 +02:00
David 5998a55cc3 Fetch parity-common dependencies from crates (#617)
* Fetch parity-common dependencies from crates

* Update triehash

* Fix code to fit latest triehash
Fetch kvdb-rocksdb from crates

* type params

* lockfile

* lockfiles

* wasm binaries and lockfile
2018-09-05 11:58:32 +02:00
Svyatoslav Nikolsky 951fbd1f3b limit retry count in OnDemand (#513) 2018-09-05 11:43:39 +02:00
Gav Wood 2ea89556b4 Minor refactor for staking module (#659)
* Somerhing wrong.

* My attempt to fix

* cfg_attr for serde

* Fix tests
2018-09-05 11:39:47 +02:00
Pierre Krieger 0d422878a3 Upgrade to libp2p master (#660) 2018-09-05 09:05:28 +02:00
Bastian Köcher 1efe4a3659 Include function comments into modules json_metadata (#657)
* Include function comments into modules `json_metadata`

All doc comments (with `///`) are included in the description field of
the function.

Progress on #535

* Replace spaces with tabs
2018-09-05 00:20:29 +02:00
Svyatoslav Nikolsky 8eb4589ca6 Replace old headers with CHT in light clients (#512)
* storage proofs

* CHT
2018-09-04 21:57:55 +02:00
Gav a34e990cf2 Fix build 2018-09-04 21:51:13 +02:00
Gav Wood 7657a2326f Introduce treasury and document (#646)
* Introduce treasury and document

* Revert bad changes

* More reversions

* Add example crate

- Remove HasPublicAux
- Rename Concrete -> Runtime

* Actually commit stuff

* Changes

* Propagate block number in finalise.

* Fix and build example

* Fixes.

* Fix compilation for treasury.

* Fix the treasury test

* Tests

* Fix.

* Fix tests

* Fix a few grumbles

* Fixes

* Fix grumbles
2018-09-04 17:29:06 +02:00
Gav Wood 69781a7ccc Off-the-table staking preference (#656) 2018-09-04 17:28:50 +02:00
Bastian Köcher 6d149c570d Implement function json_metadata in decl_module! (#654)
The new function `json_metadata` returns the module declaration
as a json string.

Progress on: #535
2018-09-04 11:57:26 +02:00
Pierre Krieger 26ebf3a0a0 Fix warnings in networking (#652) 2018-09-04 10:26:54 +02:00
Pierre Krieger 360ffa2dbb Add a reputation system (#645)
* Add a reputation system

* Fix tests

* Don't try to dial peers to which we are already connected

* Use the master branch of libp2p
2018-09-04 08:52:20 +02:00
Arkadiy Paronyan 146ebceab4 Check for pruned block state (#648) 2018-09-03 16:29:55 +02:00
Sergey Pepyakin 73ad673404 Contract runtime polishing (#601)
* Rename ext_transfer → ext_call

There are several tests where gas was changed. This is due to shrinking
the name and consequently a size of contracts.

* Fix macros

Specifically, make fixes that allows to use a function without arguments (apart from ctx).
For example:

```rust
ext_return_42(ctx) -> u32 => {
    Ok(42)
}
```

Also, add impl ConvertibleToWasm for u64.

* Implement passing input data buffer from top-level

This allows the transaction initiator to pass some input data that can be accessed from the executed contract.

However, this only works for the top-level contract. The contract still cannot pass input data to the callee contract. The reason for that is that API doesn't support this presently.
This will be addressed in the following commits.

* Input data passing thru `ext_call`

`ext_call` now takes a buffer (or more specifically, pointer  to the start of and size of a buffer).

This allows contracts to pass input data while calling into other contracts.

* Input data passing thru `ext_create`

Same as previous commit but for `ext_create`.

* Trap on decoding error instead of panicking

* Don't cascade failure in ext_call

Instead, if callee doesn't complete successfuly, return a non-zero status code.

This will prevent cascading traps up to the top-level. Due to this some tests were altered so that they now expect successful transfer instead of a failure.

* Don't cascade failure in ext_create

Same as previous commit but for ext_create.

* Specify how much gas to allot for a call

* Specify how much gas to allot for a create

* Update tests.rs
2018-09-01 12:02:10 +02:00
Guanqun Lu beee3d4092 WIP on chain heap (#639)
* move heap size on chain

* fix the interface change

* decode heap size

* fix code comments

* fix comment

* update Cargo.lock

* rename to heappages

* add one heap pages variable in runtime
2018-09-01 08:41:46 +02:00
Gav Wood 98a2121a3c Events to track extrinsic success (#640)
* Initial draft

* Fixes

* Extrinsic success events
2018-08-31 18:44:37 +02:00
Sergey Pepyakin 2601392d6a Install llvm-tools-preview component (#643) 2018-08-31 18:04:05 +02:00
woodsmur b7ef395cc1 fix wasm executor compile error (#631) 2018-08-31 17:28:47 +02:00