* 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
* fix(extract `timestamp_checked_add` as lib)
* fix(whisper types): remove unused `EmptyTopics`
* fix(time-lib): feature-flag to use time-lib or std
This commit adds conditional compilation checks that falls back to `our time-lib` when
`time_checked_add` is not available in the standard library
Note, `time_checked_add` covers both `checked_add` and `checked_sub`
* fix(grumble): use cfg_attr to define rustc feature
* Remove re-export of `CallContract` and `RegistryInfo` from `ethcore/client`
* Remove CallContract and RegistryInfo re-exports again
This was missed while fixing merge conflicts
- Refactor (and rename crate) and implement RwLock len cache.
- improve docs
- update ethcore verification queue to new version
- Implement Default, From, also derive Debug
- update: parking_lot to 0.7
New util LenCachingMutex can be used in place of a Mutex, when working
with collections, or other types with a len() method. When
the Guard is dropped, the value returned from len() is stored
into an AtomicUsize and can be queried using load_len() without
needing to lock the Mutex. Implementations for ```Vec``` and
```VecDeque```.
Now used in [Verification](4ded4181a6/ethcore/src/verification/queue/mod.rs (L196)) so that calls to ```VerificationQueue.queue_info()```
no longer require locks.
* ethcore: use Machine::verify_transaction on parent block
also fixes off-by-one activation of transaction permission contract
* ethcore: clarify call to verify_transaction
* Update test reference.
Block test are really not working so I disabled a few by commenting
directly in source.
* Move ethtest commit cursor.
* Implements 'NoProof' engine from https://github.com/ethereum/tests/issues/464 .
Since tests has been regenerated those one were failing on block
difficulty check.
Update ethereum/tests, waiting for cost fix (block test are still
commented).
* Update tests submodule reference to latest (all test passing except an
identified case).
Fix block reward of constantinople json.
* Restore broken test by using old json tests files.
* Use CanonNoSeal instead of a custom engine, still have to include some
additional tests code.
* Gas upper limit check in json_chain test was bad, moving the test to
verification, the test is running in `verify_header_param`.
Note that test was previously only for ethash, and now for any engine.
* Restore old behavior (gas uper limit only for ethash engine), at the
cost of an additional trait method.
* Proper rpc test fix.
* Update tests submodule, add SStore bug tests.
* Fix json issue tabulation.
Update tests submodule to latest master (lot of new sstore tests
passing)
* Switch ethereum/tests to tag 6.0.0-beta.1 (no tests changes from latest
synch).
* Display hex with separator, use indirection instead of clone for copy
types.
* VerificationQueue don't spawn up extra threads
In the verification queue we spawn up worker threads to do the work.
However, if `num-verifiers` is specified we still spawn the maximum
number of threads which consume extra memory.
There is one catch though when `--scale-verifiers` is specified then
we can't do it because all threads are created upon initilization AFAIK.
In my opinion, is doesn't to use both `num-verifiers` and
`scale-verifiers` they are kind of contradictory!
* Fix nits in logic and add tests for verification
* refactor(verification queue) - rm hardcoded const
* Address grumbles in new tests
* Remove hardcoded `MAX_VERIFIERS` constant and replace it by relying
entirely on `num_cpu` crate instead inorder to support CPUs that have
more cores/logical cores
* ethcore: don't validate difficulty when ignoring seal check
* ethcore: fix block verification test
* ethcore: document skipped verifications when check_seal is disabled
* blockchain insert expects owned block instead of block reference
* reduce a number of times a block is deserialized
* removed cached uncle_bytes from block
* removed is_finalized from OpenBlock
* removed unused parity_machine::WithMetadata trait
* removed commented out code
* remove unused metadata from block
* remove unused metadata from block
* BlockDetails extras may have at most 5 elements
* Store recently rejected transactions.
* Don't cache AlreadyImported rejections.
* Make the size of transaction verification queue dependent on pool size.
* Add a test for recently rejected.
* Fix logging for recently rejected.
* Make rejection cache smaller.
* obsolete test removed
* obsolete test removed
* Construct cache with_capacity.
* new blooms database
* fixed conflict in Cargo.lock
* removed bloomchain
* cleanup in progress
* all tests passing in trace db with new blooms-db
* added trace_blooms to BlockChainDB interface, fixed db flushing
* BlockChainDB no longer exposes RwLock in the interface
* automatically flush blooms-db after every insert
* blooms-db uses io::BufReader to read files, wrap blooms-db into Mutex, cause fs::File is just a shared file handle
* fix json_tests
* blooms-db can filter multiple possibilities at the same time
* removed enum trace/db.rs CacheId
* lint fixes
* fixed tests
* kvdb-rocksdb uses fs-swap crate
* update Cargo.lock
* use fs::rename
* fixed failing test on linux
* fix tests
* use fs_swap
* fixed failing test on linux
* cleanup after swap
* fix tests
* fixed osx permissions
* simplify parity database opening functions
* added migration to blooms-db
* address @niklasad1 grumbles
* fix license and authors field of blooms-db Cargo.toml
* restore blooms-db after snapshot
* 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
* Add light client TODO item
* Move existing total-difficulty-based fork choice check to Engine
* Abstract total difficulty and block provider as Machine::BlockMetadata and Machine::BlockProvider
* Decouple "generate_metadata" logic to Engine
* Use fixed BlockMetadata and BlockProvider type for null and instantseal
In this way they can use total difficulty fork choice check
* Extend blockdetails with metadatas and finalized info
* Extra data update: mark_finalized and update_metadatas
* Check finalized block in Blockchain
* Fix a test constructor in verification mod
* Add total difficulty trait
* Fix type import
* Db migration to V13 with metadata column
* Address grumbles
* metadatas -> metadata
* Use generic type for update_metadata to avoid passing HashMap all around
* Remove metadata in blockdetails
* [WIP] Implement a generic metadata architecture
* [WIP] Metadata insertion logic in BlockChain
* typo: Value -> Self::Value
* [WIP] Temporarily remove Engine::is_new_best interface
So that we don't have too many type errors.
* [WIP] Fix more type errors
* [WIP] ExtendedHeader::PartialEq
* [WIP] Change metadata type Option<Vec<u8>> to Vec<u8>
* [WIP] Remove Metadata Error
* [WIP] Clean up error conversion
* [WIP] finalized -> is_finalized
* [WIP] Mark all fields in ExtrasInsert as pub
* [WIP] Remove unused import
* [WIP] Keep only local metadata info
* Mark metadata as optional
* [WIP] Revert metadata db change in BlockChain
* [WIP] Put finalization in unclosed state
* Use metadata interface in BlockDetail
* [WIP] Fix current build failures
* [WIP] Remove unused blockmetadata struct
* Remove DB migration info
* [WIP] Typo
* Use ExtendedHeader to implement fork choice check
* Implement is_new_best using Ancestry iterator
* Use expect instead of panic
* [WIP] Add ancestry Engine support via on_new_block
* Fix tests
* Emission of ancestry actions
* use_short_version should take account of metadata
* Engine::is_new_best -> Engine::fork_choice
* Use proper expect format as defined in #1026
* panic -> expect
* ancestry_header -> ancestry_with_metadata
* Boxed iterator -> &mut iterator
* Fix tests
* is_new_best -> primitive_fork_choice
* Document how fork_choice works
* Engine::fork_choice -> Engine::primitive_fork_choice
* comment: clarify types of finalization where Engine::primitive_fork_choice works
* Expose FinalizationInfo to Engine
* Fix tests due to merging
* Remove TotalDifficulty trait
* Do not pass FinalizationInfo to Engine
If there's finalized blocks in from route, choose the old branch without calling `Engine::fork_choice`.
* Fix compile
* Fix unused import
* Remove is_to_route_finalized
When no block reorg passes a finalized block, this variable is always false.
* Address format grumbles
* Fix docs: mark_finalized returns None if block hash is not found
`blockchain` mod does not yet have an Error type, so we still temporarily use None here.
* Fix inaccurate tree_route None expect description
* 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
* Don't panic in import_block if invalid rlp
* Remove redundant type annotation
* Replace RLP header view usage with safe decoding
Using the view will panic with invalid RLP. Here we use Rlp decoding directly which will return a `Result<_, DecoderError>`. While this path currently should not have any invalid RLP - it makes it safer if ever called with invalid RLP from other code paths.
* Fetch logs by hash in blockchain database
* Fix tests
* Add unit test for branch block logs fetching
* Add docs that blocks must already be sorted
* Handle branch block cases properly
* typo: empty -> is_empty
* Remove return_empty_if_none by using a closure
* Use BTreeSet to avoid sorting again
* Move is_canon to BlockChain
* typo: pass value by reference
* Use loop and wrap inside blocks to simplify the code
Borrowed from https://github.com/paritytech/parity/pull/8463#discussion_r183453326
* typo: missed a comment
* WIP
* Convert Ethcore error to use error_chain
* Use error_chain for ImportError and BlockImportError
* Fix error pattern matches for error_chain in miner
* Implement explicit From for AccountsError
* Fix pattern matches for ErrorKinds
* Handle ethcore error_chain in light client
* Explicitly define Result type to avoid shadowing
* Fix remaining Error pattern matches
* Fix tab space formatting
* Helps if the tests compile
* Fix error chain matching after merge
* 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
* Private transaction message added
* Empty line removed
* Private transactions logic removed from client into the separate module
* Fixed compilation after merge with head
* Signed private transaction message added as well
* Comments after the review fixed
* Private tx execution
* Test update
* Renamed some methods
* Fixed some tests
* Reverted submodules
* Fixed build
* Private transaction message added
* Empty line removed
* Private transactions logic removed from client into the separate module
* Fixed compilation after merge with head
* Signed private transaction message added as well
* Comments after the review fixed
* Encrypted private transaction message and signed reply added
* Private tx execution
* Test update
* Main scenario completed
* Merged with the latest head
* Private transactions API
* Comments after review fixed
* Parameters for private transactions added to parity arguments
* New files added
* New API methods added
* Do not process packets from unconfirmed peers
* Merge with ptm_ss branch
* Encryption and permissioning with key server added
* Fixed compilation after merge
* Version of Parity protocol incremented in order to support private transactions
* Doc strings for constants added
* Proper format for doc string added
* fixed some encryptor.rs grumbles
* Private transactions functionality moved to the separate crate
* Refactoring in order to remove late initialisation
* Tests fixed after moving to the separate crate
* Fetch method removed
* Sync test helpers refactored
* Interaction with encryptor refactored
* Contract address retrieving via substate removed
* Sensible gas limit for private transactions implemented
* New private contract with nonces added
* Parsing of the response from key server fixed
* Build fixed after the merge, native contracts removed
* Crate renamed
* Tests moved to the separate directory
* Handling of errors reworked in order to use error chain
* Encodable macro added, new constructor replaced with default
* Native ethabi usage removed
* Couple conversions optimized
* Interactions with client reworked
* Errors omitting removed
* Fix after merge
* Fix after the merge
* private transactions improvements in progress
* private_transactions -> ethcore/private-tx
* making private transactions more idiomatic
* private-tx encryptor uses shared FetchClient and is more idiomatic
* removed redundant tests, moved integration tests to tests/ dir
* fixed failing service test
* reenable add_notify on private tx provider
* removed private_tx tests from sync module
* removed commented out code
* Use plain password instead of unlocking account manager
* remove dead code
* Link to the contract changed
* Transaction signature chain replay protection module created
* Redundant type conversion removed
* Contract address returned by private provider
* Test fixed
* Addressing grumbles in PrivateTransactions (#8249)
* Tiny fixes part 1.
* A bunch of additional comments and todos.
* Fix ethsync tests.
* resolved merge conflicts
* final private tx pr (#8318)
* added cli option that enables private transactions
* fixed failing test
* fixed failing test
* fixed failing test
* fixed failing test