1. Jun 01, 2018
    • David's avatar
      Print warnings when fetching pending blocks (#8711) · 799ae29a
      David authored and Marek Kotewicz's avatar Marek Kotewicz committed
      * Lots of println to figure out what eth_getBlockByNumber does/should do
      
      * Remove debugging
      
      * Print warnings when fetching pending blocks
      
      When calling `eth_getBlockByNumber` with `pending`, we now print a deprecation warning and:
      
      * if a pending block is found, use it to respond
      * if no pending block is found, respond as if if was a request for `Latest`
      
      Addresses issue #8703 (not sure if it's enough to close it tbh)
      799ae29a
  2. May 31, 2018
  3. May 29, 2018
  4. May 22, 2018
  5. May 17, 2018
  6. May 16, 2018
    • Nicolas Gotchac's avatar
      Resumable warp-sync / Seed downloaded snapshots (#8544) · cdbcfaa7
      Nicolas Gotchac authored
      * Start dividing sync chain : first supplier method
      
      * WIP - updated chain sync supplier
      
      * Finish refactoring the Chain Sync Supplier
      
      * Create Chain Sync Requester
      
      * Add Propagator for Chain Sync
      
      * Add the Chain Sync Handler
      
      * Move tests from mod -> handler
      
      * Move tests to propagator
      
      * Refactor SyncRequester arguments
      
      * Refactoring peer fork header handler
      
      * Fix wrong highest block number in snapshot sync
      
      * Small refactor...
      
      * Resume warp-sync downloaded chunks
      
      * Add comments
      
      * Refactoring the previous chunks import
      
      * Fix tests
      
      * Address PR grumbles
      
      * Fix not seeding current snapshot
      
      * Address PR Grumbles
      
      * Address PR grumble
      
      * Retry failed CI job
      
      * Update SnapshotService readiness check
      Fix restoration locking issue for previous chunks restoration
      
      * Fix tests
      
      * Fix tests
      
      * Fix test
      
      * Early abort importing previous chunks
      
      * PR Grumbles
      
      * Update Gitlab CI config
      
      * SyncState back to Waiting when Manifest peers disconnect
      
      * Move fix
      
      * Better fix
      
      * Revert GitLab CI changes
      
      * Fix Warning
      
      * Refactor resuming snapshots
      
      * Fix string construction
      
      * Revert "Refactor resuming snapshots"
      
      This reverts commit 75fd4b553a38e4a49dc5d6a878c70e830ff382eb.
      
      * Update informant log
      
      * Fix string construction
      
      * Refactor resuming snapshots
      
      * Fix informant
      
      * PR Grumbles
      
      * Update informant message : show chunks done
      
      * PR Grumbles
      
      * Fix
      
      * Fix Warning
      
      * PR Grumbles
      cdbcfaa7
    • Wei Tang's avatar
      Fork choice and metadata framework for Engine (#8401) · 0ecbb3ec
      Wei Tang authored
      * 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
      0ecbb3ec
  7. May 15, 2018
  8. May 14, 2018
  9. May 12, 2018
    • lihuafeng's avatar
      2 tiny modification on snapshot (#8601) · 979af3d3
      lihuafeng authored and Niklas Adolfsson's avatar Niklas Adolfsson committed
      * Some tiny modifications.
      1. fix some typo in the comment.
      2. sort the order of methods in 'impl state::Backend for StateDB`
      
      * Remove the clone of code_cache, as it has been done in clone_basic.
      
      * remove From::from. It seems not necessary.
      
      * change mode: remove rust files' executable mode.
      
      * 2 tiny modifications on snapshot.
      979af3d3
  10. May 11, 2018
  11. May 09, 2018
    • Wei Tang's avatar
      Remove unnecessary cloning in overwrite_with (#8580) · cddc33bb
      Wei Tang authored and asynchronous rob's avatar asynchronous rob committed
      * Remove unnecessary cloning in overwrite_with
      
      * Remove into_iter
      cddc33bb
    • David's avatar
      Decoding headers can fail (#8570) · 842b75c0
      David authored
      * 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
      842b75c0
    • Wei Tang's avatar
      Remove State::replace_backend (#8569) · b8468216
      Wei Tang authored
      b8468216
    • Tomasz Drwięga's avatar
      Don't block sync when importing old blocks (#8530) · 24838bbc
      Tomasz Drwięga authored
      * Alter IO queueing.
      
      * Don't require IoMessages to be Clone
      
      * Ancient blocks imported via IoChannel.
      
      * Get rid of private transactions io message.
      
      * Get rid of deadlock and fix disconnected handler.
      
      * Revert to old disconnect condition.
      
      * Fix tests.
      
      * Fix deadlock.
      24838bbc
    • Wei Tang's avatar
      Trace precompiled contracts when the transfer value is not zero (#8486) · 7a00d979
      Wei Tang authored
      * Trace precompiled contracts when the transfer value is not zero
      
      * Add tests for precompiled CALL tracing
      
      * Use byzantium test machine for the new test
      
      * Add notes in comments on why we don't trace all precompileds
      
      * Use is_transferred instead of transferred
      7a00d979
  12. May 08, 2018
    • David's avatar
      Rlp decode returns Result (#8527) · 28c73188
      David authored
      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).
      28c73188
  13. May 07, 2018
    • Wei Tang's avatar
      Keep all enacted blocks notify in order (#8524) · 528497b8
      Wei Tang authored
      * Keep all enacted blocks notify in order
      
      * Collect is unnecessary
      
      * Update ChainNotify to use ChainRouteType
      
      * Fix all ethcore fn defs
      
      * Wrap the type within ChainRoute
      
      * Fix private-tx and sync api
      
      * Fix secret_store API
      
      * Fix updater API
      
      * Fix rpc api
      
      * Fix informant api
      
      * Eagerly cache enacted/retracted and remove contain_enacted/retracted
      
      * Fix indent
      
      * tests: should use full expr form for struct constructor
      
      * Use into_enacted_retracted to further avoid copy
      
      * typo: not a function
      
      * rpc/tests: ChainRoute -> ChainRoute::new
      528497b8
    • André Silva's avatar
  14. May 05, 2018
    • Toralf Wittner's avatar
      Consolidate crypto functionality in `ethcore-crypto`. (#8432) · e30839e8
      Toralf Wittner authored and Marek Kotewicz's avatar Marek Kotewicz committed
      * 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}`.
      e30839e8
    • Wei Tang's avatar
      EIP 145: Bitwise shifting instructions in EVM (#8451) · a4c7843a
      Wei Tang authored and Marek Kotewicz's avatar Marek Kotewicz committed
      * Add SHL, SHR, SAR opcodes
      
      * Add have_bitwise_shifting schedule flag
      
      * Add all EIP tests for SHL
      
      * Add SHR implementation and tests
      
      * Implement SAR and add tests
      
      * Add eip145transition config param
      
      * Change map_or to map_or_else when possible
      a4c7843a
  15. May 03, 2018
    • Andrew Jones's avatar
      Don't panic in import_block if invalid rlp (#8522) · 66c0638f
      Andrew Jones authored and Marek Kotewicz's avatar Marek Kotewicz committed
      * 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.
      66c0638f
  16. May 02, 2018
    • Wei Tang's avatar
      Pass on storage keys tracing to handle the case when it is not modified (#8491) · eec73647
      Wei Tang authored
      * Pass on storage keys even if it is not modified
      
      * typo: account and storage query
      
      `to_pod_diff` builds both `touched_addresses` merge and storage keys merge.
      
      * Fix tests
      
      * Use state query directly because of suicided accounts
      
      * Fix a RefCell borrow issue
      
      * Add tests for unmodified storage trace
      
      * Address grumbles
      
      * typo: remove unwanted empty line
      
      * ensure_cached compiles with the original signature
      eec73647
    • Wei Tang's avatar
      Fetching logs by hash in blockchain database (#8463) · b1009450
      Wei Tang authored and Marek Kotewicz's avatar Marek Kotewicz committed
      * 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
      b1009450
  17. May 01, 2018
  18. Apr 27, 2018
  19. Apr 20, 2018
    • Wei Tang's avatar
      Improve VM executor stack size estimation rules (#8439) · 28b5906d
      Wei Tang authored
      * Improve VM executor stack size estimation rules
      
      * typo: docs add "(Debug build)" comment
      
      * Fix an off by one typo and set minimal stack size
      
      This avoids the case if `depth_threshold == max_depth`. Usually setting stack size to zero will just rebound it to
      platform minimal stack size, but we set it here just in case.
      
      * Use saturating_sub to avoid potential overflow
      28b5906d
    • André Silva's avatar
      Block reward contract (#8419) · 24f6d829
      André Silva authored
      * engine: add block reward contract abi and helper client
      
      * aura: add support for block reward contract
      
      * engine: test block reward contract client
      
      * aura: test block reward contract
      
      * engine + aura: add missing docs
      
      * engine: share SystemCall type alias
      
      * aura: add transition for block reward contract
      
      * engine: fix example block reward contract source link and bytecode
      24f6d829
    • Wei Tang's avatar
      Permission fix (#8441) · 9c5e3554
      Wei Tang authored
      9c5e3554
  20. Apr 19, 2018
    • lihuafeng's avatar
      remove From::from. (#8390) · 8fb47b52
      lihuafeng authored and Marek Kotewicz's avatar Marek Kotewicz committed
      * Some tiny modifications.
      1. fix some typo in the comment.
      2. sort the order of methods in 'impl state::Backend for StateDB`
      
      * Remove the clone of code_cache, as it has been done in clone_basic.
      
      * remove From::from. It seems not necessary.
      8fb47b52
    • Andrew Jones's avatar
      Move ethcore::Error to error_chain (#8386) · 14361cc7
      Andrew Jones authored
      * 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
      14361cc7
    • Tomasz Drwięga's avatar
      Fix receipts stripping. (#8414) · 461b2d48
      Tomasz Drwięga authored
      461b2d48
  21. Apr 16, 2018
    • Andrew Jones's avatar
      Replace legacy Rlp with UntrustedRlp and use in ethcore rlp views (#8316) · a04c5b18
      Andrew Jones authored
      * 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
      a04c5b18
  22. Apr 14, 2018
  23. Apr 13, 2018
    • Wei Tang's avatar
      Unify and limit rocksdb dependency places (#8371) · 897a9464
      Wei Tang authored
      * secret_store: remove kvdb_rocksdb dependency
      
      * cli: init db mod for open dispatch
      
      * cli: move db, client_db, restoration_db, secretstore_db to a separate mod
      
      * migration: rename to migration-rocksdb and remove ethcore-migrations
      
      * ethcore: re-move kvdb-rocksdb dep to test
      
      * mark test_helpers as test only and fix migration mod naming
      
      * Move restoration_db_handler to test_helpers_internal
      
      * Fix missing preambles in test_helpers_internal and rocksdb/helpers
      
      * Move test crates downward
      
      * Fix missing docs
      
      * cli, db::open_db: move each argument to a separate line
      
      * Use featuregate instead of dead code for `open_secretstore_db`
      
      * Move pathbuf import to open_secretstore_db
      
      Because it's only used there behind a feature gate
      897a9464
    • Tomasz Drwięga's avatar
      New Transaction Queue implementation (#8074) · 1cd93e4c
      Tomasz Drwięga authored and Marek Kotewicz's avatar Marek Kotewicz committed
      * Implementation of Verifier, Scoring and Ready.
      
      * Queue in progress.
      
      * TransactionPool.
      
      * Prepare for txpool release.
      
      * Miner refactor [WiP]
      
      * WiP reworking miner.
      
      * Make it compile.
      
      * Add some docs.
      
      * Split blockchain access to a separate file.
      
      * Work on miner API.
      
      * Fix ethcore tests.
      
      * Refactor miner interface for sealing/work packages.
      
      * Implement next nonce.
      
      * RPC compiles.
      
      * Implement couple of missing methdods for RPC.
      
      * Add transaction queue listeners.
      
      * Compiles!
      
      * Clean-up and parallelize.
      
      * Get rid of RefCell in header.
      
      * Revert "Get rid of RefCell in header."
      
      This reverts commit 0f2424c9b7319a786e1565ea2a8a6d801a21b4fb.
      
      * Override Sync requirement.
      
      * Fix status display.
      
      * Unify logging.
      
      * Extract some cheap checks.
      
      * Measurements and optimizations.
      
      * Fix scoring bug, heap size of bug and add cache
      
      * Disable tx queueing and parallel verification.
      
      * Make ethcore and ethcore-miner compile again.
      
      * Make RPC compile again.
      
      * Bunch of txpool tests.
      
      * Migrate transaction queue tests.
      
      * Nonce Cap
      
      * Nonce cap cache and tests.
      
      * Remove stale future transactions from the queue.
      
      * Optimize scoring and write some tests.
      
      * Simple penalization.
      
      * Clean up and support for different scoring algorithms.
      
      * Add CLI parameters for the new queue.
      
      * Remove banning queue.
      
      * Disable debug build.
      
      * Change per_sender limit to be 1% instead of 5%
      
      * Avoid cloning when propagating transactions.
      
      * Remove old todo.
      
      * Post-review fixes.
      
      * Fix miner options default.
      
      * Implement back ready transactions for light client.
      
      * Get rid of from_pending_block
      
      * Pass rejection reason.
      
      * Add more details to drop.
      
      * Rollback heap size of.
      
      * Avoid cloning hashes when propagating and include more details on rejection.
      
      * Fix tests.
      
      * Introduce nonces cache.
      
      * Remove uneccessary hashes allocation.
      
      * Lower the mem limit.
      
      * Re-enable parallel verification.
      
      * Add miner log. Don't check the type if not below min_gas_price.
      
      * Add more traces, fix disabling miner.
      
      * Fix creating pending blocks twice on AuRa authorities.
      
      * Fix tests.
      
      * re-use pending blocks in AuRa
      
      * Use reseal_min_period to prevent too frequent update_sealing.
      
      * Fix log to contain hash not sender.
      
      * Optimize local transactions.
      
      * Fix aura tests.
      
      * Update locks comments.
      
      * Get rid of unsafe Sync impl.
      
      * Review fixes.
      
      * Remove excessive matches.
      
      * Fix compilation errors.
      
      * Use new pool in private transactions.
      
      * Fix private-tx test.
      
      * Fix secret store tests.
      
      * Actually use gas_floor_target
      
      * Fix config tests.
      
      * Fix pool tests.
      
      * Address grumbles.
      1cd93e4c
  24. Apr 11, 2018