Commit Graph

419 Commits

Author SHA1 Message Date
Niklas Adolfsson 95af04442d bump tinykeccak to 1.4 (#8728) 2018-05-31 13:53:09 +02:00
Niklas Adolfsson 76e874fa82 Remove a couple of unnecessary `transmute()` (#8736) 2018-05-31 13:39:25 +02:00
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
Andrew Jones ccb2bdd70b Increment `patch` for uint and ethereum-types 2018-05-21 11:32:45 +01:00
Andrew Jones 24b94af449 Prefix `0x` for lower hex with alternate flag (#33)
* Prefix `Ox` for lower hex for alternate flag

Should fix https://github.com/paritytech/parity/issues/8393
As per https://doc.rust-lang.org/std/fmt/trait.LowerHex.html

* Use hex alternate format for debug
2018-05-21 12:02:09 +02:00
Andrew Jones f1912b8710 Prefix `0x` for lower hex with alternate flag (#33)
* Prefix `Ox` for lower hex for alternate flag

Should fix https://github.com/paritytech/parity/issues/8393
As per https://doc.rust-lang.org/std/fmt/trait.LowerHex.html

* Use hex alternate format for debug
2018-05-21 12:02:09 +02:00
David deef46f018 Remove the Keccak C library and use the pure Rust impl (#8657)
* Add license and readme

* Use pure rust implementation

* Bump version to 0.1.1

* Don't use C, prefer the pure Rust implementation

* Add test for `write_keccak`

* Bump version

* Add benchmarks

* Add benchmarks

* Add keccak_256, keccak_512, keccak_256_unchecked and keccak_512_unchecked – mostly for compatibility with ethash

* Remove failed git merge attempt from external git repo
Cargo.lock updates

* whitespace

* Mark unsafe function unsafe

* Unsafe calls in unsafe block

* Document unsafety invariants

* Revert unintended changes to Cargo.lock
2018-05-20 12:27:59 +08:00
David 16072d54db Rlp decode returns Result (#8527)
rlp::decode returns Result

Make a best effort to handle decoding errors gracefully throughout the code, using `expect` where the value is guaranteed to be valid (and in other places where it makes sense).
2018-05-08 11:22:12 +02:00
Toralf Wittner f7c46118ef Consolidate crypto functionality in `ethcore-crypto`. (#8432)
* Consolidate crypto functionality in `ethcore-crypto`.

- Move `ecdh`/`ecies` modules to `ethkey`.
- Refactor `ethcore-crypto` to use file per module.
- Replace `subtle` with `ethcore_crypto::is_equal`.
- Add `aes_gcm` module to `ethcore-crypto`.

* Rename `aes::{encrypt,decrypt,decrypt_cbc}` ...

... to `aes::{encrypt_128_ctr,decrypt_128_ctr,decrypt_128_cbc}`.
2018-05-05 11:02:33 +02:00
David eeb01ec2e8 Remove expect (#8536)
* Remove expect and propagate rlp::DecoderErrors as TrieErrors
2018-05-04 10:06:54 +02:00
David c9e60f01b3 Remove expect (#8536)
* Remove expect and propagate rlp::DecoderErrors as TrieErrors
2018-05-04 10:06:54 +02:00
Niklas Adolfsson de434a97f5 Remove unused dependency `bigint` (#8505)
* remove unused dependency bigint in

* remove bigint in rpc_cli
2018-04-27 17:46:17 +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
Andrew Jones 112c89d968 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
Toralf Wittner f064ce5782 Increment versions. (#30)
For `ethereum-types` and `fixed-hash`.
2018-04-11 09:34:33 +02:00
Toralf Wittner ab497004ea Increment versions. (#30)
For `ethereum-types` and `fixed-hash`.
2018-04-11 09:34:33 +02:00
Toralf Wittner 77c648eaad Add `AsMut` impl in `construct_hash` macro. 2018-04-10 16:02:09 +02:00
Marek Kotewicz 8af973492a ethcrypto renamed to ethcore-crypto and moved to ethcore dir (#8340)
* ethcrypto renamed to ethcore-crypto and moved to ethcore dir

* fixed renaming
2018-04-10 13:56:56 +02:00
Wei Tang 38d865143c Decouple rocksdb dependency from ethcore (#8320)
* Move client DB opening logic to CLI

* Move restoration db open logic to CLI

This adds KeyValueDBHandler which handles opening a new database, thus allow us to move the restoration db open logic
out of ethcore.

* Move rocksdb's compactionprofile conversion to CLI

* Move kvdb_rocksdb as test dependency for ethcore

* Fix tests due to interface change

* Fix service tests

* Remove unused migration dep for ethcore
2018-04-09 14:21:37 +02:00
Wei Tang f169c82a2d dapps-fetcher: calculate keccak in-flight while reading the response (#8294)
* dapps-fetcher: calculate keccak in-flight while reading the response

* Rename keccak_buffer_and_write -> keccak_pipe

* Fix file read bug by creating another file handle as the return value
2018-04-03 14:58:55 +02:00
Tomasz Drwięga 69f7da7afa 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 e4037e26b6 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 a3f900bef8 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 f35214ad7e 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 1be68d998e 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 2f79f1bcdc 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 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 80b2b3f54d 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 7b2c6e8b9d 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 965af45dd9 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
Tomasz Drwięga 70cf288545 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
Tomasz Drwięga efa9db77e2 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
Tomasz Drwięga 9ce7a6c00b 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
Tomasz Drwięga ddf73deb29 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
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
Tomasz Drwięga 3aec8b7740 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
Tomasz Drwięga 10b77ed9ea Bump versions. 2018-03-15 10:06:43 +01:00
Tomasz Drwięga 6a339bd230 Bump versions. 2018-03-15 10:06:43 +01:00
Tomasz Drwięga 5064f859c0 Bump versions. 2018-03-15 10:06:43 +01:00
Pierre Krieger eaec085662 Don't use libc with wasm32-unknown-unknown (#27) 2018-03-15 09:41:01 +01:00
Marek Kotewicz 3538b548b1 make patricia-trie more idiomatic and remove redundant code (#8056) 2018-03-06 19:42:24 +01:00
Marek Kotewicz 1cd8e2a068 simplify compression and move it out of rlp crate (#7957)
* simplify compression and move it out of rlp crate

* removed lazy_static dependency from rlp
2018-02-23 10:12:52 +01:00
Marek Kotewicz fb4c561411 simplify compression and move it out of rlp crate (#7957)
* simplify compression and move it out of rlp crate

* removed lazy_static dependency from rlp
2018-02-23 10:12:52 +01:00
Marek Kotewicz c9e178eab9 simplify compression and move it out of rlp crate (#7957)
* simplify compression and move it out of rlp crate

* removed lazy_static dependency from rlp
2018-02-23 10:12:52 +01:00
Marek Kotewicz 69572b88a7 simplify compression and move it out of rlp crate (#7957)
* simplify compression and move it out of rlp crate

* removed lazy_static dependency from rlp
2018-02-23 10:12:52 +01:00
debris 3d43653d9f impl AsRef<Self> for primitives 2018-02-21 14:09:10 +01:00
debris 3eba48bc15 impl AsRef<Self> for primitives 2018-02-21 14:09:10 +01:00