Commit Graph

143 Commits

Author SHA1 Message Date
adria0 1700873f48
Fix warnings: dyn 2020-08-07 20:47:12 +03:00
Artem Vorotnikov 610d9baba4
Reformat the source code 2020-08-07 20:46:52 +03:00
Talha Cross f3cdd7bf21 v2.5.10 stable (#11239)
* ropsten #6631425 foundation #8798209 (#11201)
* [stable] builtin, istanbul and mordor testnet backports (#11234)
  * ethcore-builtin (#10850)
  * [builtin]: support `multiple prices and activations` in chain spec (#11039)
  * [chain specs]: activate `Istanbul` on mainnet (#11228)
  * ethcore/res: add mordor testnet configuration (#11200)
* Update list of bootnodes for xDai chain (#11236)
* ethcore: remove `test-helper feat` from build (#11047)
* Secret store: fix Instant::now() related race in net_keep_alive (#11155) (#11159)
* [stable]: backport #10691 and #10683 (#11143)
  * Fix compiler warning (that will become an error) (#10683)
  * Refactor Clique stepping (#10691)
* Add Constantinople eips to the dev (instant_seal) config (#10809)
* Add cargo-remote dir to .gitignore (?)
* Insert explicit warning into the panic hook (#11225)
* Fix docker centos build (#11226)
* Update MIX bootnodes. (#11203)
* Use provided usd-per-eth value if an endpoint is specified (#11209)
* Add new line after writing block to hex file. (#10984)
* Type annotation for next_key() matching of json filter options (#11192) (but no `FilterOption` in 2.5 so…)
* Upgrade jsonrpc to latest (#11206)
* [CI] check evmbin build (#11096)
* Correct EIP-712 encoding (#11092)
* [client]: Fix for incorrectly dropped consensus messages (#11086)
* Fix block detail updating (#11015)
* Switching sccache from local to Redis (#10971)
* Made ecrecover implementation trait public (#11188)
* [dependencies]: jsonrpc `14.0.1` (#11183)
* [receipt]: add `sender` & `receiver` to `RichReceipts` (#11179)
* [ethcore/builtin]: do not panic in blake2pricer on short input (#11180)
* util Host: fix a double Read Lock bug in fn Host::session_readable() (#11175)
* ethcore client: fix a double Read Lock bug in fn Client::logs() (#11172)
* Change how RPCs eth_call and eth_estimateGas handle "Pending" (#11127)
* Cleanup stratum a bit (#11161)
* Upgrade to jsonrpc v14 (#11151)
* SecretStore: expose restore_key_public in HTTP API (#10241)
2019-11-11 21:57:38 +01:00
Axel Chalon 7014642815 Implement parity_versionInfo & parity_setChain on LC; fix parity_setChain (#10312)
* Light client: implement parity_versionInfo RPC

* Light client: implement set_exit_handler & parity_setChain RPC

* parity_setChain RPC: return an error if failed (instead of `true`)

* Implement eth_subscribe('syncing') RPC for full node & light node

* Fix indentation

* Revert commit: Implement eth_subscribe('syncing')

* Revert change to Cr callback function
2019-03-04 20:24:53 +01:00
Hernando Castano 35bbf11ba5 Extract CallContract and RegistryInfo traits into their own crate (#10178)
* Create call-contract crate

* Add license

* First attempt at using extracted CallContract trait

* Remove unneeded `extern crate` calls

* Move RegistryInfo trait into call-contract crate

* Move service-transaction-checker from ethcore to ethcore-miner

* Update Cargo.lock file

* Re-export call_contract

* Merge CallContract and RegistryInfo imports

* Remove commented code

* Add documentation to call_contract crate

* Add TODO for removal of re-exports

* Update call-contract crate description

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

* Rename call-contract crate to ethcore-call-contract
2019-01-16 19:52:21 +01:00
Seun LanLege cdba22a2cb Adds cli interface to allow reseting chain to a particular block (#9782)
* added BlockChainReset trait, client impl, and cli interface

* show block hashes to be deleted and new best block, update best block in db, better cli interface

* delete BlockNumber from COL_EXTRA

* add TODO comment

* add BlockReciepts to imports

* refactor block_headers_from_best_block, better cli documentation

* exit gracefully if reset arg isn't supplied

* fix cli usage macro

* removed stray int literals

* use Vec::with_capacity

Co-Authored-By: seunlanlege <seunlanlege@gmail.com>

* cast n to usize

* correct imports

* make db reset arg required
2019-01-16 16:37:26 +01: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 0b5bbf6048 Improve block and transaction propagation (#9954)
* Refactor sync to add priority tasks.

* Send priority tasks notifications.

* Propagate blocks, optimize transactions.

* Implement transaction propagation. Use sync_channel.

* Tone down info.

* Prevent deadlock by not waiting forever for sync lock.

* Fix lock order.

* Don't use sync_channel to prevent deadlocks.

* Fix tests.
2018-11-28 11:30:05 +01: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
Tomasz Drwięga cc963d42a0 RPC: parity_getBlockReceipts (#9527)
* Block receipts RPC.

* Use lazy evaluation of block receipts (ecrecover).

* Optimize transaction_receipt to prevent performance regression.

* Fix RPC grumbles.

* Add block & transaction receipt tests.

* Fix conversion to block id.
2018-09-25 18:06:14 +01:00
Marek Kotewicz b57607e7d3
simplify ethcore errors by removing BlockImportError (#9593) 2018-09-24 11:28:54 +01:00
Tomasz Drwięga 61bd47ccc1 Bad blocks RPC + reporting (#9433)
* Bad blocks RPC.

* Return bad blocks via RPC.

* Fix test.

* More verbose bad block message.

* Expose via CLI.

* Remove stray whitespace.

* Remove stray newline.

* Fix tests.
2018-09-08 04:04:28 +02:00
Wei Tang caca3a8048
Add EIP-1014 transition config flag (#9268)
* Add EIP-1014 transition config flag

* Remove EIP-86 configs

* Change CREATE2 opcode index to 0xf5

* Move salt to the last item in the stack

* Change sendersaltandaddress scheme to comply with current EIP-1014

* Fix json configs

* Fix create2 test

* Fix deprecated comments
2018-08-31 23:43:51 +08:00
Wei Tang a6df452841
Implement EIP234 block_hash for eth_getLogs (#9256)
* Implement EIP234

* Make filter conversion returns error if both blockHash and from/toBlock is found

This also changes PollFilter to store the EthFilter type, instead of the jsonrpc one, saving repeated conversion.

* Return error if block filtering target is not found in eth_getLogs

Use the old behavior (unwrap_or_default) for anywhere else.

* fix test: secret_store

* Fix weird indentation

* Make client log filter return error in case a block cannot be found

* Return blockId error in rpc

* test_client: allow return error on logs

* Add a mocked test for eth_getLogs error

* fix: should return error if from_block/to_block greater than best block number

* Add notes on pending

* Add comment for UNSUPPORTED_REQUEST

* Address grumbles

* Return err if from > to
2018-08-13 15:47:10 +08:00
Tomasz Drwięga 90d7823acb Propagate transactions for next 4 blocks. (#9265)
Closes #9255 

This PR also removes the limit of max 64 transactions per packet, currently we only attempt to prevent the packet size to go over 8MB. This will only be the case for super-large transactions or high-block-gas-limit chains.

Patching this is important only for chains that have blocks that can fit more than 4k transactions (over 86M block gas limit)

For mainnet, we should actually see a tiny bit faster propagation since instead of computing 4k pending set, we only need `4 * 8M / 21k = 1523` transactions.

Running some tests on `dekompile` node right now, to check how it performs in the wild.
2018-08-02 11:58:02 +01:00
Marek Kotewicz b4ae1b6528 decode block rlp less often (#9252)
in total:
- removed 4 redundant rlp deserializations
- avoid 1 redundant block data copy
2018-08-02 10:20:46 +01:00
Wei Tang 5059619947 Unify engine error to reject blocks (#9085)
* Reject if Engine::on_close_block returns error

* Unify open block behaviors

* Fix tests in ethcore

* Fix Aura tests

* Fix RPC test

* Print a warning if open block failed

* Print the actual error when closing the block

* Update comments for prepare_pending_block

* Add BlockPreparationStatus to distingish three different state after prepare_pending_block
2018-07-16 13:53:55 +02:00
shamardy 526c61e2c0 Transactions hashes missing in trace_replayBlockTransactions method result #8725 (#8883)
* Squashed commit of the following:

commit 1f85076fd584365f1acbbafef5c8bdee722b479b
Author: shamardy <shamardy@yahoo.com>
Date:   Sat Jun 30 03:40:12 2018 +0200

    update

commit 63363cca7354873a8abe3b631b8b7dbd9da6ce1e
Author: shamardy <shamardy@yahoo.com>
Date:   Sat Jun 30 03:36:25 2018 +0200

    Update

commit e05caddc170a4cf0e476c23d443f07184dcb4fb1
Author: shamardy <shamardy@yahoo.com>
Date:   Fri Jun 29 10:04:34 2018 +0200

    Test

commit b0be065eadd0f2dd70f6613c50cbf3eb16d693ec
Author: shamardy <shamardy@yahoo.com>
Date:   Fri Jun 29 09:19:57 2018 +0200

    test_client edit

commit 949205ccdbac75f730639e5f0d8e1bdd9436de1d
Author: shamardy <shamardy@yahoo.com>
Date:   Fri Jun 29 05:14:53 2018 +0200

    Edit Test

commit 7cd44ee379a1e847f3e7d225444e72775bdbd4b5
Author: shamardy <shamardy@yahoo.com>
Date:   Fri Jun 29 04:25:22 2018 +0200

    Updates

commit e90de71e698d29475e8ba5696664b7d7bb335f9c
Author: shamardy <shamardy@yahoo.com>
Date:   Wed Jun 27 13:53:15 2018 +0200

    Test

commit 12a76381561b66ecf6ea636d7eebe43d2dcb7731
Author: shamardy <shamardy@yahoo.com>
Date:   Wed Jun 27 11:43:39 2018 +0200

    Edited Tests

commit 6c21e6de2da24e7b9f33ac8b82abb0b39488bd60
Merge: 87c4c74b8 9550cf766
Author: shamardy <shamardy@yahoo.com>
Date:   Wed Jun 27 10:31:21 2018 +0200

    Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725

commit 87c4c74b8f769c8e4b55ba78b5aa1d6716413f6d
Author: shamardy <shamardy@yahoo.com>
Date:   Wed Jun 27 10:31:13 2018 +0200

    Avoided Changing non-RPC Types

commit 9550cf76610953c8492cc9473e4b9f876e770b70
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:29:03 2018 +0200

    Update traces.rs

commit 3e0b0ef29685b62f0917b80a48054b3379d59a50
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:27:44 2018 +0200

    Update trace.rs

commit 5078d67a2da7268db2a1064540a3c887e1f1a3cd
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:26:08 2018 +0200

    Update traces.rs

commit 28f5ba1b035c6919ac11089cf1bdd703c75f0dbd
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:24:04 2018 +0200

    Update parity.rs

commit 3b86b98ab5860efa61a7cc6a2b20e6c5c0f859cb
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:23:33 2018 +0200

    Update eth.rs

commit bcad5a40f14a3c5d2d901ae1a9bed87949ab9c66
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:21:43 2018 +0200

    Update call_analytics.rs

commit e9029e0b8158387b606132b264652d285483870f
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:20:56 2018 +0200

    Update transaction.rs

commit 0dacc81779bc62713e3f8e405229dfd7f89f33e8
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:20:01 2018 +0200

    Update executive.rs

commit 3921d4ec77f49460d45603111b98cc07d3c235a0
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:18:39 2018 +0200

    Update executed.rs

commit 8416df654ebf6f68ad04c8a4a89a29ce704f9ca1
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:17:34 2018 +0200

    Update client.rs

commit cf0b4dddbc93395bc5ce1f17c3c07a294bf8dd49
Merge: 23bfa78c2 36e05e5f3
Author: shamardy <shamardy@yahoo.com>
Date:   Sun Jun 24 04:54:04 2018 +0200

    Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725

commit 23bfa78c2662d697018e7061ab9ad0b864fde0ef
Author: shamardy <shamardy@yahoo.com>
Date:   Sun Jun 24 04:53:50 2018 +0200

    Undo

commit 36e05e5f30c35bd6b57af50fd337f2006df51b86
Merge: 2f6e1ef64 0afc74825
Author: shamardy <shamardy@yahoo.com>
Date:   Sun Jun 24 04:44:33 2018 +0200

    Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725

commit 2f6e1ef64763a79ad2ed8baa2aed5a8f3136bafc
Author: shamardy <shamardy@yahoo.com>
Date:   Sun Jun 24 04:44:22 2018 +0200

    Another rpc test output with ("transactionHash":null)

commit 0afc74825828f724d68f3e444655b872a6c51ce0
Author: shamardy <shamardy@yahoo.com>
Date:   Thu Jun 14 07:18:45 2018 +0200

    Another rpc test output with ("transactionHash":null)

commit 138fbac9f02841adfeaaf061c5dd9e647f725e12
Author: shamardy <shamardy@yahoo.com>
Date:   Thu Jun 14 06:30:41 2018 +0200

    Edited some rpc tests output with ("transactionHash":null)

commit 8c129a63109c00f88ce36bad10699dc2f3237d95
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:48:39 2018 +0200

    Update traces.rs

commit 52c17f6191740637c1d1589a420996dccefe16bb
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:47:29 2018 +0200

    Update parity.rs

commit d39303aa8c2097ba9e2ed94c7ad2166bf1608d3f
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:46:25 2018 +0200

    Update eth.rs

commit 49be84bf529c33dc47c8260435fd0d26e137c66d
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:40:56 2018 +0200

    Update trace.rs

commit 4fc801377fb01ff11867f66b547a307c162d7a56
Merge: d34ba2351 544210439
Author: shamardy <shamardy@yahoo.com>
Date:   Thu Jun 14 05:12:21 2018 +0200

    Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725

commit 54421043959e14a76f309fe87d3c7513a95999f8
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:04:51 2018 +0200

    Update trace.rs

commit 2b2524a31119d741df4076e9d1b3ce8f0b17b479
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:01:47 2018 +0200

    Update state_diff.rs

commit 2bf9982b8ce29ef69f116142eaeacf3049f7db49
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:00:50 2018 +0200

    Update transaction.rs

commit da696ea192c0f89cceb38834f6efee280129048c
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:00:13 2018 +0200

    Update mod.rs

commit cfc194ca0f44bfabec01a52897a322ea5a91930b
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 04:59:18 2018 +0200

    Update pod_state.rs

commit 3b3156853535a666778e0ad0e902de79fb138f1d
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 04:57:37 2018 +0200

    Update client.rs

commit d34ba235132c654da6c2ed6ff0dcf96fda0c45ee
Author: shamardy <shamardy@yahoo.com>
Date:   Thu Jun 14 04:53:50 2018 +0200

    RPC Only

commit 8b5c4f19727549ee6f180a6effc228b2693509e9
Merge: 744491632 291b4a01b
Author: shamardy <shamardy@yahoo.com>
Date:   Thu Jun 14 02:55:14 2018 +0200

    Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725

commit 74449163222e0ab75c704ac0ad424870e3c321d9
Author: shamardy <shamardy@yahoo.com>
Date:   Thu Jun 14 02:27:13 2018 +0200

    Issue#8725

    Transactions hashes missing in trace_replayBlockTransactions method result #8725

commit 291b4a01be6771acff8f5829c5406fa193665dbe
Author: shamardy <shamardy@yahoo.com>
Date:   Thu Jun 14 01:18:18 2018 +0200

    Edited to make changes to RPC types only

    To make a transactions hash trace with "trace_replayBlockTransactions" add "transactionHash" to parameters

commit 9d082bece73beb8ebddfda51fa5ec279f30b7bea
Author: shamardy <shamardy@yahoo.com>
Date:   Wed Jun 13 09:15:56 2018 +0200

    Issue#8725

    Transactions hashes missing in trace_replayBlockTransactions method result #8725

* update

* Removed unwrap_or

* Update

* test_client update
2018-07-10 15:38:13 +01:00
Tomasz Drwięga 4938d5dde5 Limit the number of transactions in pending set (#8777)
* Unordered iterator.

* Use unordered and limited set if full not required.

* Split timeout work into smaller timers.

* Avoid collecting all pending transactions when mining

* Remove println.

* Use priority ordering in eth-filter.

* Fix ethcore-miner tests and tx propagation.

* Review grumbles addressed.

* Add test for unordered not populating the cache.

* Fix ethcore tests.

* Fix light tests.

* Fix ethcore-sync tests.

* Fix RPC tests.
2018-06-12 08:22:54 +02:00
Marek Kotewicz 107f0fa4c6
Removed obsolete IpcMode enum (#8819) 2018-06-06 14:14:45 +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
Tomasz Drwięga 24838bbcd3 Don't block sync when importing old blocks (#8530)
* 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.
2018-05-09 08:49:34 +02:00
Tomasz Drwięga 1cd93e4ceb New Transaction Queue implementation (#8074)
* 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.
2018-04-13 17:34:27 +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
Dmitry Kashitsyn 9d7d6f7108 `Client` refactoring (#7038)
* Improves `BestBlock` comment

* Improves `TraceDB` comment

* Improves `journaldb::Algorithm` comment.

Probably the whole enum should be renamed to `Strategy` or something alike.

* Comments some of the `Client`'s fields

* Deglobs client imports

* Fixes comments

* Extracts `import_lock` to `Importer` struct

* Extracts `verifier` to `Importer` struct

* Extracts `block_queue` to `Importer` struct

* Extracts `miner` to `Importer` struct

* Extracts `ancient_verifier` to `Importer` struct

* Extracts `rng` to `Importer` struct

* Extracts `import_old_block` to `Importer` struct

* Adds `Nonce` trait

* Adds `Balance` trait

* Adds `ChainInfo` trait

* Fixes imports for tests using `chain_info` method

* Adds `BlockInfo` trait

* Adds more `ChainInfo` imports

* Adds `BlockInfo` imports

* Adds `ReopenBlock` trait

* Adds `PrepareOpenBlock` trait

* Fixes import in tests

* Adds `CallContract` trait

* Fixes imports in tests using `call_contract` method

* Adds `TransactionInfo` trait

* Adds `RegistryInfo` trait

* Fixes imports in tests using `registry_address` method

* Adds `ScheduleInfo` trait

* Adds `ImportSealedBlock` trait

* Fixes imports in test using `import_sealed_block` method

* Adds `BroadcastProposalBlock` trait

* Migrates `Miner` to static dispatch

* Fixes tests

* Moves `calculate_enacted_retracted` to `Importer`

* Moves import-related methods to `Importer`

* Removes redundant `import_old_block` wrapper

* Extracts `import_block*` into separate trait

* Fixes tests

* Handles `Pending` in `LightFetch`

* Handles `Pending` in filters

* Handles `Pending` in `ParityClient`

* Handles `Pending` in `EthClient`

* Removes `BlockId::Pending`, partly refactors dependent code

* Adds `StateInfo` trait

* Exports `StateOrBlock` and `BlockChain` types from `client` module

* Refactors `balance` RPC using generic API

* Refactors `storage_at` RPC using generic API

* Makes `MinerService::pending_state`'s return type dynamic

* Adds `StateOrBlock` and `BlockChain` types

* Adds impl of `client::BlockChain` for `Client`

* Exports `StateInfo` trait from `client` module

* Missing `self` use

To be fixed up to "Adds impl of `client::BlockChain` for `Client`"

* Adds `number_to_id` and refactors dependent RPC methods

* Refactors `code_at` using generic API

* Adds `StateClient` trait

* Refactors RPC to use `StateClient` trait

* Reverts `client::BlockChain` trait stuff, refactors methods to accept `StateOrBlock`

* Refactors TestClient

* Adds helper function `block_number_to_id`

* Uses `block_number_to_id` instead of local function

* Handles `Pending` in `list_accounts` and `list_storage_keys`

* Attempt to use associated types for state instead of trait objects

* Simplifies `state_at_beginning`

* Extracts `call` and `call_many` into separate trait

* Refactors `build_last_hashes` to accept reference

* Exports `Call` type from the module

* Refactors `call` and `call_many` to accept state and header

* Exports `state_at` in `StateClient`

* Exports `pending_block_header` from `MinerService`

* Refactors RPC `call` method using new API

* Adds missing parentheses

* Refactors `parity::call` to use new call API

* Update .gitlab-ci.yml

fix gitlab lint

* Fixes error handling

* Refactors `traces::call` and `call_many` to use new call API

* Refactors `call_contract`

* Refactors `block_header`

* Refactors internal RPC method `block`

* Moves `estimate_gas` to `Call` trait, refactors parameters

* Refactors `estimate_gas` in RPC

* Refactors `uncle`

* Refactors RPC `transaction`

* Covers missing branches

* Makes it all compile, fixes compiler grumbles

* Adds casts in `blockchain` module

* Fixes `PendingBlock` tests, work on `MinerService`

* Adds test stubs for StateClient and EngineInfo

* Makes `state_db` public

* Adds missing impls for `TestBlockChainClient`

* Adds trait documentation

* Adds missing docs to the `state_db` module

* Fixes trivial compilation errors

* Moves `code_hash` method to a `BlockInfo` trait

* Refactors `Verifier` to be generic over client

* Refactors `TransactionFilter` to be generic over client

* Refactors `Miner` and `Client` to reflect changes in verifier and txfilter API

* Moves `ServiceTransactionChecker` back to `ethcore`

* Fixes trait bounds in `Miner` API

* Fixes `Client`

* Fixes lifetime bound in `FullFamilyParams`

* Adds comments to `FullFamilyParams`

* Fixes imports in `ethcore`

* Fixes BlockNumber handling in `code_at` and `replay_block_transactions`

* fix compile issues

* First step to redundant trait merge

* Fixes compilation error in RPC tests

* Adds mock `State` as a stub for `TestClient`

* Handles `StateOrBlock::State` in `TestBlockChainClient::balance`

* Fixes `transaction_count` RPC

* Fixes `transaction_count`

* Moves `service_transaction.json` to the `contracts` subfolder

* Fixes compilation errors in tests

* Refactors client to use `AccountData`

* Refactors client to use `BlockChain`

* Refactors miner to use aggregate traits

* Adds `SealedBlockImporter` trait

* Refactors miner to use `SealedBlockImporter` trait

* Removes unused imports

* Simplifies `RegistryInfo::registry_address`

* Fixes indentation

* Removes commented out trait bound
2018-03-03 18:42:13 +01:00
Nikolay Volf 684322cd6f Kovan WASM fork code (#7849)
* kovan fork code

* introduce ethcore level vm_factory and let it fail

* fix json tests

* wasmcosts as option

* review changes

* wasm costs in parser

* fix evm tests

* review fixes

* fix test

* remove redundant json field
2018-02-19 12:27:42 +01:00
André Silva aab63c339d Aura: Broadcast empty step messages instead of creating empty blocks (#7605)
* aura: broadcast empty step message instead of sealing empty block

* aura: add empty_step messages to seal

* aura: include parent_hash in empty step message

* aura: verify received empty step messages

* aura: verify empty step messages in block

* aura: fix dead lock on empty_steps

* aura: fix EmptyStep Encodable

* aura: take number of empty steps into account in chain score

* aura: use empty step signers for finality

* aura: add empty "empty step" messages to seal when reading from spec

* aura: fix EmptyStep rlp encoding

* aura: use Vec<u8> instead of Bytes

* aura: fix block empty step verification

* Update .gitlab-ci.yml

fix lint

* aura: fix accumulation of empty step signatures for finality

* aura: include empty steps in seal signature

* aura: configurable max number of empty steps

* engine: pass block header to seal_fields method

This is necessary to make the number of seal fields dynamic,
e.g. activating a transition on a certain block number that changes
the seal.

* aura: add transition to enable empty step messages

* aura: clear old empty step messages on verify_block_external

* aura: ignore empty step messages from the future

* aura: report skipped primaries when empty steps are not enabled

* aura: fix tests

* aura: report misbehavior

* aura: add tests for rolling finality with multiple signatures

* engine: fix validator set test

In this test the block validation wasn't failing because the block was in the
future (expected failure) but was instead failing because the author of the
block isn't the expected authority. Since we added reporting of blocks produced
by the wrong authority this test started failing.

* aura: reward all the authors of empty step messages

* aura: fix reward attribution for new blocks

* aura: add tests for empty steps broadcasting and inclusion in blocks

* aura: reduce size of empty step messages in seal

* aura: add test for empty step inclusion in blocks

* aura: add test for rewarding of empty steps

* aura: add test for empty steps validation

* aura: fix rlp encoding of sealed empty step

* aura: fix grumbles
2018-02-15 01:39:29 +01:00
Svyatoslav Nikolsky 1ca1fba8cf read registry_address from given block (#7866) 2018-02-12 18:02:48 +01:00
Tomasz Drwięga f044b61f42 Extract some parts of miner from ethcore. (#7353)
* Move miner away from ethcore.

* Fix ethcore to use miner/transaction.

* Fix tests and warnings.

* fixed incorrect merge of the test in the documentation
2018-01-11 17:49:10 +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
tzapu df5d27d516 added a new RPC call trace_replayBlockTransactions (#7366)
* intial add trace_replayBlockTransactions

* cleanup timing calls
add execution proof

* WIP implementing changes

* fix for trace_replayBlockTransactions rpc call

* cleanup comments

* cleanup, proof,
can't workout lifetime issues yet

* Fix lifetimes issue.

* naive rpc test

* updated docs
2018-01-10 11:34:34 +01:00
Vlad Lupashevskyi 24378f3c44 Added checking tx-type using transactions permission contract for miners 2017-12-21 22:42:36 +02:00
debris fa019bd03e remove ipc codegen from ethcore 2017-10-16 17:50:25 +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
Nicolas Gotchac f1a050366f Fix slow balances (#6471)
* Update token updates

* Update token info fetching

* Update logger

* Minor fixes to updates and notifications for balances

* Use Pubsub

* Fix timeout.

* Use pubsub for status.

* Fix signer subscription.

* Process tokens in chunks.

* Fix tokens loaded by chunks

* Linting

* Dispatch tokens asap

* Fix chunks processing.

* Better filter options

* Parallel log fetching.

* Fix signer polling.

* Fix initial block query.

* Token balances updates : the right(er) way

* Better tokens info fetching

* Fixes in token data fetching

* Only fetch what's needed (tokens)

* Fix linting issues

* Revert "Transaction permissioning (#6441)"

This reverts commit eed0e8b03a.

* Revert "Revert "Transaction permissioning (#6441)""

This reverts commit 8f96415e58dde652e5828706eb2639d43416f448.

* Update wasm-tests.

* Fixing balances fetching

* Fix requests tracking in UI

* Fix request watching

* Update the Logger

* PR Grumbles Fixes

* PR Grumbles fixes

* Linting...
2017-09-10 18:03:35 +02:00
Robert Habermeier 7d1c7a0474 allow optional casting of engine client to full client 2017-09-05 17:55:14 +02:00
Robert Habermeier ad39446e87 Revert "fixed master (#6465)"
This reverts commit 899538ae25.
2017-09-05 17:54:05 +02:00
Marek Kotewicz 899538ae25 fixed master (#6465)
* fixed master

* Revert "Merge pull request #6370 from paritytech/light-poa"

This reverts commit 3c60f99def, reversing
changes made to b731ccea18.
2017-09-05 14:53:09 +02:00
Marek Kotewicz c49beccadc Merge pull request #6459 from paritytech/fo-6418-dont-export-bigint
Refactor: Don't reexport bigint from util
2017-09-05 12:38:03 +02:00
Arkadiy Paronyan eed0e8b03a Transaction permissioning (#6441) 2017-09-05 10:39:50 +01:00
Fredrik Harrysson dccdedc001 Merge branch 'master' into fo-6418-dont-export-bigint 2017-09-05 10:48:54 +02:00
Fredrik 308f36a532 Don't reexport bigint from util 2017-09-04 16:36:49 +02:00
Robert Habermeier 871a9c063e Merge branch 'master' into light-poa 2017-08-23 15:49:02 +02:00
Robert Habermeier 2ff3dff6ea serve epoch signals over network and check them 2017-08-23 15:37:35 +02:00
Robert Habermeier b4d3f78d67 Merge pull request #6345 from paritytech/networkid
Rename network_id to chain_id where applicable.
2017-08-22 17:01:23 +08:00
Robert Habermeier 9ae2ed39ec only use engineclient trait for engines, separated from client trait 2017-08-22 16:00:44 +08:00
Tomasz Drwięga 73644adf69
Rename network_id to chain_id where applicable. 2017-08-21 14:23:10 +02:00
debris 4cb610d9ae Itertools are no longer reexported from util, optimized triedb iter 2017-08-17 16:05:26 +02:00