Commit Graph

1854 Commits

Author SHA1 Message Date
Vladimir Komendantskiy 73354d8d93 Set the block gas limit to the value returned by a contract call (#10928)
* Block gas limit contract

Lower gas limit if TxPermission.limitBlockGas.

Call blockGasLimit before every block.

Make the block gas limit contract a separate config option.

Add `info` level logging of block gas limit switching

block-gas-limit subcrate and responses to review comments

simplified call_contract_before

moved block_gas_limit_contract_transitions to AuRa params

removed call_contract_before

Update and fix test_verify_block.

Remove some unused imports and functions.

* Move gas limit override check to verify_block_basic.

Co-authored-by: Andreas Fackler <afck@users.noreply.github.com>
2020-01-13 11:27:03 +01:00
Andronik Ordian e95bbe36cb fix cargo audit (#11378)
* Cargo.lock: cargo update -p http

* fetch: cargo upgrade hyper-rustls@0.18 --all
2020-01-10 17:43:49 +01:00
Demi Obenour b8d9b6f826
Rip out the C and Java bindings (#11346)
* Remove the C and Java bindings

* update Cargo.lock

* [ci]: don't build removed `parity-clib`

* [ci]: fix grumbles

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2020-01-07 15:53:02 +00:00
Anton Gavrilov 424b38a8d7
Encapsulate access to the client for secret store (#11232)
* Move all client usages into trusted_client

* Move confirmed hash method to trusted client

* Tree route and logs encapsuluted

* Remove not used method for keys sharing

* NodeKeyPair renamed and moved to trusted client

* Use public key error in trusted client

* Move contract address definition into trusted client

* Block id and number types from ethcore wrapped

* Trusted client renamed to more general Blockchain

* Trusted client implementation moved to parity code

* Move node key pair under secret store feature as well

* Registar crate removed from deps

* Accounts feature removed from secret store

* Fix after merge

* Blockchain renamed to SecretStoreChain

* Module documentations added
2020-01-07 14:37:02 +01:00
David b9f9d11929
Update to latest `kvdb-*`: no default column, DBValue is Vec (#11312)
* Only use kvdb "column families"

This PR contains the changes necessary to use the `kvdb-*` crates from https://github.com/paritytech/parity-common/pull/278 (so a synchronized merge is required) which drops support for the old-style rocksdb "default" column to get a smaller and less complex API.

As it stands this PR is working correctly except for secret-store; we need to migrate it to use a new column family.

* Fix secretstore build

* Fix secretstore build: include ethkey when building with the "accounts" feature

* typos

* Restore state test commit

* Override all of parity-common from git

* Be precise about version requirement to migrate secretstore code

* Update ethcore/db/src/db.rs

Co-Authored-By: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Address review grumbles

* Review grumbles

* Cleanup

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2019-12-20 12:27:38 +01:00
Cho e14d68e559 Add Nat PMP method to P2P module (#11210)
* Add Nat PMP method to P2P module

* Add test fn

* Use closure

* print richer error messages.

* reformat long code line

* remove closures
2019-12-19 09:01:39 +01:00
Andreas Fackler 2b1d148ceb Add randomness contract support to AuthorityRound. (#10946)
* Add randomness contract support to Authority Round.

Changes have been cherry-picked from poanetwork's aura-pos branch.
Most of the work has been done by @mbr.

* Address review comments for randomness contract.

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

* Rename revealSecret to revealNumber

* Update Randomness contract bytecode

* Use H256, rename secret to random number.

* Use get_commit_and_cipher

* Clean up Miner::prepare_block.

* Remove is_reveal_phase call.

* Add more comments, require randomness contract map.

* Simplify run_randomness_phase

* Address review comments.

* Remove Client::transact_contract.
2019-12-17 11:34:14 +01:00
Seun LanLege 64295fde62 Adds support for ipc socket permissions (#11273)
* adds support for ipc socket permissions

* bumped jsonrpc to 14.0.5

* change chmod default to 660, use casting

* set 660 default for --ipc-chmod

Co-Authored-By: Andronik Ordian <write@reusable.software>

* Update parity/cli/mod.rs

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

* represent octal value as string

* return error for invalid octal values

* fix tests

* check if supplied octal range is within 0 to 7777

* Apply suggestions from code review

Co-Authored-By: Andronik Ordian <write@reusable.software>

* temporary fix

* bump jsonrpc-ipc-server

* fix: update `Cargo.lock`
2019-12-06 16:39:56 +01:00
David f6c3d4c695 Use upstream rocksdb (#11248)
* Use upstream rocksdb

…by way of https://github.com/paritytech/parity-common/pull/257 by @ordian.

* Hint at how `parity db reset` works in the error message

* migration-rocksdb: fix build

* Cargo.toml: use git dependency instead of path

* update to latest kvdb-rocksdb

* fix tests

* saner default for light client

* rename open_db to open_db_light

* update to latest kvdb-rocksdb

* moar update to latest kvdb-rocksdb

* even moar update to latest kvdb-rocksdb

* use kvdb-rocksdb from crates.io

* Update parity/db/rocksdb/helpers.rs

* add docs to memory_budget division
2019-12-03 16:59:11 +01:00
David 4c3be46f93 Add benchmarks and tests for RlpNodeCodec decoding (#11287) 2019-12-03 12:30:07 +01:00
Andronik Ordian 71f4f61146 upgrade vergen to 3.0 (#11293)
* version: upgrade vergen to 3.0

* version: use vergen for target triple
2019-12-02 22:18:44 +01:00
Jim Posen c7219aae30
Upgrade trie-db to 0.16.0. (#11274)
* Upgrade trie-db to 0.16.0.

* Respond to review comments.
2019-11-21 11:08:49 +01:00
David eb565a7e2b
Add a benchmark for snapshot::account::to_fat_rlps() (#11185)
* Add a benchmark for snapshot::account::to_fat_rlps()

`to_fat_rlps()` is a hot call during snapshots. I don't think it has a perf problem per se, but better to have benchmark for it.

The data used is a piece of Ropsten data sized to the ~95% percentile of account size on that network.

* Benchmark with more chunks, including mainnet data

* whitespace

* Move `used_code` inside the benchmark iteration

* Revert "Move `used_code` inside the benchmark iteration"

This reverts commit cff33ab30acbd1c009e745f646f1cc655ee01d8c.
2019-11-15 12:27:24 +01:00
Seun LanLege 887aa62fdb Make InstantSeal Instant again (#11186)
* Make InstantSeal Instant again

* update_sealing if there are transactions in pool after impoerting a block, some line formatting

* Apply suggestions from code review

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* InstantSeal specific behaviour

* introduce engine.should_reseal_on_update, remove InstantSealService

* remove unused code

* add force param to update_sealing

* better docc

* even better docs

* revert code changes, doc corrections, sort dep

* code optimization

* fix test

* fix bench
2019-11-10 11:41:31 +01:00
Niklas Adolfsson 13729a0f7f [builtin]: support `multiple prices and activations` in chain spec (#11039)
* [builtin]: impl new builtin type

Have an enum to deserialize either a builtin of a single price or several prices

* [builtin]: style cleanup

* [builtin]: fix tests

* [builtin]: replace boxing with wrapper enum

* cleanup

* fix: make it backward compatible with old builtin

* fix: update chain specs

* fix: revert use of `type alias` on enum

The CI doesn't use the latest rust.

This commit reverts that change

* fix: builtin tests

* fix: revert use of `type alias` on enum

* [basic-authority]: update test-chainspec

* fix failing tests

* [builtin]: multi-prices add `info field`

It might be hard to read chain specs with several activations points.
This commit introduces a `info` field which may be used to write some
information about the current activation such as:

`Istanbul hardfork EIP-1108` or something similar.

* fix: bad rebase

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

* fix(grumbles): make it backward compatible

* grumbles: resolve `NOTE`

* revert chain specs changes

* rename test

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

* [builtin docs]: price -> Fixed price

Co-Authored-By: Andronik Ordian <write@reusable.software>

* [json]: address naming grumbles

InnerPricing -> PricingInner
PriceWithActivationAt -> PricingAt

* docs: revert changes for `AltBn128ConstOperations`

* [json]: usize -> u64

Use explicit types to cope with platform dependent issues for `usize`

* grumble: simplify `spec_backward_compability.json`

* docs: add issue link to `TODO`

* [builtin]: replace `match` with `map`

* [builtin]: add deprecation message `eip1108` params

* nits

* [json spec tests]: fix json indentation

* [json docs]: fix typos

* [json]: `compability layer` + deser to BTreeMap

Previously we had to match `Pricing::Single` and `PricingMulti` which this fixes.
It does by introducing a compability layer and into() implemenentation.

In addition, I switched the deserialization to `BTreeMap` instead of `Vec`.
That changes the format of the chain spec again

* [json]: rename `BuiltinCombat` -> `BuiltinCompat`

* Update ethcore/builtin/src/lib.rs

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

* [json builtin]: improve docs

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

* [json builtin]: improve docs

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

* chore(builtin): sort dependencies

* [json builtin]: deprecate `eip1108` params

* [machine]: add bench for calling builtin contract

* [machine]: reduce calls to `Builtin::is_active`

* [builtin]: fix nits

* [json]: revert breakage of chain specs

* [json builtin]: remove `eip1108` params

* [chain specs]: update to new format

* [machine]: revert changes

* [devp2p]: revert change

* [builtin]: doc nits
2019-10-31 17:09:08 +01:00
David 8c2199dd2a
Snapshot restoration overhaul (#11219)
* Comments and todos
Use `snapshot_sync` as logging target

* fix compilation

* More todos, more logs

* Fix picking snapshot peer: prefer the one with the highest block number
More docs, comments, todos

* Adjust WAIT_PEERS_TIMEOUT to be a multiple of MAINTAIN_SYNC_TIMER to try to fix snapshot startup problems
Docs, todos, comments

* Tabs

* Formatting

* Don't build new rlp::EMPTY_LIST_RLP instances

* Dial down debug logging

* Don't warn about missing hashes in the manifest: it's normal
Log client version on peer connect

* Cleanup

* Do not skip snapshots further away than 30k block from the highest block seen

Currently we look for peers that seed snapshots that are close to the highest block seen on the network (where "close" means withing 30k blocks). When a node starts up we wait for some time (5sec, increased here to 10sec) to let peers connect and if we have found a suitable peer to sync a snapshot from at the end of that delay, we start the download; if none is found and --warp-barrier is used we stall, otherwise we start a slow-sync.
When looking for a suitable snapshot, we use the highest block seen on the network to check if a peer has a snapshot that is within 30k blocks of that highest block number. This means that in a situation where all available snapshots are older than that, we will often fail to start a snapshot at all. What's worse is that the longer we delay starting a snapshot sync (to let more peers connect, in the hope of finding a good snapshot), the more likely we are to have seen a high block and thus the more likely we become to accept a snapshot.
This commit removes this comparison with the highest blocknumber criteria entirely and picks the best snapshot we find in 10sec.

* lockfile

* Add a `ChunkType::Dupe` variant so that we do not disconnect a peer if they happen to send us a duplicate chunk (just ignore the chunk and keep going)
Resolve some documentation todos, add more

* tweak log message

* Don't warp sync twice
Check if our own block is beyond the given warp barrier (can happen after we've completed a warp sync but are not quite yet synced up to the tip) and if so, don't sync.
More docs, resolve todos.
Dial down some `sync` debug level logging to trace

* Avoid iterating over all snapshot block/state hashes to find the next work item

Use a HashSet instead of a Vec and remove items from the set as chunks are processed. Calculate and store the total number of chunks in the `Snapshot`  struct instead of counting pending chunks each time.

* Address review grumbles

* Log correct number of bytes written to disk

* Revert ChunkType::Dup change

* whitespace grumble

* Cleanup debugging code

* Fix docs

* Fix import and a typo

* Fix test impl

* Use `indexmap::IndexSet` to ensure chunk hashes are accessed in order

* Revert increased SNAPSHOT_MANIFEST_TIMEOUT: 5sec should be enough
2019-10-31 16:07:21 +01:00
David 0d3423cbe0
Use a lock instead of atomics for snapshot Progress (#11197)
* WIP. Typos and logging.

* Format todos

* Pause pruning while a snapshot is under way
Logs, docs and todos

* Allocate memory for the full chunk

* Name snapshotting threads

* Ensure `taking_snapshot` is set to false whenever and however `take_snapshot`returns
Rename `take_at` to `request_snapshot_at`
Cleanup

* Let "in_progress" deletion fail
Fix tests

* Just use an atomic

* Review grumbles

* Finish the sentence

* Resolve a few todos and clarify comments.

* Calculate progress rate since last update

* Lockfile

* Fix tests

* typo

* Reinstate default snapshotting frequency
Cut down on the logging noise

* Use a lock instead of atomics for snapshot Progress

* Update ethcore/types/src/snapshot.rs

Co-Authored-By: Andronik Ordian <write@reusable.software>

* Avoid truncating cast
Cleanup
2019-10-28 18:24:45 +01:00
David 2c97bcc1a4 Upgrade jsonrpc to latest (#11206) 2019-10-26 11:26:04 +02:00
David ffeaee778c
Pause pruning while snapshotting (#11178)
* WIP. Typos and logging.

* Format todos

* Pause pruning while a snapshot is under way
Logs, docs and todos

* Allocate memory for the full chunk

* Name snapshotting threads

* Ensure `taking_snapshot` is set to false whenever and however `take_snapshot`returns
Rename `take_at` to `request_snapshot_at`
Cleanup

* Let "in_progress" deletion fail
Fix tests

* Just use an atomic

* Review grumbles

* Finish the sentence

* Resolve a few todos and clarify comments.

* Calculate progress rate since last update

* Lockfile

* Fix tests

* typo

* Reinstate default snapshotting frequency
Cut down on the logging noise

* address grumble

* Log memory use with `journal_size()` and explain why.
2019-10-24 16:46:32 +02:00
Anton Gavrilov 834585d61b
Crypto primitives removed from ethkey (#11174)
* Crypto utils removed from ethkey

* Fix ethkey lib

* Switch ethsore to new crypto

* Accounts crate fixed

* Secret store crate switched to new crypto

* Ethcore builtin fixed

* Accounts crate fixed

* Ethcore crate fixed

* Util network fixed

* Util network-devp2p fixed

* Private tx fixed

* Ethcore sync fixed

* Secret store fixed

* Rpc fixed

* Parity fixed

* Ethkey cli fixed

* Local store fixed

* Ethcore blockchain fixed

* Cargo.lock pushed; doc comment added for reversed nonce

* Ethstore tests fixed

* Ethstore cli fixed

* Miner fixed

* Snapshot tests are fixed

* Single brackets removed

* Machine fixed

* Verification fixed

* Executive state fixed

* More single brackets removed

* Update version of parity-crypto

* Use published version 0.4.2 of parity-crypto

* New test in tx_filter fixed
2019-10-23 13:03:46 +02:00
Niklas Adolfsson 6960d35abb [dependencies]: jsonrpc `14.0.1` (#11183)
Closing #11169
2019-10-19 14:14:25 +02:00
Niklas Adolfsson 2d2513b35a [dependencies] bump rand 0.7 (#11022)
* network-devp2p: bump rand `0.7`

* updater: bump rand `0.7`

* hash-fetch: bump rand `0.7`

* ethcore-sync: bump rand `0.7`

* rpc: dont work yet

* [private-tx] remove unused rand

* [ethcore-snapshot] bump rand 0.7

* [engine clique]: bump rand 0.7

* [engine authority-round]: remove rand

* [ethcore-blockchain]: bump rand 0.7

* [ethcore]: bump rand 0.7

* [ethcore-light]: bump rand 0.7

* [ethstore]: bump rand 0.7

* Fix for rand usage in rpc

* [rpc]: fix test build

* [ethcore-sync]: fix test build

* [snapshot tests]: rand 0.7

* [ethkey]: bump rand 0.7

* [rpc]: resolve TODO incompatible `rand versions`

* [ethkey] use `rust-secp256k1` master branch

* fix(bad merge): ethcoore-light remove itertools

* [rpc tests]: revert rpc test changes in #11139

`#11139` makes use a different `RNG/seed`, not `H64::random_using(&mut self.rand)`

This commit reverts the changed tests (the generated id by `Subscribers::next_id`)

* [ethkey/random]: resolve introduced `TODO`
2019-10-18 15:12:16 +02:00
David 9d313e31e6 Upgrade to jsonrpc v14 (#11151)
* Upgrade to jsonrpc v14

Contains https://github.com/paritytech/jsonrpc/pull/495 with good bugfixes to resource usage.

* Bump tokio & futures.

* Bump even further.

* Upgrade tokio to 0.1.22

* Partially revert "Bump tokio & futures."

This reverts commit 100907eb91907aa124d856d52374637256118e86.
2019-10-10 15:56:22 +01:00
Andy Weiss a404dd5415 Use TryFrom instead of From+panic for Builtin (#11140)
* Use TryFrom instead of From+panic for Builtin

* fix tests

* change expect text to be more descriptive

* fix formatting
2019-10-09 14:42:03 +02:00
Anton Gavrilov f48780c29b
Update ethereum types to 0.8.0 version (#11139)
* Ethereum types updated to 0.8 version

* Fix for rand usage in rpc

* Cargo lock fixed after rebase

* TODO added
2019-10-08 14:18:44 +02:00
David ca329078f5
EIP-712: bump version in prep for publishing (#11106)
* version 0.1.1

* lock file
2019-10-03 19:34:06 +02:00
Toby Dimmick 79a17dedd0 Deduplicate registrar contract & calling logic (#11110)
* Rename RegistryInfo -> RegistryInfoDeprecated

* Add BlockId parameter to Registrar::get_address and RegistrarClient::call_contract

* Remove RegistrarClient::Call (use async for now); add RegistrarClient::get_address

* Remove Registrar type in favour of naked trait

* Use CallContract trait bound instead of separate call_contract method

* Make RegistrarClient::get_address and URLHint::resolve synchronous

* RegistrarClient::get_address: return check if address is zero

* Modify RegistryInfo::registry_address to take &str

* return Result from RegistryInfo::registry_address

* Replace RegistryInfo with RegistrarClient

- Modifed RegistrarClient::registrar_address to return Option
- Removed BlockChainClient::registrar_address

* Fix other build configs

* Fix unit test builds

* Remove local RegistrarClient type from run::execute_impl

* Remove registrar.json from ethcore

* Formatting/line breaks

* Update RegistrarClient docs, remove explicit lifetime

* Weak ref to ethcore client from hash fetch client

* Fix unit tests
2019-10-03 15:15:25 +02:00
Seun LanLege f24bff5998
SIMD Implementation for EIP-152 (#11056)
* simd implementation

* adds benchmarks

* Update util/EIP-152/src/avx.rs

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

* enable avx 😅

* better benchmark, docs

* rename avx to avx2, compile on android

* fix android again

* remove ifunc, code formatting

* license

* nits

* docs, nits

* fix test
2019-10-02 14:32:21 +01:00
David fcd042a487
Update to latest jsonrpc (#11111)
* Update to latest jsonrpc

* Fix percent_encoding not re-exported from url anymore
2019-10-02 10:25:51 +02:00
Seun LanLege 8471b91002
Correct EIP-712 encoding (#11092)
* support encoding custom array types as fields

* new line

* removed expect

* Update util/EIP-712/src/encode.rs

Co-Authored-By: Andronik Ordian <write@reusable.software>

* bump lunarity

* update cargo lock

* nits

* nits
2019-09-30 22:16:30 +01:00
David 2b8b8851ab Update `kvdb`, `kvdb-rocksdb` and `h2` (#11091)
* Update a few dependencies

Updates two dependencies: `kvdb-rocksdb` and `h2`. Brings in `parking_lot 0.9` which is unintended but possibly fine.

* Bump parking_lot to 0.9
Bump kvdb-memorydb to 0.2 (from git atm)

* New kvdb-memorydb is not breaking

* Remove [patch]
2019-09-27 23:29:14 +02:00
Andronik Ordian fc22c58408
[ethash] remove manual unrolling (#11069)
* [ethash] remove unroll in calculate_dag_item

* [ethash] add keccak bench

* [ethash] remove unroll! completely

* [ethash] specify required-features for benches

* [ethcore/verification] specify required-features for benches

* [CI] simplify cargo-check-benches step
2019-09-24 11:45:28 +02:00
Niklas Adolfsson acad59b300 [sync]: remove unused dependencies or make dev (#11061) 2019-09-16 21:56:53 +02:00
Andronik Ordian 0659cb8592 cargo update -p eth-secp256k1 (#11052) 2019-09-13 19:48:51 +02:00
Niklas Adolfsson eb81168674 [ethcore]: cleanup dependencies (#11043) 2019-09-12 22:56:59 +02:00
Nicolas Gotchac 5e2def1b23
Fix parallel transactions race-condition (#10995)
* WiP : clear pending txs cache & tick in Miner

* Fixed pending transactions

* Revert debugging code

* Add ToDo comment

* Remove commented-out code

* Reverse LTO setting

* WiP

* Try to seal a new block if there are pending transactions

* Try resealing only for internal imports

* Remove logging

* Use AtomicU64 instead of Mutex<BlockNumber>

* Remove TxQueue cache clear // Update AtomicUint logic

* Update comments in Miner

* Revert import of `parking_lot`

* Update `transaction-pool` dependency

* Call directly `update_sealing`

* Call `update_sealing` directly
2019-09-11 18:44:31 +02:00
Niklas Adolfsson 240ef46c72
[ethcore]: make it compile without `test-helpers` feature (#11036)
* [ethcore]: rustc_hex not longer `optional`

Used by `ethcore/client/client` when importing blocks

* [ethcore-types]: `DataFormat` add docs + tabify

* fix(grumbles): bump `rustc-hex = 2`
2019-09-11 17:35:50 +02:00
David f4d14e271f Benchmarks for block verification (#11035)
* WIP

* wip

* Benchmarks for block verification

Uses real blocks from mainnet to benchmark the `verify_*` family of methods in the `verification` module.

Also exposes the `TestBlockChain` in a test helper.

* Cleanup, fix CI

* Bash syntax error

* One more try

* Fix review grumbles
	Revert unwanted changes
	Tweak CI benchmark checks
2019-09-11 14:15:19 +02:00
David 48629c2bd4
Move snapshot related traits to their proper place (#11012)
* Move snapshot to own crate
Sort out imports

* WIP cargo toml

* Make snapshotting generic over the client
Sort out tests

* Sort out types from blockchain and client

* Sort out sync

* Sort out imports and generics

* Sort out main binary

* Fix sync test-helpers

* Sort out import for secret-store

* Sort out more imports

* Fix easy todos

* cleanup

* Move SnapshotClient and SnapshotWriter to their proper places
Sort out the circular dependency between snapshot and ethcore by moving all snapshot tests to own crate, snapshot-tests

* cleanup

* Cleanup

* fix merge issues

* Update ethcore/snapshot/snapshot-tests/Cargo.toml

Co-Authored-By: Andronik Ordian <write@reusable.software>

* Sort out botched merge

* Ensure snapshot-tests run

* Docs

* Fix grumbles
2019-09-10 22:44:33 +02:00
Niklas Adolfsson d311bebaee cleanup json crate (#11027)
* [json]: cleanup

write something here....

* nit: commit new/moved files

* nit: remove needless features

* nits

* fix(grumbles): use explicit import `DifficultyTest`

* fix(grumbles): remove needless type hints

* fix(grumble): docs `from -> used by`

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

* fix(grumbles): use explicit `imports`

* fix(grumble): merge `tx` and `tx_with_signing_info`

* fix(grumbles): resolve introduced `TODO's`
2019-09-10 20:46:50 +02:00
David d8d7abc848 Add blake2_f precompile (#11017)
* feat: implement eip1108

* doc nit: price per point pair

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

* fix: test-build

* fix: update chain specs

* fix: basic_authority.json chain spec

* fix: change `eip_transition == 0x7fffffffffffff`

* Merge na-eip1108

* Pre-compile plumbing

* Use type alias instead of struct

* Extract the data from incoming EVM call and forward it to blake2_f

* Fetch parity-common from git for now

* Fix broken cost impl
Add remaining test vectors

* cleanup

* Trailing comma in json spec

* Update ethcore/builtin/src/lib.rs

Co-Authored-By: Andronik Ordian <write@reusable.software>

* Update ethcore/builtin/src/lib.rs

Co-Authored-By: Andronik Ordian <write@reusable.software>

* Rename pricer to be Blake2-specific
Return a cost of u32::MAX if conversion fails
Fix docs and todos

* Fix error handling in cost()

* fix chainspec

* EIP-152 crate

* Update ethcore/builtin/src/lib.rs

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

* Address grumbles

* Update ethcore/builtin/src/lib.rs

Co-Authored-By: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Switch tests to use hex!

* remove parity-crypto from git

* Sort out the SIGMA

* Prefer arrays to vecs

* Update util/EIP-152/src/lib.rs

Co-Authored-By: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Update json/src/spec/builtin.rs

Co-Authored-By: Andronik Ordian <write@reusable.software>

* Update json/src/spec/builtin.rs

Co-Authored-By: Andronik Ordian <write@reusable.software>

* Review feedback

* Do not change chainspecs yet

* Do not assume endianess: precompile output is LE
2019-09-10 00:26:45 +02:00
Niklas Adolfsson 53e590f54b fix: remove unused error-chain (#11028) 2019-09-09 09:55:06 +02:00
Niklas Adolfsson a4969ca498 fix: remove needless use of itertools (#11029)
* Remove needless use of `itertools` in `ethcore-light`
* Replace `itertools:🔁:call` with `std::iter::repeat_with`
2019-09-08 14:30:54 +02:00
Toby Dimmick 680807e601 Convert `std::test` benchmarks to use Criterion (#10999)
* Convert std::test benches to Criterion

* Required feature for ethash benches

* gitlab-ci: Check all bench targets

* check ethash benches

* evmbin/benches/mod.rs: Update bench sample command

Co-Authored-By: Andronik Ordian <write@reusable.software>

* Upgrade to criterion 0.3
2019-09-05 19:28:01 +02:00
Niklas Adolfsson 8c286125e6
[private-tx] remove unused rand (#11024) 2019-09-05 13:26:28 +02:00
David d193ddde19
Extract snapshot to own crate (#11010)
* Move snapshot to own crate
Sort out imports

* WIP cargo toml

* Make snapshotting generic over the client
Sort out tests

* Sort out types from blockchain and client

* Sort out sync

* Sort out imports and generics

* Sort out main binary

* Fix sync test-helpers

* Sort out import for secret-store

* Sort out more imports

* Fix easy todos

* cleanup

* Cleanup

* remove unneded workspace member

* cleanup

* Sort out test-helpers dependency on account-db

* Update ethcore/client-traits/src/lib.rs

Co-Authored-By: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Update ethcore/snapshot/Cargo.toml
2019-09-03 11:29:25 +02:00
David 5ce249ac64 EIP-1344 Add CHAINID op-code (#10983)
* Add client-traits crate
Move the BlockInfo trait to new crate

* New crate `machine`
Contains code extracted from ethcore that defines `Machine`, `Externalities` and other execution related code.

* Use new machine and client-traits crates in ethcore

* Use new crates machine and client-traits instead of ethcore where appropriate

* Fix tests

* Don't re-export so many types from ethcore::client

* Fixing more fallout from removing re-export

* fix test

* More fallout from not re-exporting types

* Add some docs

* cleanup

* import the macro edition style

* Tweak docs

* Add missing import

* remove unused ethabi_derive imports

* Use latest ethabi-contract

* Move many traits from ethcore/client/traits to client-traits crate
Initial version of extracted Engine trait

* Move snapshot related traits to the engine crate (eew)

* Move a few snapshot related types to common_types
Cleanup Executed as exported from machine crate

* fix warning

* Gradually introduce new engine crate: snapshot

* ethcore typechecks with new engine crate

* Sort out types outside ethcore

* Add an EpochVerifier to ethash and use that in Engine.epoch_verifier()
Cleanup

* Document pub members

* Sort out tests
Sort out default impls for EpochVerifier

* Add test-helpers feature and move EngineSigner impl to the right place

* Sort out tests

* Sort out tests and refactor verification types

* Fix missing traits

* More missing traits
Fix Histogram

* Fix tests and cleanup

* cleanup

* Put back needed logger import

* Don't rexport common_types from ethcore/src/client
Don't export ethcore::client::*

* Remove files no longer used
Use types from the engine crate
Explicit exports from engine::engine

* Get rid of itertools

* Move a few more traits from ethcore to client-traits: BlockChainReset, ScheduleInfo, StateClient

* Move ProvingBlockChainClient to client-traits

* Don't re-export ForkChoice and Transition from ethcore

* Address grumbles: sort imports, remove commented out code

* Fix merge resolution error

* Extract the Clique engine to own crate

* Extract NullEngine and the block_reward module from ethcore

* Extract InstantSeal engine to own crate

* Extract remaining engines

* Extract executive_state to own crate so it can be used by engine crates

* Remove snapshot stuff from the engine crate

* Put snapshot traits back in ethcore

* cleanup

* Remove stuff from ethcore

* Don't use itertools

* itertools in aura is legit-ish

* More post-merge fixes

* Re-export less types in client

* cleanup

* Extract spec to own crate

* Put back the test-helpers from basic-authority

* Fix ethcore benchmarks

* Reduce the public api of ethcore/verification

* WIP

* Add Cargo.toml

* Fix compilation outside ethcore

* Audit uses of import_verified_blocks() and remove unneeded calls
Cleanup

* cleanup

* Remove unused imports from ethcore

* Cleanup

* remove double semi-colons

* Add missing generic param

* More missing generics

* Update ethcore/block-reward/Cargo.toml

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update ethcore/engines/basic-authority/Cargo.toml

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update ethcore/engines/ethash/Cargo.toml

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update ethcore/engines/clique/src/lib.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* signers is already a ref

* Add an EngineType enum to tighten up Engine.name()

* Add CHAINID opcode

* Introduce Snapshotting enum to distinguish the type of snapshots a chain uses

* Rename supports_warp to snapshot_mode

* Missing import

* Add chain_id wherever we instantiate EnvInfo

* more missing chain_id

* Tell serde to ignore the chain_id field on Env

* Update ethcore/src/snapshot/consensus/mod.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Use the chain_id from the machine by adding chain_id() to the Ext trait

* cleanup

* add missing impl
cleanup

* missing import

* Fix import

* Add transition marker for EIP 1344

* double semi

* Fix merge problem

* cleanup

* merge conflict error

* Fix a few warnings

* Update ethcore/vm/src/schedule.rs

Co-Authored-By: Andronik Ordian <write@reusable.software>

* more merge fallout
2019-08-28 16:15:50 +02:00
David cd26526868
Make ClientIoMessage generic over the Client (#10981)
* Add client-traits crate
Move the BlockInfo trait to new crate

* New crate `machine`
Contains code extracted from ethcore that defines `Machine`, `Externalities` and other execution related code.

* Use new machine and client-traits crates in ethcore

* Use new crates machine and client-traits instead of ethcore where appropriate

* Fix tests

* Don't re-export so many types from ethcore::client

* Fixing more fallout from removing re-export

* fix test

* More fallout from not re-exporting types

* Add some docs

* cleanup

* import the macro edition style

* Tweak docs

* Add missing import

* remove unused ethabi_derive imports

* Use latest ethabi-contract

* Move many traits from ethcore/client/traits to client-traits crate
Initial version of extracted Engine trait

* Move snapshot related traits to the engine crate (eew)

* Move a few snapshot related types to common_types
Cleanup Executed as exported from machine crate

* fix warning

* Gradually introduce new engine crate: snapshot

* ethcore typechecks with new engine crate

* Sort out types outside ethcore

* Add an EpochVerifier to ethash and use that in Engine.epoch_verifier()
Cleanup

* Document pub members

* Sort out tests
Sort out default impls for EpochVerifier

* Add test-helpers feature and move EngineSigner impl to the right place

* Sort out tests

* Sort out tests and refactor verification types

* Fix missing traits

* More missing traits
Fix Histogram

* Fix tests and cleanup

* cleanup

* Put back needed logger import

* Don't rexport common_types from ethcore/src/client
Don't export ethcore::client::*

* Remove files no longer used
Use types from the engine crate
Explicit exports from engine::engine

* Get rid of itertools

* Move a few more traits from ethcore to client-traits: BlockChainReset, ScheduleInfo, StateClient

* Move ProvingBlockChainClient to client-traits

* Don't re-export ForkChoice and Transition from ethcore

* Address grumbles: sort imports, remove commented out code

* Fix merge resolution error

* Extract the Clique engine to own crate

* Extract NullEngine and the block_reward module from ethcore

* Extract InstantSeal engine to own crate

* Extract remaining engines

* Extract executive_state to own crate so it can be used by engine crates

* Remove snapshot stuff from the engine crate

* Put snapshot traits back in ethcore

* cleanup

* Remove stuff from ethcore

* Don't use itertools

* itertools in aura is legit-ish

* More post-merge fixes

* Re-export less types in client

* cleanup

* Extract spec to own crate

* Put back the test-helpers from basic-authority

* Fix ethcore benchmarks

* Reduce the public api of ethcore/verification

* WIP

* Add Cargo.toml

* Fix compilation outside ethcore

* Audit uses of import_verified_blocks() and remove unneeded calls
Cleanup

* cleanup

* Remove unused imports from ethcore

* Cleanup

* remove double semi-colons

* Add missing generic param

* More missing generics

* Update ethcore/block-reward/Cargo.toml

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update ethcore/engines/basic-authority/Cargo.toml

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update ethcore/engines/ethash/Cargo.toml

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update ethcore/engines/clique/src/lib.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* signers is already a ref

* Add an EngineType enum to tighten up Engine.name()

* Introduce Snapshotting enum to distinguish the type of snapshots a chain uses

* Rename supports_warp to snapshot_mode

* Missing import

* Update ethcore/src/snapshot/consensus/mod.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* missing import

* Fix import

* double semi

* Fix merge problem

* cleanup

* Parametrise `ClientIoMessage` with `()` for the light client

* Add impl Tick for ()

* Address review feedback

* Move ClientIoMessage to common-types

* remove superseeded fixme

* fix merge conflict errors
2019-08-28 10:09:42 +02:00
Niklas Adolfsson 974b24549b bump spin to 0.5.2 (#10996)
patch vulnerability https://github.com/RustSec/advisory-db/pull/132
2019-08-27 23:59:39 +02:00
David fbf425c4e2 Extract spec to own crate (#10978)
* Add client-traits crate
Move the BlockInfo trait to new crate

* New crate `machine`
Contains code extracted from ethcore that defines `Machine`, `Externalities` and other execution related code.

* Use new machine and client-traits crates in ethcore

* Use new crates machine and client-traits instead of ethcore where appropriate

* Fix tests

* Don't re-export so many types from ethcore::client

* Fixing more fallout from removing re-export

* fix test

* More fallout from not re-exporting types

* Add some docs

* cleanup

* import the macro edition style

* Tweak docs

* Add missing import

* remove unused ethabi_derive imports

* Use latest ethabi-contract

* Move many traits from ethcore/client/traits to client-traits crate
Initial version of extracted Engine trait

* Move snapshot related traits to the engine crate (eew)

* Move a few snapshot related types to common_types
Cleanup Executed as exported from machine crate

* fix warning

* Gradually introduce new engine crate: snapshot

* ethcore typechecks with new engine crate

* Sort out types outside ethcore

* Add an EpochVerifier to ethash and use that in Engine.epoch_verifier()
Cleanup

* Document pub members

* Sort out tests
Sort out default impls for EpochVerifier

* Add test-helpers feature and move EngineSigner impl to the right place

* Sort out tests

* Sort out tests and refactor verification types

* Fix missing traits

* More missing traits
Fix Histogram

* Fix tests and cleanup

* cleanup

* Put back needed logger import

* Don't rexport common_types from ethcore/src/client
Don't export ethcore::client::*

* Remove files no longer used
Use types from the engine crate
Explicit exports from engine::engine

* Get rid of itertools

* Move a few more traits from ethcore to client-traits: BlockChainReset, ScheduleInfo, StateClient

* Move ProvingBlockChainClient to client-traits

* Don't re-export ForkChoice and Transition from ethcore

* Address grumbles: sort imports, remove commented out code

* Fix merge resolution error

* Extract the Clique engine to own crate

* Extract NullEngine and the block_reward module from ethcore

* Extract InstantSeal engine to own crate

* Extract remaining engines

* Extract executive_state to own crate so it can be used by engine crates

* Remove snapshot stuff from the engine crate

* Put snapshot traits back in ethcore

* cleanup

* Remove stuff from ethcore

* Don't use itertools

* itertools in aura is legit-ish

* More post-merge fixes

* Re-export less types in client

* cleanup

* Extract spec to own crate

* Put back the test-helpers from basic-authority

* Fix ethcore benchmarks

* Reduce the public api of ethcore/verification

* Update ethcore/block-reward/Cargo.toml

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update ethcore/engines/basic-authority/Cargo.toml

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update ethcore/engines/ethash/Cargo.toml

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update ethcore/engines/clique/src/lib.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* signers is already a ref

* Add an EngineType enum to tighten up Engine.name()

* Introduce Snapshotting enum to distinguish the type of snapshots a chain uses

* Rename supports_warp to snapshot_mode

* Missing import

* Update ethcore/src/snapshot/consensus/mod.rs

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* missing import

* Fix import

* double semi
2019-08-23 15:32:58 +02:00