Commit Graph

2669 Commits

Author SHA1 Message Date
Nicolas Gotchac f20f4c74d2 Fix a deadlock (#9952)
* Update informant:
  - decimal in Mgas/s
  - print every 5s (not randomly between 5s and 10s)

* Fix dead-lock in `blockchain.rs`

* Update locks ordering
2018-11-25 15:53:41 +08:00
Tomasz Drwięga 35a2b87174 Fix empty steps (#9939)
* Don't send empty step twice or empty step then block.

* Perform basic validation of locally sealed blocks.

* Don't include empty step twice.
2018-11-21 21:30:03 +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
Nicolas Gotchac ac974a180d Use block header for building finality (#9914) 2018-11-14 13:05:49 +01:00
André Silva 5f3ae4dee3 ethcore: use Machine::verify_transaction on parent block (#9900)
* ethcore: use Machine::verify_transaction on parent block

also fixes off-by-one activation of transaction permission contract

* ethcore: clarify call to verify_transaction
2018-11-13 14:58:53 +03:00
cheme ca01596a65 Allow to seal work on latest block (#9876)
* Allow to seal work on latest block.

* Test from @todr to check sealing conditions.
2018-11-07 17:59:08 +00:00
Wei Tang 1a642fc624
Clean up existing benchmarks (#9839)
* Add FIXME link for a state mod statement

* Remove unused benches feature in ethcore

* Fix evm benches compile

* Fix ethash benches compile

* Switch to criterion
2018-11-06 21:22:44 +08:00
Jonathan Brown b26f86d6ff Support MIX. (#9767)
* Support MIX.

* Re-arrange mix.json so tests pass.

* Add MIX hardfork.

* Fix MIX chain specification.

* Use original MIX datadir.

* Fix MIX Newark enode.
2018-11-01 11:06:53 +01:00
cheme a511264433 Implement NoProof for json tests and update tests reference (replaces #9744) (#9814)
* 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.
2018-11-01 11:04:32 +01:00
Anton Gavrilov a3bd355b16 Ignore global cache for patched accounts (#9752)
* Ignore global cache for patched accounts

* Rollback patched account flag

* Store root in checkpoint storage
2018-10-31 15:55:11 +00:00
Wei Tang 1c1cd8b164
Move state root verification before gas used (#9841) 2018-10-31 22:44:46 +08:00
cheme 39f25d20a8 Tests modification for windows CI (#9671)
* Fixing and disabling some tests for windows 10 compatibility.

* Few adjustment for windows in tests (eg bigger timeout for keyserver tests)

* Spaces and temporary single thread ci (to be able to spot the error).
2018-10-31 11:50:38 +01:00
Kirill Fomichev f8f8bf0fea RPC: parity_allTransactionHashes (#9745)
* rpc: add parity_allTransactionHashes

* Add light_all_transactionst to helpers

* Remove extra parentheses

* Move light_all_transactions to light_fetch

* Remove LightDispatcher import in light_fetch
2018-10-27 09:38:35 +02:00
Wei Tang 1ff827b2ea Expose config max-round-blocks-to-import (#9439)
* Expose config max-round-blocks-to-import

* Fix test
2018-10-26 13:21:36 +02:00
André Silva e7f1204fa4 aura: finalize blocks (#9692)
* aura: emit ancestry actions for finalizing blocks

* aura: refactor is_epoch_end to get finalized blocks as argument

* ethcore: add is_epoch_end_light method to Engine

The full client now tracks finality by querying the engine on each block import,
and it also persists the finalization state to the DB. For the light client
current it doesn't persist finality information and only keeps track of finality
for epoch signals, by calling `is_epoch_end_light`. This method implements the
previously existing logic of building finality for all the blocks in the current
epoch and then checking the finalized blocks against the transition store.

* ethcore: allow finalizing current block

* aura: fix construction of finality proof

* aura: fix warnings

- missing docs for is_epoch_end_light
- unused method unfinalized_hashes in RollingFinality

* aura: fix clone on copy types
2018-10-25 17:33:41 +02:00
Seun LanLege fe84718b55 drops support for olympic testnet, closes #9800 (#9801) 2018-10-23 23:54:44 +08:00
Yucong Sun ed34d1fee7 Skip seal fields count check when --no-seal-check is used (#9757)
* Skip seal fields count check when --no-seal-check is used

* Remove trailing whitespace
2018-10-16 18:24:47 +08:00
André Silva e9f4f1d13c aura: fix panic on extra_info with unsealed block (#9755)
* aura: fix panic when unsealed block passed to extra_info

* aura: use hex formatting for EmptyStep hashes

* aura: add test for extra_info
2018-10-15 18:05:53 +02:00
Wei Tang 7434026f5f
Make checkpoint_storage_at use plain loop instead of recursion (#9734)
* Make checkpoint_storage_at use plain loop instead of recursion

* Add target: "state" to warn!

* Use iterator::Skip
2018-10-15 22:06:56 +08:00
Wei Tang 5319d33bc6
Use signed 256-bit integer for sstore gas refund substate (#9746)
* Add signed refund

* Use signed 256-bit integer for sstore gas refund substate

* Fix tests

* Remove signed mod and use i128 directly

* Fix evm test case casting

* Fix jsontests ext signature
2018-10-15 17:09:55 +08:00
Yohan Graterol 2511bc20e0 Add Callisto support (#9534)
* Add Callisto Mainnet support

* Add new bootnodes

* Remove merge failure

* EIP-649 removed

* Remove eip649Reward

* Modify difficultyBombDelays

* Callisto reward smart contract

* Remove ethash params

* Fix merge
2018-10-11 11:03:57 +02: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
Niklas Adolfsson 5b54442a48
fix (light/provider) : Make `read_only executions` read-only (#9591)
* `ExecutionsRequest` from light-clients as read-only

This changes so all `ExecutionRequests` from light-clients are executed
as read-only which the `virtual``flag == true ensures.

This boost up the current transaction to always succeed

Note, this only affects `eth_estimateGas` and `eth_call` AFAIK.

* grumbles(revert renaming) : TransactionProof

* grumbles(trace) : remove incorrect trace

* grumbles(state/prove_tx) : explicit `virt`

Remove the boolean flag to determine that a `state::prove_transaction`
whether it should be executed in a virtual context or not.

Because of that also rename the function to
`state::prove_transction_virtual` to make more clear
2018-10-08 21:30:46 +02:00
Marek Kotewicz 6b286a5dee make instantSeal engine backwards compatible, closes #9696 (#9700) 2018-10-04 15:08:20 +02:00
André Silva 726884afcb ethcore: minor optimization of modexp by using LR exponentiation (#9697) 2018-10-04 12:29:53 +01:00
Marek Kotewicz 5a2f3e700b removed redundant clone before each block import (#9683)
* removed redundant clone before each block import

* Fix a trival typo
2018-10-04 01:44:58 +08:00
André Silva 5b87327a43 ethcore: mcip3 block reward contract (#9605)
* Use static call and apparent value transfer for block reward contract code

* ethcore: implement musicoin block reward logic with contract

* ethcore: update musicoin block reward contract bytecode

* ethcore: add comment with source of musicoin block reward contract

* ethcore: remove unused mcip6_byz chain spec
2018-10-03 12:44:43 +01:00
Jim Posen 2fc1679886 Verify block syncing responses against requests (#9670)
* sync: Validate received BlockHeaders packets against stored request.

* sync: Validate received BlockBodies and BlockReceipts.

* sync: Fix broken tests.

* sync: Unit tests for BlockDownloader::import_headers.

* sync: Unit tests for import_{bodies,receipts}.

* tests: Add missing method doc.
2018-10-03 18:35:10 +08:00
Wei Tang 1e9aebbc86
Resumable EVM and heap-allocated callstack (#9360)
* Add new Vm trappable interface

* Exec/Resume interface

* Basic implementation of CallCreateExecutive

* Implement resume_call and resume_create for executive

* Move convertion to call/create result to separate function

* Implement consume that converts resumable to non-resumable

* Use consume for Executive::call/create

* Resumable EVM

* Implement tracing mode without needing subtracers

* Implement vmtracer so it doesn't require extra structs for subtracing

* Use the new tracing mode in executive

* Fix most of the linting errors for cargo build

* Add the concept of stack_depth

* Add back crossbeam

* Fix some test compile

* Fix prefix address test

* Fix evm crate tests

* Fix wasm crate test compile

* Fix wasm runner compile

* Fix jsontests compile

* Fix evmbin compile

* Fix an issue with create nonce and better vm tracing interface

* Fix linting

* Fix evmbin compile

* Fix unconfirmed_substate and static_flag

* Fix an issue in create address logic

* Fix top-level tracing

* Handle builtin tracing

* Fix suicide and reward tracing index stack

* Fix an issue where trap conflicts with tracing

* Fix an issue in parent step vm tracing

* Fix revert tracing

* Fix evmbin tests

* Remove params clone

* Fix TODO proofs

* Fix jsontests compile

* Fix evmbin merge issue

* Fix wasm merge issue

* Fix wasm test

* Fix ethcore merge warnings

* Fix evmbin compile

* Better expect messages and add some trace::skip_one asserts
2018-10-02 22:33:19 +08:00
Afri Schoedon 85a6dc5e8c
Hardfork the testnets (#9562)
* ethcore: propose hardfork block number 4230000 for ropsten

* ethcore: propose hardfork block number 9000000 for kovan

* ethcore: enable kip-4 and kip-6 on kovan

* etcore: bump kovan hardfork to block 9.2M

* ethcore: fix ropsten constantinople block number to 4.2M

* ethcore: disable difficulty_test_ropsten until ethereum/tests are updated upstream
2018-09-30 13:44:17 +01:00
Marek Kotewicz ebaa43fa4c ethcore-io retries failed work steal (#9651)
* ethcore-io uses newer version of crossbeam && retries failed work steal

* ethcore-io non-mio service uses newer crossbeam
2018-09-29 21:25:16 +01:00
cheme a8f6f5b974
ethereum libfuzzer integration small change (#9547)
* Minor changes for ethereum libfuzzer.
2018-09-27 17:17:23 +02:00
Niklas Adolfsson 3216b143c2 ethcore/VerificationQueue don't spawn up extra `worker-threads` when explictly specified not to (#9620)
* 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
2018-09-26 15:11:50 +01: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
André Silva 375ecd4ada ethcore: handle vm exception when estimating gas (#9615) 2018-09-25 12:35:07 +01:00
Marek Kotewicz 8875dccd11 fix bad-block reporting no reason (#9638) 2018-09-25 18:55:24 +08:00
Wei Tang 4c2301fdf6 Use static call and apparent value transfer for block reward contract code (#9603) 2018-09-25 11:39:27 +01:00
cheme 692d5b4e08 Add constantinople conf to EvmTestClient. (#9570)
* Add constantinople conf to EvmTestClient.

* Skip some test to update submodule etheureum/tests submodule to latest.

* Put skipping 'under issue' test behind a feature.

* Change blockReward for const-test to pass ethereum/tests

* Update tests to new constantinple definition (change of reward at block
5).
Switch 'reference' to string, that way we can include issues from others
repo (more flexible)Update tests to new constantinple definition (change
of reward at block 5).
Switch 'reference' to string, that way we can include issues from others
repo (more flexible).

* Fix modexp and bn128_mul gas prices in chain config

* Changes `run_test_path` method to append its directory results (without
that it stop testing at the first file failure).
Add some missing tests.
Add skip for those (block create2 is one hundred percent false but on
hive we can see that geth and aleth got similar issue for this item).

* retab current.json

* Update reference to parity issue for failing tests.
2018-09-25 12:24:40 +02:00
Marek Kotewicz b57607e7d3
simplify ethcore errors by removing BlockImportError (#9593) 2018-09-24 11:28:54 +01: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
Marek Kotewicz ef4a61c769
new ethabi (#9511)
* new ethabi migration in progress

* parity migrated to new ethabi

* migrated secred-store to new ethabi

* bump ethabi to 6.0

* fixed review suggestions
2018-09-13 11:04:39 +02:00
Wei Tang 018e2403b1 state: test when contract creation fails, old storage values should re-appear (#9532)
Because more tests won't hurt. :)

Add a test case for https://github.com/ethereum/py-evm/pull/1224#issuecomment-418775512 where if contract creation fails, old storage values (if ever existed) should re-appear.
2018-09-12 11:42:09 +01:00
Wei Tang 530aac0682
Enable all Constantinople hard fork changes in constantinople_test.json (#9505)
* Enable all Constantinople hard fork changes in constantinople_test.json

* Address grumbles

* Remove EIP-210 activation

* 8m -> 5m

* Temporarily add back eip210 transition so we can get test passed

* Add eip210_test and remove eip210 transition from const_test
2018-09-12 02:08:23 +08:00
Wei Tang 631df0fe56 Fix checkpointing when creating contract failed (#9514) 2018-09-11 10:28:31 +02:00
Tomasz Drwięga 6e5a1c00dc Update state tests execution model (#9440)
* Update & fix JSON state tests.

* Update tests to be able to run ethtest at
021fe3d410773024cd5f0387e62db6e6ec800f32.

- Touch user in state
- Adjust transaction tests to new json format

* Switch to same commit for submodule ethereum/test as geth (next includes constantinople changes).
Added test `json_tests::trie::generic::TrieTests_trieanyorder` and a few
difficulty tests.

* Remove trietestnextprev as it would require to parse differently and
implement it.

* Support new (shitty) format of transaction tests.

* Ignore junk in ethereum/tests repo.

* Ignore incorrect test.

* Update to a later commit

* Move block number to a constant.

* Fix ZK2 test - touched account should also be cleared.

* Fix conflict resolution
2018-09-10 22:38:30 +02:00
Nicolas Gotchac baf5be09dc Fix Snapshot restoration failure on Windows (#9491)
* Close Blooms DB files before DB restoration

* PR Grumbles I

* PR Grumble

* Grumble
2018-09-10 17:21:57 +02:00
Nicolas Gotchac f3aed42dd6 Don't error when Snapshot is aborted (#9492)
* Don't error when Snapshot is aborted

* PR Grumble

* PR grumble
2018-09-10 21:26:52 +08:00
Wei Tang e1f333021f Generalized blockReward and difficultyBombDelays config (#9480)
* Implement multi blockReward

* Implement difficultyBombDelays

* Fix json crate compile

* json keys can only be string
2018-09-09 00:38:07 +02: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 915c366056
EIP 1283: Net gas metering for SSTORE without dirty maps (#9319)
* Implement last_checkpoint_storage_at

* Add reverted_storage_at for externalities

* sstore_clears_count -> sstore_clears_refund

* Implement eip1283 for evm

* Add eip1283Transition params

* evm: fix tests

* jsontests: fix test

* Return checkpoint index when creating

* Comply with spec Version II

* Fix docs

* Fix jsontests feature compile

* Address grumbles

* Fix no-checkpoint-entry case

* Remove unnecessary expect

* Add test for State::checkpoint_storage_at

* Add executive level test for eip1283

* Hard-code transaction_checkpoint_index to 0

* Fix jsontests

* Add tests for checkpoint discard/revert

* Require checkpoint to be empty for kill_account and commit

* Get code coverage

* Use saturating_add/saturating_sub

* Fix issues in insert_cache

* Clear the state again

* Fix original_storage_at

* Early return for empty RLP trie storage

* Update comments

* Fix borrow_mut issue

* Simplify checkpoint_storage_at if branches

* Better commenting for gas handling code

* Address naming grumbles

* More tests

* Fix an issue in overwrite_with

* Add another test

* Fix comment

* Remove unnecessary bracket

* Move orig to inner if

* Remove test coverage for this PR

* Add tests for executive original value

* Add warn! for an unreachable cause
2018-09-07 18:51:08 +08:00