Commit Graph

113 Commits

Author SHA1 Message Date
s3krit ff398fe7ff
V2.5.6 stable (#10961)
-  Fix cargo audit (#10921)
  - Add support for Energy Web Foundation's new chains (#10957)
  - Kaspersky AV whitelisting (#10919)
  - Avast whitelist script (#10900)
  - Docker images renaming (#10863)
  - Remove excessive warning (#10831)
  - Allow --nat extip:your.host.here.org (#10830)
  - When updating the client or when called from RPC, sleep should mean sleep (#10814)
  - added new ropsten-bootnode and removed old one (#10794)
  - ethkey no longer uses byteorder (#10786)
  - Do not drop the peer with None difficulty (#10772)
  - docs: Update Readme with TOC, Contributor Guideline. Update Cargo package descriptions (#10652)
2019-08-12 18:55:11 +02:00
s3krit 3fd58bdcbd
Beta 2.5.3 (#10776)
* ethcore/res: activate atlantis classic hf on block 8772000 (#10766)

* fix docker tags for publishing (#10741)

* fix: aura don't add `SystemTime::now()` (#10720)

This commit does the following:
- Prevent overflow in `verify_timestamp()` by not adding `now` to found faulty timestamp
- Use explicit `CheckedSystemTime::checked_add` to prevent potential consensus issues because SystemTime is platform
depedent
- remove `#[cfg(not(time_checked_add))]` conditional compilation

* Update version

* Treat empty account the same as non-exist accounts in EIP-1052 (#10775)

* DevP2p: Get node IP address and udp port from Socket, if not included in PING packet (#10705)

* get node IP address and udp port from Socket, if not included in PING packet

* prevent bootnodes from being added to host nodes

* code corrections

* code corrections

* code corrections

* code corrections

* docs

* code corrections

* code corrections

* Apply suggestions from code review

Co-Authored-By: David <dvdplm@gmail.com>

* Add a way to signal shutdown to snapshotting threads (#10744)

* Add a way to signal shutdown to snapshotting threads

* Pass Progress to fat_rlps() so we can abort from there too.

* Checking for abort in a single spot

* Remove nightly-only weak/strong counts

* fix warning

* Fix tests

* Add dummy impl to abort snapshots

* Add another dummy impl for TestSnapshotService

* Remove debugging code

* Return error instead of the odd Ok(())
Switch to AtomicU64

* revert .as_bytes() change

* fix build

* fix build maybe
2019-06-25 13:38:29 +00:00
Niklas Adolfsson 91933d857d perf(ethcore): `micro-opt` (#10405)
Mostly fixes that changes `eagerly eval` to `lazy eval`
2019-03-06 15:30:35 +01:00
cheme 6bb106a784 Update to latest mem-db, hash-db and trie-db. (#10314)
* Switch to 'trie' crates, there is an unpublished deps to staging
parity-common triehash still.

* Use crates.io dependency.

* indentation

* Update util/journaldb/src/traits.rs

indentation

Co-Authored-By: cheme <emericchevalier.pro@gmail.com>

* Update ethcore/src/snapshot/tests/state.rs

Co-Authored-By: cheme <emericchevalier.pro@gmail.com>
2019-02-20 21:09:34 +03:00
Afri Schoedon 7c335e8764
misc: bump license header to 2019 (#10135)
* misc: bump license header to 2019

* misc: remove_duplicate_empty_lines.sh

* misc: run license header script

* commit cargo lock
2019-01-07 11:33:07 +01:00
Tomasz Drwięga 3650f2d51c Extract blockchain from ethcore (#10114)
* Split blockchain & db from ethcore.

* Clean up blockchain deps.

* Missing docs.

* Fix blockchain tests.

* Make other crates compile.

* Remove some re-exports.

* Remove types re-export from ethcore.

* Remove EVM dependency from transaction.

* Merge ethcore-transaction with common-types.

* Clean-up ethcore deps a bit.

* remove ethcore from cargo.toml

* Update ethcore/blockchain/src/lib.rs

Co-Authored-By: tomusdrw <tomusdrw@users.noreply.github.com>

* Address review comments.

* Update DB comment.

* Add tracking issue to the TODO and fix typo.

* Common naming for common types.

* Update ethcore/db/src/keys.rs

Co-Authored-By: tomusdrw <tomusdrw@users.noreply.github.com>

* Update ethcore/blockchain/src/generator.rs

Co-Authored-By: tomusdrw <tomusdrw@users.noreply.github.com>

* Try to fix beta tests.
2019-01-04 14:05:46 +01:00
Tomasz Drwięga 61e8baee0c Bump crossbeam. (#10048) 2018-12-11 12:30:21 +00:00
Nicolas Gotchac 9475a2e474 Keep existing blocks when restoring a Snapshot (#8643)
* Rename db_restore => client

* First step: make it compile!

* Second step: working implementation!

* Refactoring

* Fix tests

* PR Grumbles

* PR Grumbles WIP

* Migrate ancient blocks interating backward

* Early return in block migration if snapshot is aborted

* Remove RwLock getter (PR Grumble I)

* Remove dependency on `Client`: only used Traits

* Add test for recovering aborted snapshot recovery

* Add test for migrating old blocks

* Fix build

* PR Grumble I

* PR Grumble II

* PR Grumble III

* PR Grumble IV

* PR Grumble V

* PR Grumble VI

* Fix one test

* Fix test

* PR Grumble

* PR Grumbles

* PR Grumbles II

* Fix tests

* Release RwLock earlier

* Revert Cargo.lock

* Update _update ancient block_ logic: set local in `commit`

* Update typo in ethcore/src/snapshot/service.rs

Co-Authored-By: ngotchac <ngotchac@gmail.com>
2018-11-18 00:06:34 +01:00
David c313039526 Update a few parity-common dependencies (#9663)
* Update a few parity-common dependencies

* cleanup

* cleanup

* revert update of ethereum/tests

* better reporting of network rlp errors

* Use rlp 0.3.0-beta.1

* fix util function get_dummy_blocks

* Already a Vec

* encode_list returns vec already

* Address grumble

* No need for betas

* Fix double spaces
2018-10-09 22:07:25 +02:00
Nicolas Gotchac 4ddd69cc55 Multithreaded snapshot creation (#9239)
* Add Progress to Snapshot Secondary chunks creation

* Use half of CPUs to multithread snapshot creation

* Use env var to define number of threads

* info to debug logs

* Add Snapshot threads as CLI option

* Randomize chunks per thread

* Remove randomness, add debugging

* Add warning

* Add tracing

* Use parity-common fix seek branch

* Fix log

* Fix tests

* Fix tests

* PR Grumbles

* PR Grumble II

* Update Cargo.lock

* PR Grumbles

* Default snapshot threads to half number of CPUs

* Fix default snapshot threads // min 1
2018-09-13 12:58:49 +02:00
Afri Schoedon 8dd4db5d85 docs: update repository links (#9159)
* docs: update repository links

* docs: update repository links in contribution guide
2018-07-23 13:58:50 +02:00
David 9caa868603
Make HashDB generic (#8739)
The `patricia_trie` crate is generic over the hasher (by way of HashDB) and node encoding scheme. Adds a new `patricia_trie_ethereum` crate with concrete impls for Keccak/RLP.
2018-07-02 18:50:05 +02:00
Niklas Adolfsson 98b7c07171 Update `license header` and `scripts` (#8666)
* Update `add_license` script

* run script

* add `remove duplicate lines script` and run it

* Revert changes `English spaces`

* strip whitespaces

* Revert `GPL` in files with `apache/mit license`

* don't append `gpl license` in files with other lic

* Don't append `gpl header` in files with other lic.

* re-ran script

* include c and cpp files too

* remove duplicate header

* rebase nit
2018-06-04 10:19:50 +02:00
David 842b75c0e6 Decoding headers can fail (#8570)
* rlp::decode returns Result

* Fix journaldb to handle rlp::decode Result

* Fix ethcore to work with rlp::decode returning Result

* Light client handles rlp::decode returning Result

* Fix tests in rlp_derive

* Fix tests

* Cleanup

* cleanup

* Allow panic rather than breaking out of iterator

* Let decoding failures when reading from disk blow up

* syntax

* Fix the trivial grumbles

* Fix failing tests

* Make Account::from_rlp return Result

* Syntx, sigh

* Temp-fix for decoding failures

* Header::decode returns Result

Handle new return type throughout the code base.

* Do not continue reading from the DB when a value could not be read

* Fix tests

* Handle header decoding in light_sync

* Handling header decoding errors

* Let the DecodeError bubble up unchanged

* Remove redundant error conversion
2018-05-09 12:05:56 +02:00
David 28c731881f
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
Andrew Jones a04c5b180a 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 9f775a7673 Remove RefCell from Header (#8227)
* Cache RLP and header hashes.

* Refactor header - WiP

* Avoid decoding laster header.

* Pre-compute hashes for Sealed/Locked block.

* Use accrue bloom. Closes ##8241
2018-04-03 17:01:28 +09:00
Tomasz Drwięga d90ab40a78 Detect too large packets in snapshot sync. (#7977) 2018-02-22 14:52:29 +01:00
Marek Kotewicz c060d9584d
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 e95b093483 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
Dmitry Kashitsyn c0fc83988f Refactors ethcore to use journaldb crate (#6693) 2017-10-17 11:46:07 +07:00
debris fa019bd03e remove ipc codegen from ethcore 2017-10-16 17:50:25 +02:00
Marek Kotewicz 6279ff32f5 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
Robert Habermeier bc167a211b Generalize engine trait (#6591)
* move common forks and parameters to common params

* port specs over to new format

* fix RPC tests

* parity-machine skeleton

* remove block type

* extract out ethereum-specific methods into EthereumMachine

* beginning to integrate Machine into engines. dealing with stale transitions in Ethash

* initial porting to machine

* move block reward back into engine

* abstract block reward logic

* move last hash and DAO HF logic into machine

* begin making engine function parameters generic

* abstract epoch verifier and ethash block reward logic

* instantiate special ethereummachine for ethash in spec

* optional full verification in verify_block_family

* re-instate tx_filter in a way that works for all engines

* fix warnings

* fix most tests, further generalize engine trait

* uncomment nullengine, get ethcore tests compiling

* fix warnings

* update a bunch of specs

* re-enable engine signer, validator set, and transition handler

* migrate basic_authority engine

* move last hashes into executedblock

* port tendermint

* make all ethcore tests pass

* json-tests compilation

* fix RPC tests: change in gas limit for new block changed PoW hash

* fix minor grumbles

* validate chainspecs

* fix broken import

* fix transaction verification for pre-homestead
2017-09-26 14:19:08 +02:00
Hawstein ade37be25b separate trie from util and make its dependencies into libs:
* bytes
* hashdb
* memorydb
* nibbleslice
* nibblevec
2017-09-15 11:03:53 +08:00
Fredrik e54784bfeb Merge branch 'master' into fo-6418-dont-export-bigint
# Conflicts:
#	dapps/src/tests/helpers/registrar.rs
#	ethcore/evm/src/interpreter/shared_cache.rs
#	ethcore/light/src/client/header_chain.rs
#	ethcore/light/src/client/mod.rs
#	ethcore/light/src/net/mod.rs
#	ethcore/light/src/on_demand/request.rs
#	ethcore/light/src/on_demand/tests.rs
#	ethcore/light/src/provider.rs
#	ethcore/node_filter/src/lib.rs
#	ethcore/src/block.rs
#	ethcore/src/blockchain/blockchain.rs
#	ethcore/src/client/test_client.rs
#	ethcore/src/engines/authority_round/mod.rs
#	ethcore/src/engines/basic_authority.rs
#	ethcore/src/engines/mod.rs
#	ethcore/src/engines/tendermint/mod.rs
#	ethcore/src/engines/validator_set/contract.rs
#	ethcore/src/engines/validator_set/multi.rs
#	ethcore/src/engines/validator_set/safe_contract.rs
#	ethcore/src/engines/vote_collector.rs
#	ethcore/src/miner/external.rs
#	ethcore/src/miner/miner.rs
#	ethcore/src/miner/service_transaction_checker.rs
#	ethcore/src/miner/work_notify.rs
#	ethcore/src/pod_account.rs
#	ethcore/src/pod_state.rs
#	ethcore/src/snapshot/block.rs
#	ethcore/src/snapshot/consensus/work.rs
#	ethcore/src/snapshot/mod.rs
#	ethcore/src/snapshot/service.rs
#	ethcore/src/spec/spec.rs
#	ethcore/src/state/backend.rs
#	ethcore/src/trace/db.rs
#	ethcore/src/verification/queue/mod.rs
#	ethcore/src/verification/verification.rs
#	parity/informant.rs
#	rpc/src/v1/helpers/dispatch.rs
#	rpc/src/v1/helpers/light_fetch.rs
#	rpc/src/v1/helpers/signing_queue.rs
#	rpc/src/v1/impls/eth.rs
#	rpc/src/v1/impls/eth_filter.rs
#	rpc/src/v1/impls/eth_pubsub.rs
#	rpc/src/v1/impls/light/eth.rs
#	rpc/src/v1/impls/signing.rs
#	rpc/src/v1/tests/helpers/miner_service.rs
#	rpc/src/v1/tests/helpers/snapshot_service.rs
#	rpc/src/v1/tests/helpers/sync_provider.rs
#	rpc/src/v1/tests/mocked/eth.rs
#	stratum/src/lib.rs
#	sync/src/blocks.rs
#	sync/src/chain.rs
#	sync/src/light_sync/mod.rs
#	sync/src/tests/helpers.rs
#	sync/src/tests/snapshot.rs
#	updater/src/updater.rs
#	util/src/lib.rs
#	util/triehash/src/lib.rs
2017-09-04 18:32:55 +02:00
Fredrik 308f36a532 Don't reexport bigint from util 2017-09-04 16:36:49 +02:00
Hawstein 7b8af30590 remove re-export of parking_lot in util (#6435) 2017-09-02 20:09:13 +02:00
debris f0e8abb07b Hashable::sha3 -> fn keccak for ethcore 2017-08-30 19:18:28 +02:00
Vurich 3d8dc11442 Upgrade `elastic-array` to 0.9.0
This is a huge change, which includes some changes to replace code that
originally cloned to reuse allocations instead. The updated
`elastic-array` crate renames its consuming `Vec`-conversion method to
`into_vec`, which means that I can do a simple
`sed -i 's/to_vec/into_vec/'` and then fix the compilation errors.

This commit is probably a minor performance win and definitely a
significant readability win.
2017-06-29 13:05:33 +02:00
Nikolay Volf e1fef5c732 Update dependencies and bigint api (#5685)
* update to latest bigint

* bump elastic array and deps

* fix rlp tests

* also update all smallvec deps

* fix doc test

* reduce parking in attempt to fix CI bug

* fix from/into electum bug

* remove duplicate imports
2017-05-24 12:31:33 +02:00
Robert Habermeier 4c5e4ac8da PoA warp implementation (#5488)
* separate modules for consensus snapshot chunks

* bulk of authority warp logic

* finish authority warp implementation

* squash warnings and enable authority snapshot mode

* test harness for PoA

* fiddle with harness

* epoch generation proof fixes

* update constructor code

* store epoch transition proof after block commit

* basic snap and restore test

* use keyvaluedb in state restoration

* decompress chunks

* fix encoding issues

* fixed-to-contract-to-contract test

* implement ancient block import

* restore genesis transition in PoW snapshot

* add format version method to snapshot components

* supported version numbers in snapshot_components

* allow returning of ancient epoch transitions

* genesis hash mismatch check

* remove commented code
2017-05-17 12:41:33 +02:00
Robert Habermeier 2ec3397b7d snapshot chunk and restore traits 2017-04-19 20:31:53 +02:00
Robert Habermeier 2d8a8bd3e5 engine changes 2017-04-12 14:41:19 +02:00
Robert Habermeier a254b2098f more useful Engine::verify_seal 2017-04-11 17:07:04 +02:00
arkpar b840ab8f8b Compact chunks 2017-03-31 16:31:12 +02:00
Tomasz Drwięga d2394d3ac3 Updating paths to repos. (#5330)
* Updating paths to repos.

* Updating rotor and libusb

* Fixing other occurrences
2017-03-29 15:17:27 +02:00
arkpar b0a9c1e0fa Limit by entry count 2017-03-25 15:25:20 +01:00
arkpar 4ef89b5ccb Fine grained snapshot chunking 2017-03-25 13:22:25 +01:00
Robert Habermeier 109012cae8 force earliest era set in snapshot restore (#5021) 2017-03-25 10:00:50 +01:00
Marek Kotewicz 044d070667 rlp deserialization refactor, 30% faster (#4901)
* fixed naming of rlp modules

* RlpStream cleanup

* appending short rlp lists (0...55 bytes) is 25% faster

* RlpStream does not use bytes module, nor trait Stream

* removed unused code from rlp module

* compiling ethcore-util with new rlp serialization

* compiling parity with new rlp serialization

* fixed compiling ethcore-light with new rlp serialization

* fixed compiling ethsync with new rlp serialization

* moved rlp benches and rlp tests

* rlp deserialization refactor, 30% faster

* removed redundant comment, print

* fixed compiling parity with new rlp deserialization

* removed redundant double-space

* fixed failing test

* updated rlp docs, removed unused traits

* fixed rlp benchmarks

* replace usage of WriteBytesExt with ByteOrder

* removed unused, commented out code

* fixed merge conflict
2017-03-22 14:41:46 +01:00
Marek Kotewicz a555686bcd rlp serialization refactor (#4873)
* fixed naming of rlp modules

* RlpStream cleanup

* appending short rlp lists (0...55 bytes) is 25% faster

* RlpStream does not use bytes module, nor trait Stream

* removed unused code from rlp module

* compiling ethcore-util with new rlp serialization

* compiling parity with new rlp serialization

* fixed compiling ethcore-light with new rlp serialization

* fixed compiling ethsync with new rlp serialization

* removed redundant comment, print

* removed redundant double-space

* replace usage of WriteBytesExt with ByteOrder
2017-03-20 19:14:29 +01:00
Marek Kotewicz 3fe3353696 removed redundant FixedHash trait, fixes #4029 (#4866) 2017-03-11 22:58:15 +04:00
Gav Wood 8404edb656 Fix whitespace (#4299)
* Fix whitespace.

* Update copyright years/owner.

* Push release only for tags.
2017-01-25 18:51:41 +01:00
Robert Habermeier 5d2cf22ef4 use basic_account in snapshot 2017-01-03 17:05:27 +01:00
Robert Habermeier fe1f542c4f Owning views of blockchain data (#3982)
* owning views of blockchain data

* port blockchain and client traits to owning views

* fix ethcore tests

* use strong headers and bodies in ethcore_light

* port ethsync to use owning views

* port rpc to owning views

* port parity informant and blockchain export
2016-12-28 12:44:51 +00:00
Robert Habermeier 8125b5690c Port `try` macro to new `?` operator. (#3962)
* initial untry sweep

* restore try in ipc codegen, fix inference

* change a few missed try instances
2016-12-27 12:53:56 +01:00
Gav Wood 17cc2be4b5
Rename ethcore -> parity in license. 2016-12-11 19:30:54 +01:00
Gav Wood 5f1fcf95e0
Make *ID names consistent with std Rust (Id) 2016-12-09 23:01:43 +01:00
Tomasz Drwięga 2b3d100de2 Fixing some clippy warnings 2016-11-28 15:54:22 +01:00