Commit Graph

24 Commits

Author SHA1 Message Date
David d196047064 Add a test for decoding corrupt data (#8713) 2018-05-28 14:41:08 +00:00
Nicolas Gotchac de56eca30b Remove unused imports (#8722) 2018-05-28 14:32:29 +00:00
Benjamin Kampmann ee8876633a Implement recursive Debug for Nodes in patrica_trie::TrieDB (#8697)
fixes #8184
2018-05-25 19:19:32 +08:00
David eeb01ec2e8 Remove expect (#8536)
* Remove expect and propagate rlp::DecoderErrors as TrieErrors
2018-05-04 10:06:54 +02:00
Andrew Jones afe79bee16 Replace legacy Rlp with UntrustedRlp and use in ethcore rlp views (#8316)
* WIP

* Replace Rlp with UntrustedRlp in views, explicity unwrap with expect

First pass to get it to compile. Need to figure out whether to do this or to propogate Errors upstream, which would require many more changes to dependent code. If we do this way we are assuming that the views are always used in a context where the rlp is trusted to be valid e.g. when reading from our own DB. So need to fid out whether views are used with data received from an untrusted (e.g. extrernal peer).

* Remove original Rlp impl, rename UntrustedRlp -> Rlp

* Create rlp views with view! macro to record debug info

Views are assumed to be over valid rlp, so if there is a decoding error we record where the view was created in the first place and report it in the expect

* Use $crate in view! macro to avoid import, fix tests

* Expect valid rlp in decode functions for now

* Replace spaces with tabs in new file

* Add doc tests for creating views with macro

* Update rlp docs to reflect removing of UntrustedRlp

* Replace UntrustedRlp usages in private-tx merge
2018-04-16 15:52:12 +02:00
Tomasz Drwięga a2a088f095 Bump ethabi & ethereum-types. (#8258)
* Bump ethabi & ethereum-types.

* Fix test.

* Fix hex encodings.
2018-04-02 12:12:52 +01:00
Tomasz Drwięga 354948a5a6 Avoid allocations when computing triehash. (#8176)
* Avoid allocations when computing triehash.

* Bump elastic-array to 0.10
2018-03-22 09:24:46 +01:00
Andrew Jones 7c542eb6ce Handle rlp decoding Result in patricia trie (#8166)
* Decode patricia node with UntrustedRlp

(cherry picked from commit efb993b8e7ce087f092cb8c2f633c62ad87e4fb8)

* Replace Rlp with UntrustedRlp in triedbmut

* Handle node decode results in trie
2018-03-22 10:08:48 +08:00
Marek Kotewicz 3538b548b1 make patricia-trie more idiomatic and remove redundant code (#8056) 2018-03-06 19:42:24 +01:00
Marek Kotewicz bc2db6f46a bring back trie and triehash benches (#7926) 2018-02-19 12:03:54 +01:00
Marek Kotewicz 96ef47eace ethabi version 5 (#7723)
* Refactor updater to use ethabi-derive

* Grumble: do_call type alias

* Empty commit to trigger test re-run

* migration to ethabi-5.0

* migration to ethabi-5.0 in progress

* use ethabi_deriven to generate TransactAcl contract

* use ethabi_deriven to generate Registry contract

* hash-fetch uses ethabi_derive, removed retain cycle from updater, fixed #7720

* node-filter crate uses ethabi_derive to generate peer_set contract interface

* use LruCache in node-filter instead of HashMap

* validator_set engine uses ethabi_derive

* ethcore does not depend on native_contracts

* miner does no depend on native_contracts

* secret_store does not use native_contracts (in progress)

* removed native-contracts

* ethcore and updater does not depend on futures

* updated ethereum-types

* fixed all warnings caused by using new version of ethereum-types

* updated ethabi_derive && ethabi_contract to get rid of warnings

* removed another retain cycle in updater, fixed following minor version on update

* moved contracts out of native_contracts res

* updated ethabi_contract

* fixed failing test

* fixed failing test

* there is no need to create two contracts of the same kind any more

* simplify updater::ReleaseTrack conversion into u8 and add several tests for it

* applied review suggestions

* applied review suggestions
2018-02-09 09:32:06 +01:00
Marek Kotewicz da9d4b7bc7 dissolve util (#7460)
* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor finished

* removed obsolete util/src/lib.rs

* removed commented out code
2018-01-10 15:35:18 +03:00
Tomasz Drwięga 3a43846f76 Some more. 2017-12-21 15:37:10 +01:00
Tomasz Drwięga 5a82d3d7c8 Get rid of clippy remainings. 2017-12-21 11:27:26 +01:00
Robert Habermeier 53fc051926 fix tests on patricia-trie 2017-11-17 17:12:12 +01:00
Robert Habermeier 38f6e55f80 update patricia-trie cargo.toml 2017-11-10 20:26:19 +01:00
Robert Habermeier 05658b0397 update rlp 2017-11-10 20:22:45 +01:00
Robert Habermeier 9076e818c4 rename hash crate to keccak-hash 2017-11-10 20:08:28 +01:00
Robert Habermeier 49ac1b9a91 update ethcore-bigint version 2017-11-10 18:50:45 +01:00
Robert Habermeier e80350e7ec prepare cargo configuration for upload of crates 2017-11-10 18:31:31 +01:00
debris bc92cc5cae add missing space to TrieError description 2017-10-16 12:17:06 +02:00
debris dbd2d30728 KeyValueDB trait uses errors instead of strings 2017-10-16 12:11:35 +02:00
Marek Kotewicz 8c7dd0bfe6 Separate migrations from util (#6690)
* separate migration from util and make its dependencies into libs:

* snappy
* kvdb
* error
* common

* renamed common -> macros

* util error does not depend on snappy module

* ethsync does not depend on util nor ethcore_error

* nibbleslice and nibblevec merged with patricia_trie crate

* removed unused dependencies from util

* util journaldb traits does not need to be public

* util_error

* fixed ethcore compile error

* ignore .swo files

* Update chain.rs
2017-10-10 20:01:27 +02:00
Hawstein 96bbd1e826 rename trie to patricia-trie 2017-09-15 11:49:26 +08:00