Commit Graph

8915 Commits

Author SHA1 Message Date
Michael Müller bcfb75b78e Get rid of memcpy in to_vec() (#1512) 2019-01-22 09:45:03 +01:00
Robert Habermeier 9ae1316c86 a wrapper network for rebroadcasting GRANDPA messages periodically (#1513) 2019-01-21 16:33:07 -03:00
Pierre Krieger 3c7d6c7b72 Add some networking tests (#1480) 2019-01-21 19:26:12 +01:00
Tomasz Drwięga e48291acd0 camelcase structs returned over RPC (#1507) 2019-01-21 19:25:58 +01:00
cheme 8ec759d32e Temporary fix for serde issue (#1511)
* Generate serde bound instead of relying on serde_derive.

* remove comment
2019-01-21 19:23:22 +01:00
André Silva 7ccd294de4 core: revert grandpa authorities unless imported blocked is queued (#1508)
* core: revert grandpa authorities unless imported blocked is queued

* core: fix deadlock in `GrandpaBlockImport`
2019-01-21 15:01:27 -03:00
Sergei Pepyakin 603392a9b9 Remove gas function from the public API (#1503)
* Disallow importing `gas` function

* Update srml/contract/src/wasm/prepare.rs

Co-Authored-By: pepyakin <s.pepyakin@gmail.com>
2019-01-21 16:21:32 +01:00
Michael Müller c2f7993d0f Fix wasm allocator (#1506)
* Better allocator for wasm (#1460)

* Add Arch Linux installation instructions

* Enable tracing heap size

* Extract heap

* Replace linear allocator with buddy allocator

* Fix test

The purose of this big block is for the tests
to test a failure when the block is too big
though. The improved buddy allocation strategy
results in this block fitting on the heap now.
Hence the increase.

* Get rid of memcpy in to_vec()

* fixup: Style and comments

* fixup: Split Linux instructions by distribution

To prevent misunderstandings of people executing both.

* fixup: Remove unnecessary types and code

* fixup: Make Pointers start from 1, remove some panics, code improvements

* fixup: Return 0 on errors

* fixup: Move loop to separate function

* fixup: Use FnvHashMap instead of HashMap

* fixup: Fix error handling

* fixup: Use current_size() instead of used_size()

* fixup: Fix and document allocation offset

* fixup: Remove unnecessary multiplication

* fixup: Fix comments

* fixup: Remove Arch installation instructions

* Revert "Fix test"

This reverts commit 292c177df8efaa4658293748a13b1ab1c0b76ea8.

* fixup: Remove unused code, improve import

* fixup: Proper alignment

* fixup: Do not use internal constant in public description

* fixup: Add comment regarding invariants

* fixup: Move assertion to compile-time check

* Fix bug in necessary tree level calculation

The tree levels necessary to house a number
of nodes was calculated incorrectly.

* Improve naming
2019-01-21 16:20:18 +01:00
Pierre Krieger f67c2cc181 Store identification info about the remote (#1500)
* Store identification info about the remote

* Add node name on the wire

* Fix tests
2019-01-21 14:33:25 +01:00
Bastian Köcher 010e63116f Make runtime api calls native when possible (#1302)
* Add simple benchmark for the runtime api

* Make the executor support native calls

* Some documentation

* Hide behind `feature = "std"`

* Rework the native calls

* Make all tests compile again

* Make every parameter using the Block serialized/deserialized in the native call

* Forward `UnwindSafe` requirement

* Remove debug stuff

* Add some documentation

* Fixes warnings

* Fixes errors after master rebase

* Fixes compilation after master rebase

* Fixes compilation after rebase
2019-01-21 14:32:53 +01:00
Sergei Pepyakin f0dbcf5401 Verify that contracts cannot use float operations (#1504) 2019-01-21 14:04:58 +01:00
Marcio Diaz b57486c74f Fix revert for non finalized blocks (#1479)
* fix: temporal modification to make revert works for non finalized blocks

* fix: print info when the number of blocks asked to revert is higher than the number of reversible blocks

* fix: remove function get_db_path_for_subcommand and remove it from all subcommands

* fix: revert only non finalized blocks

* fix: improve printed information for revert command

* fix: new wasm file

* chore: remove unused parameter

* fix: revert log logic

* fix: subcommands should take sub_matches instead of matches

* fix: removing confusing message
2019-01-21 13:52:33 +01:00
Bastian Köcher aad569a1e6 Revert new wasm allocator (#1502)
* Revert "Better allocator for wasm (#1460)"

This reverts commit 1ccb590d18.

* Update wasm files
2019-01-21 12:52:44 +01:00
kyegupov 3857d8aa49 Inline documentation for the decl_module macro and associated types. (#1501) 2019-01-21 12:44:39 +01:00
André Silva 399cee310a Sync block justifications (#1410)
* core: sync protocol for justifications

* core: basic test for justification sync

* core: pass block number with justification

* grandpa: request justifications when importing change blocks

* core: pass finality notifications to chain sync

* core: require justifications for pending change blocks on start

* core: avoid requesting justifications from previous failed peers

* core: timeout block justification requests

* core: add some docs

* core: fix unused variables warning

* core: tick pending justifications fetch periodically

* grandpa: add test for syncing justifications

* core: early exit dispatch of pending justifications

* core: style fix

* core: grandpa: change logging level

* core: sync: add missing docs

* core: network: report peer on bad justification

* core: replace mem::replace with Option::take

* core: revert authority set changes on failed block finalization

* core: grandpa: add docs to import_justification

* core: warn on re-finalization of last finalized block

* core: only notify sync with last finality notification

* core: style fix

* core: add docs for PendingJustifications

* core: network: use BlockRequest messages for justification requests

* core: reference issues in todo comments

* core: grandpa: revert authority set changes on db

* core: grandpa: remove inconsistent state warning
2019-01-21 07:04:01 +01:00
Robert Habermeier 3ea681998a remove unneeded iterator bound on ordered_trie_root (#1490) 2019-01-20 15:49:29 +01:00
Pierre Krieger 763d133173 Put back support for WebSockets in the transport (#1486) 2019-01-19 12:41:17 +01:00
Pierre Krieger b009b42a68 Update network-libp2p to edition 2018 (#1481) 2019-01-19 12:38:52 +01:00
Pierre Krieger f1f32ac620 Don't queue messages after shutdown (#1476) 2019-01-19 12:37:07 +01:00
Tomasz Drwięga a69a09a165 Serialize encoded logs. (#1478) 2019-01-19 12:36:14 +01:00
Tomasz Drwięga 34b21d6dd1 Fix serialization of generic unchecked extrinsics. (#1477) 2019-01-19 12:35:30 +01:00
Pierre Krieger 6ee9b6db25 Fix Dockerfile (#1485)
* Fix Dockerfile

* Use ENTRYPOINT instead of CMD
2019-01-19 12:34:19 +01:00
Sergei Pepyakin 0ad2a5fb96 Some trivial externalities added (#1450)
* Add gas_left, gas_price and balance externalities

* Add a value_transferred externality
2019-01-19 12:33:28 +01:00
Michael Müller 1ccb590d18 Better allocator for wasm (#1460)
* Add Arch Linux installation instructions

* Enable tracing heap size

* Extract heap

* Replace linear allocator with buddy allocator

* Fix test

The purose of this big block is for the tests
to test a failure when the block is too big
though. The improved buddy allocation strategy
results in this block fitting on the heap now.
Hence the increase.

* Get rid of memcpy in to_vec()

* fixup: Style and comments

* fixup: Split Linux instructions by distribution

To prevent misunderstandings of people executing both.

* fixup: Remove unnecessary types and code

* fixup: Make Pointers start from 1, remove some panics, code improvements

* fixup: Return 0 on errors

* fixup: Move loop to separate function

* fixup: Use FnvHashMap instead of HashMap

* fixup: Fix error handling

* fixup: Use current_size() instead of used_size()

* fixup: Fix and document allocation offset

* fixup: Remove unnecessary multiplication

* fixup: Fix comments

* fixup: Remove Arch installation instructions

* Revert "Fix test"

This reverts commit 292c177df8efaa4658293748a13b1ab1c0b76ea8.

* fixup: Remove unused code, improve import

* fixup: Proper alignment

* fixup: Do not use internal constant in public description

* fixup: Add comment regarding invariants

* fixup: Move assertion to compile-time check
2019-01-18 17:29:47 +01:00
郭光华 b066d25cc7 Delete consensus trait from sudo module (#1462) 2019-01-18 09:24:04 +01:00
Benjamin Kampmann d4eb3872a0 Simplier and cleaner implementation of #1468 (#1471)
* Simplier and cleaner implementation of #1468

* move AppInfo into base_path

* default to executable_name rather than pretty visible name
2019-01-17 22:26:58 +01:00
Robert Habermeier a7a0121b09 mark GRANDPA and consensus stuff as unstable (#1469) 2019-01-17 22:07:54 +01:00
Sergei Pepyakin 6e08b64e49 Enable debug assertions while building tests (#1472)
* Add debug-assertions=y

* Return space
2019-01-17 22:06:23 +01:00
Benjamin Kampmann 15856747ae Allow implementation to provide AppInfo to figure out default paths (#1468) 2019-01-17 16:55:55 +01:00
Sergei Pepyakin c88b44f6db Contracts module rejig (#1358)
* Move prepare under code.

* Schedule update

* CodeHash

* create takes code_hash

* pass mem def and use code in vm::execute

* Actually save and load code

* Use T::Hash as CodeHash

* Explicit entrypoint name

* Return code_hash and deposit an Event

* Charge for deployed code with gas.

* ImportSatisfyCheck and FunctionImplProvider

* Progress.

* Use new infrastructure for checking imports

* Rename entrypoint to entrypoint_name

* Use strings instead of a Error enum

* Clean

* WIP

* Fix macro_define_env test.

* Fix vm code tests.

* Remove tests for now.

* Fix borked merge

* Fix build for wasm

* fmt

* Scaffolding for abstracting vm.

* Hook up execution to exec layer.

* Fix vm tests.

* Use schedule directly in WasmLoader

* Implement test language.

* Add input_data test.

* Max depth test

* ext_caller

* Simplify test.

* Add TODO

* Some tests and todos.

* top_level

* Clean.

* Restore a couple of integration tests.

* Add a few comments.

* Add ext_address runtime call.

* Deduplicate caller/self_account

* Add not_exists test.

* Change bool to TransferCause.

* Add address tests.

* Remove output_buf from parameter.

* return from start fn.

* Smart gas meter

* Tracing

* Fix prepare tests.

* Code moving

* Add ExecFeeToken

* Use tokens everywhere.

* Make it compile in no_std.

* Lift all test requirements to TestAuxiliaries

* A minor clean

* First create tests

* Remove unneeded TODO

* Docs.

* Code shuffling

* Rename create → instantiate

* Add test address.

* Code shuffling

* Add base_fee tests.

* rejig the code

* Add some comments

* on_finalise comment

* Move event deposit further

* Update Cargo.lock

* Use crates.io version of pwasm-utils

* Format todo comments

* Fix formatting

* Comments

* EmptyOutputBuf and OutputBuf split.

* Restore code_hash

* Fix node-executor.

* Fix typo

* Fix fmt

* Update srml/contract/src/account_db.rs

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

* Update srml/contract/src/lib.rs

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

* Line wraps

* Wrapping macros

* Add _ prefix

* Grumbles

* Doc updates.

* Update srml/contract/src/wasm/mod.rs

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

* Update srml/contract/src/lib.rs

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

* Add comment

* Use saturation to signal overflow

* Add prepare_test! macro

* Require deploy function.

* Add entry point tests

* Add comment.

* Rename code → code_cache to better describe

* Get rid of weird match!

* Recompile binaries

* Add comments

* refuse_instantiate_with_value_below_existential_deposit

* Little fix

* Make test more complete

* Clean

* Add integration test for instantiation

* Rebuild runtime.

* Add some tests.

* Attach an issue to a TODO

* Attach another issue

* Apply suggestions from code review

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

* Update srml/contract/src/exec.rs

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

* Update srml/contract/src/exec.rs

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

* Recompile node_runtime
2019-01-17 12:01:12 +01:00
thiolliere beeacf9cfa impl HasCompact for Perbill and Permill (#1411)
* impl Compact<> and HasCompact for Permill Perbill

* update parity-codec to 2.2

* add Cargo.lock

* add lock and build for runtime

* rebuild Cargo.lock after rebase
2019-01-17 11:25:48 +01:00
Svyatoslav Nikolsky da1fb3f273 Use changes tries in query_storage RPC (#1082)
* use changes tries in query_storage RPC

* let + match + return + call -> match
2019-01-17 10:08:50 +01:00
Pierre Krieger eb000fb1ae Remove warning for large buffer (#1357) 2019-01-17 09:33:39 +01:00
Svyatoslav Nikolsky d58b23f759 fix tests by rebuilding wasm(s) (#1463) 2019-01-17 08:22:45 +01:00
Pierre Krieger 9018d752dc Update libp2p-kad and libp2p-secio (#1447)
* Update libp2p-kad and libp2p-secio

* Fix concern
2019-01-16 12:59:24 -03:00
Gav Wood c9f047fe84 Split Indices module from Balances (#1404)
* Indices module

* Remove indices stuff from balances

* Rejob node, move Lookup into system.

* Fix up some modules.

* Fix democracy tests

* Fix staking tests

* Fix more tests

* Final test fixes

* Bump runtime versions

* Assets uses compact dispatchers

* Contracts module uses indexed addressing

* Democracy has more compact encoding

* Example now demonstrates compact eencoding

* Sudo uses indexed address

* Upgrade key also uses indexed lookups

* Assets more compact types.

* Fix test

* Rebuild runtime, whitespace

* Remove TOODs

* Remove TODOs

* Add a couple of tests back to balances.

* Update lib.rs

* Update lib.rs
2019-01-16 15:57:19 +01:00
gabriel klawitter 04175ddc83 [CI] Publish rustdoc (#1446)
* build rust docs and publish them on s3

* fix yaml anchors

* debug i

* debug fix

* typo

* add doc build caching

* cache doc artifacts

* test caching

* more caching, aws tuning

* debug i

* debug ii

* rework caching

* send to substrate_service/index.html per default
2019-01-16 12:17:57 +01:00
Marcio Diaz 9151349b2d Make use of NLL in client crate (#1436)
* fix: set edition to 2018 in Cargo.toml.

* fix: refactor function to make use of NLL.

* fix: result of applying 'cargo fix --edition' command.

* fix: removes extern crate

* fix: remove module uses from lib.rs

* fix: tests imports
2019-01-16 11:49:26 +01:00
Robert Habermeier f0b4c87eb5 set wasmi version 0.4.3 in Cargo.toml (#1452) 2019-01-15 21:44:54 +01:00
cheme 753ba7306a Document when a GenesisConfig is generated. (#1437)
* Document when a GenesisConfig is generated.

* Use nocompile.
2019-01-15 11:24:59 +01:00
Xiliang Chen 623775ad96 enable dns transport (#1433) 2019-01-15 11:23:32 +01:00
Fabian Raetz e06ddfecc4 Document how to build substrate on Windows (#1343) (#1429) 2019-01-14 21:53:41 +01:00
Sergei Pepyakin a73280728f Update wabt to to not require python dependency (#1420) 2019-01-14 21:53:09 +01:00
Arkadiy Paronyan 520d2e3227 Update CONTRIBUTING.adoc 2019-01-14 13:42:20 +01:00
Pierre Krieger a0d458aa06 Update to latest libp2p (#1386)
* Update to latest libp2p

* Fix indentations

* Add basic test

* Apply suggestions from code review

Co-Authored-By: tomaka <pierre.krieger1708@gmail.com>

* Remove Mutex from topology

* Remove unused method

* Fix concerns
2019-01-14 13:38:36 +01:00
Benjamin Kampmann 08402d26e6 Update links, labels and process in CONTRIBUTING.adoc (#1409)
* Update CONTRIBUTING.adoc

Fix broken links to labels, update link to style guide. Add breaksapi and breaksconsensus and add a section on easy, medium and mentor ticket to get started. Slight rephrasing to clarify current process.

* Update CONTRIBUTING.adoc
2019-01-14 10:22:17 +01:00
Svyatoslav Nikolsky 616716cb4b GRANDPA finality proof draft (#1268)
* grandpa finality proof

* prove GrandpaApi::grandpa_authorities using parent block + some docs

* create justification when consensus data is changed

* generate justifications periodically

* test for ConsensusChanges
2019-01-11 19:25:03 +01:00
Tomasz Drwięga 677b79765b Fix serialization of extrinsics. (#1402) 2019-01-11 19:24:25 +01:00
Benjamin Kampmann ab12c739ff Upgrade the rocksdb dependency to 0.11 (#1398) 2019-01-11 16:40:36 +01:00
Benjamin Kampmann 7610f64a85 Properly log sealing and the newly created proposal hash from aura (#1397)
* Properly log sealing and the newly created proposal hash from aura

* Update lib.rs
2019-01-11 15:20:40 +01:00