Commit Graph

76 Commits

Author SHA1 Message Date
Sergey Pepyakin 5b28147d27 Update wasmi (#1119)
* Update wasmi to 0.4.2

* Add simple benchmarks.
2018-11-16 17:16:42 +01:00
Bastian Köcher a4e5842915 Introduce a PhantomData field in GenesisConfig (#1116)
This makes it possible to support `GenesisConfig`s that to do not use
generic parameter.
2018-11-16 16:16:10 +01:00
Svyatoslav Nikolsky 6e3c56c135 Changes tries: support forks (#950)
* forks support in changes trie storage

* moved convert_hash to primitives

* optimize ChangesTrieRootsStorage::root when anchor is canonicalized
2018-11-13 12:17:14 +01:00
Sergey Pepyakin 1f0f3c8f6b srml-contract: Extract schedule (#1044)
* Rename Config → Schedule.

* Fetch and pass config.

* Integrate config everywhere.

* <<<E as Ext>::T as Trait> → <<E::T as Trait>

* Update roots

* Cache existential_deposit

* Update COMPLEXITY.md

* Update roots.
2018-11-12 20:44:05 +01:00
Hero Bird 660c747c51 Update fixed-hash & uint utilities (#1078)
* [core/primitives] Update crunchy 0.1 => 0.2

* [core/primitives] Update fixed-hash 0.2 => 0.3.0-beta

* [core/primitives] Update `uint` 0.4 => 0.5.0-beta

* [core/state-machine] Fix errors emerged by fixed-hash update

* [core/state-db] Fix errors that emerged from fixed-hash update

* [core/sr-io] Fix errors that emerged from the fixed-hash update

* [core/trie] Fix errors emerged from fixed-hash updates

* [core/trie] Make use of new Hash::as_fixed_bytes_mut method in tests

* [core/sr-primitives] Fix errors emerged from updating fixed-hash

* [core/executor] Fix errors that emerged from fixed-hash update

* [core/test-runtime] Fix errors that emerged from updating fixed-hash

* [core/test-runtime] Fix an error that emerged from fixed-hash update

* [core/transaction-pool] Fix errors that emerged from updating fixed-hash

* Add From<u64> impl for hash types defined in core/primitives

* [core/client/db] Fix errors that emerged from fixed-hash update

* [core/{client/network/rpc}]: Fix errors emerged by fixed-hash update

* [node/{cli/executor/runtime}]: Fix errors emerged by updating fixed-hash

* [core/network]: Fix bug in parsing constant str

* Update Cargo.lock

- Add crunchy 0.2.1
- fixed-hash 0.2.2 => 0.3.0-beta.3
- Add static-assertions 0.2.5
- uint 0.4.1 => 0.5.0-beta.1

* [core/primitives]: Add fixed-hash/rustc-hex feature for FromStr impl

* [core/primitives] No longer provide From<u64> impl for hash types if byteorder support is not enabled

* [core/primitives] Revert to using From impl again in primitives tests

* [core/..] Fix some bugs that emerged by recent fixed-hash updates

* Update a bunch of Cargo.lock files

* [core/state-db] Re-add whitespace between attr and extern crate/mod

* [core/primitives] Fix bug in From<u64> impl for hash types using the wrong feature guard
2018-11-06 15:39:55 +01:00
Sergey Pepyakin 9072fce658 srml-contract: Sandbox mem IO according to COMPLEXITY.md (#939)
* Sandbox mem IO according to COMPLEXITY.md

* Fix tests.

* Update root hash for deploying contract test.
2018-11-05 19:23:16 +01:00
Wei Tang b21de8a0b5 Support multi trie in genesis generation (#958)
* Support multi trie in genesis generation

* Fix merge issues
2018-11-01 09:30:03 +01:00
Benjamin Kampmann 50adea6220 Consensus Engines Implementation: Aura (#911)
* Generalize BlockImport

 - move ImportBlock, BlockOrigin, ImportResult into shared sr-primitives
 - let Consensus provide  and  traits again
 - update consensus traits to latest development
 - implement traits on client::Client, test_client::TestClient
 - update RHD to use the new import_block API

* Move ImportBlock into consensus-common
* Send import notification in aura tests
* Integrating aura into service
* Make Signatures more generic
* Aura Block Production with the given key
* run aura on the thread pool
* start at exact step start in aura
* Add needed wasm blob, in leiu of better solutions.
* Make API ids consistent with traits and bring upstream for sharing.
* Add decrease_free_balance to Balances module
* Encode `Metadata` once instead of two times
* Bitops include xor
* Upgrade key module.
* Default pages to somewhat bigger.
* Introduce upgrade key into node
* Add `Created` event
2018-10-27 15:59:18 +02:00
Gav Wood 8bc5242c92 Compact format for block number, nonce, balance (#910)
* Try to make everything compact

* Make `Clone` work

* Fix

* Move contracts and balances over to compact encoding

* Session and timestamp are compact

* Sataking uses compact numbers

* Treasury now compact

* Compact Democracy

* Council is compact

* Fix
2018-10-16 22:47:30 +02:00
guanqun 1cc0e3b6ea Enhance decl storage (#777)
* enhance macro decl_storage()

* update the state root hash

* fix one comment
2018-10-05 14:20:32 +02:00
guanqun 35f3fe7e77 use the map! macro instead of defining it all over the place (#867)
* remove one map implementation in test

* remove one map macro

* remove one map macro

* remove one map macro
2018-10-03 13:22:58 +01:00
Sergey Pepyakin 2414ffdac0 Fix sandbox::Memory lifecycle + sandox get memory function for no_std env (#845)
* Fix `sandbox::Memory` lifecycle for no_std env

* Retain memories in env_def builder and instance

* Add scoped memory creation to test RC semantics

* Add deploying_wasm_contract_should_work test.

* Fix sandboxed memory set function.
2018-09-30 17:23:32 +01:00
Bastian Köcher 2332d6dd04 More dependency cleanup (#825)
* Removes `rlp` dependency

* Enable warnings about unused crates in the CI

* Remove all the unused crates

* Make tests working again
2018-09-27 17:52:51 +01:00
Gav Wood 851c7f42df Fix block generation by updating codec versions in wasm (#810)
* Fixes for staging testnet

* Fix codec versioning

* Comment unneeded trace

* Update lib.rs

* Update parity-codec

* Add script to update wasm deps and update them.

* Update hashes

* Add BBQ Birch testnet

* it's default-features, apparently.

* Use simpler version spec for parity codec

* Typo
2018-09-27 14:38:56 +01:00
Arkadiy Paronyan 29c9719568 Support authoring for multiple runtime versions (#816) 2018-09-27 13:56:40 +01:00
Arkadiy Paronyan a613c62dc1 Fixed extrinsic encoding (#794)
* Fixed extrinsic encoding

* Reserve heuristic

* Fixed no-std build
2018-09-25 17:01:10 +01:00
Gav Wood 82d6ca3484 Switch to shiny new fast, RLP-less trie (#795)
* Bump codec

* Fix tests

* Patricia trie builds

* Introduce trie

* Some yak shaving.

* Some fixes

* Remove RLP ref

* Fixes

* It builds!

* Some tests fixed

* Another test fix

* Rejig more hashes

* substrate-trie::iterator_works test

* Update lock

* Polish

* Docs

* Undo incorrect "fix" for tests

* Fix nits
2018-09-25 16:32:22 +02:00
Gav Wood f71200ee3c Bump codec (#786)
* Bump codec

* Fix tests
2018-09-21 17:16:15 +02:00
Gav Wood 25393abef8 Rewards & slashes proportional to the least-slashable validator (#781)
* Initial stuff

* Treasury now mints based on lowest staked.

* Tests build

* Fix tests

* Fix hashes

* Fix tests & grumble
2018-09-21 09:10:16 +02:00
Gav Wood ebb688f81f Address grumbles in eras PR (#782)
* Address grumbles

* Fix hash
2018-09-20 23:18:47 +02:00
Gav Wood 67bf1a6eaa Transaction eras (#758)
* Initial groundwork

* A mess.

* Integrate

* Fix tests

* Unit tests

* Tests for unchecked_extrisnic

* fix tab

* Improve binary format.

* fix tests

* Rename extrinsic-pool -> transaction-pool

Closes #770

* Implement unimplemented.

* typo
2018-09-20 14:01:01 +02:00
Svyatoslav Nikolsky 7fa337afbc Light friendly storage tracking: changes trie + extending over ranges (#628)
* changes_trie

* changs_trie: continue

* changes_trie: adding tests

* fixed TODO

* removed obsolete ExtrinsicChanges

* encodable ChangesTrieConfiguration

* removed polkadot fle

* fixed grumbles

* ext_storage_changes_root returns u32

* moved changes trie root to digest

* removed commented code

* read storage values from native code

* fixed grumbles

* fixed grumbles

* missing comma
2018-09-18 09:14:41 +02:00
Gav Wood f10d8e177d Generalised Transaction Queue API (#741)
* First effort

* API versioning

* Introduce validate_transaction

* Introduce the API plus fixes.

* Docs

* Typo

* Add longevity parameter to transaction validity info.
2018-09-17 18:43:59 +02:00
Gav Wood 3f96419665 Remove unneeded code (#737) 2018-09-13 18:08:45 +02:00
金XX(Aton) ca8f0d6625 bugfix: balances::transfer for new_account issue#722 (#731)
* bugfix: balances::transfer for new_account

issue:#722
would_create flag should depend on dest, not origin.
change 
```rust
let would_create = from_balance.is_zero();
```
to 
```rust
    let to_balance = Self::free_balance(&dest); 
    let would_create = to_balance.is_zero(); 
```
in the other hand, provide `fn new_test_ext2()` and let `transfer_fee=10`, `creation_fee=50` for test case

* Update lib.rs

* Update tests.rs

* Make `impl_outer_origin!` support generic `Origin`s (#732)

* Make `impl_outer_origin!` support generic `Origin`s

* Support empty outer origin

* Contracts: fix transfer function. (#733)

* Remove dependency on the parity repo (#734)

* Fix test

* Anothe fix
2018-09-13 15:54:56 +02:00
Gav Wood 1e01162505 Phase 1 of repo reorg (#719)
* Remove unneeded script

* Rename Substrate Demo -> Substrate

* Rename demo -> node

* Build wasm from last rename.

* Merge ed25519 into substrate-primitives

* Minor tweak

* Rename substrate -> core

* Move substrate-runtime-support to core/runtime/support

* Rename/move substrate-runtime-version

* Move codec up a level

* Rename substrate-codec -> parity-codec

* Move environmental up a level

* Move pwasm-* up to top, ready for removal

* Remove requirement of s-r-support from s-r-primitives

* Move core/runtime/primitives into core/runtime-primitives

* Remove s-r-support dep from s-r-version

* Remove dep of s-r-support from bft

* Remove dep of s-r-support from node/consensus

* Sever all other core deps from s-r-support

* Forgot the no_std directive

* Rename non-SRML modules to sr-* to avoid match clashes

* Move runtime/* to srml/*

* Rename substrate-runtime-* -> srml-*

* Move srml to top-level
2018-09-12 11:13:31 +02:00