Commit Graph

79 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
Niklas Adolfsson 407de5e8c4 fix(light): make `OnDemand` generic instead of using the concrete type (#10514)
* ethcore: add clique engine (#9981)

* fix broken sync

* correct seal fields

* ethcore: fix comment

* parity: remove duplicate params

* clique: fix whitespaces

* ethcore: fix goerli chain spec

* refactor signer_snapshot into pending/finalized state

* move close_block_extra_data after seal is applied

* refactor most of the logic into the signer_snapshot

* clique: refactor locking logic out of the consensus engine interface

* Fix jsonspec and add an unittest

* Replace space with tabs

* Unbroke sync

* Fix broken sync

* 1/2 state tracking without votes

* 2/2 implement vote tracking

* ci: use travis for goerli

* ci: setup a clique network

* ci: sync a görli node

* add clique deploy script

* ci: fix paths in clique deploy script

* ci: use docker compose

* ci: fix travis job names

* ci: fix build deps

* ci: massively reduce tests

* Revert "ci: massively reduce tests"

This reverts commit 6369f0b069ed2607a7e9f2e1d85489bacdc43384.

* ci: run cargo test directly

* ci: separate build and test stages

* ci: cache rust installation

* ci: simplify ci stages

* ci: make clique deploy script executable

* ci: shutdown goerli sync after 20min

* ci: remove slow sync stage

* ci: use timeout to finish jobs

* ci: fix build path

* ci: use absolute paths to end this confusion

* ci: add geth and parity to path

* ci: be more verbose

* ci: allow for more relaxed caching timeout

* ci: update repositories for custom ppa

* ci: fix typo in file name

* ci: fix docker compose file

* ci: add ethkey to docker

* ci: make sure deploy script is up to date with upstream

* ci: stop docker container after certain time

* ci: force superuser to update permissions on docker files

* ci: reduce run time of script to ~30 min

* ci: remove duplicate caching in travis

* remove trace statements

* clique: add more validation involving the recent signer list

* ethcore: enable constantinople for rinkeby

* ethcore: fix whitespaces in rinkeby spec

* ethcore: reformat goerli.json

* Revert "ci: remove duplicate caching in travis"

This reverts commit a562838d3d194d37f9871dcbe00b783637978f89.

* tmp commit

* another tmp commit

* it builds!

* add sealing capabilities

* add seal_header hook to allow separation of block seal/importing code paths

* clique: remove populate_from_parent.

* add panic

* make turn delay random

* initialize OpenBlock properly in 'enact'

* misc: remove duplicate lines

* misc: fix license headers

* misc: convert spaces to tabs

* misc: fix tabs

* Update Cargo.toml

* Update Cargo.toml

* Update Cargo.toml

* clique: ensure validator restores state before trying to seal

* clique: make 'state' return an Error.  Make some error messages more clear

* Fix compile error after rebase & toolchain upgrade

* fix a bunch of import warnings

* Refactor code

* Fix permissions

* Refactoring syncing

* Implement full validator checks

* Refactor util functions to seperate file

* mining 1

* ethcore: add chainspec for kotti

* ethcore: rename pre-goerli configs

* ethcore: load kotti chain spec

* cli: add kotti to params

* Implement working local sealing

* making sealing & syncing work together

* Relax timestamp checking

* ethcore: prepare for the real goerli to launch

* Implement NOTURN wiggle properly & cleanupnup warnings

* Implement vote casting

* Update docs & skip signing if no signer

* Optimize step-service interval

* Record state on local sealed block

* Fix script filemode

* Cleaning up codebase

* restore enact trace logging

* Delete clique.sh and move sync.sh

* remove travis.yml

* Remove dead code

* Cleanup compile warning

* address review comments

* adding more comments and removing unwrap()

* ci: remove sync script

* Address review comments

* fix compile error

* adding better debugging for timing

* Implement an dedicated thread for sealing timing

* fix(add helper for timestamp overflows) (#10330)

* fix(add helper timestamp overflows)

* fix(simplify code)

* fix(make helper private)

* snap: official image / test (#10168)

* official image / test

* fix / test

* bit more necromancy

* fix paths

* add source bin/df /test

* add source bin/df /test2

* something w paths /test

* something w paths /test

* add source-type /test

* show paths /test

* copy plugin /test

* plugin -> nil

* install rhash

* no questions while installing rhash

* publish snap only for release

* fix(docker): fix not receives SIGINT (#10059)

* fix(docker): fix not receives SIGINT

* fix: update with reviews

* update with review

* update

* update

* Don't add discovery initiators to the node table (#10305)

* Don't add discovery initiators to the node table

* Use enums for tracking state of the nodes in discovery

* Dont try to ping ourselves

* Fix minor nits

* Update timeouts when observing an outdated node

* Extracted update_bucket_record from update_node

* Fixed typo

* Fix two final nits from @todr

* change docker image based on debian instead of ubuntu due to the chan… (#10336)

* change docker image based on debian instead of ubuntu due to the changes of the build container

* role back docker build image and docker deploy image to ubuntu:xenial based (#10338)

* Bundle protocol and packet_id together in chain sync (#10315)

Define a new `enum` where devp2p subprotocol packet ids (currently eth and par) are defined. Additionally provide functionality to query id value and protocol of a given id object.

* snap: prefix version and populate candidate channel (#10343)

* snap: populate candidate releases with beta snaps to avoid stale channel

* snap: prefix version with v*

* addressing review comments

* engine: fix copyright header

* scripts: restore permissions on sign command

* ethcore: enforce tabs

* ethcore: enforce tabs

* ethcore: enforce tabs

* addressing comments

* addressing comments

* addressing more comments

* addressing more comments

* addressing more comments

* addressing more comments

* addressing more comments

* json-spec: fix clique epoch to non-zero u64

* ci: enable travis for parity goerli

* ci: don't separate build and test step

* ci: don't run c++ tests on travis

* ci: simplify cargo test to squeeze into travis timeout

* ci: don't run tests on travis at all

* style(fixes)

* fix(add tests)

* fix(recent_signer bug)

* fix(complete all tests)

* fix(nits)

* fix(simplify asserts)

* fix(cliqueState): simplify code

* fix(nits)

* docs(comments what's need to fixed)

* fix(revert unintended changes)

* fix(tests)

* fix(logs): voting logs

* fix(readability + more logs)

* fix(sync)

* docs(add missing licens header)

* fix(log): info! -> trace!

* docs(fix nits) + fix(remove assert)

* perf(use counter instead of vec)

* fix(remove needless block in match)

* fix(faulty comment)

* grumbles(docs for tests)

* fix(nits)

* fix(revert_vote): only remove vote when votes == 0

* fix(vote counter): checked arithmetics

* fix(simplify tests)

* fix(nits)

* fix(clique): err types

* fix(clique utils): make use of errors

* fix(cleanup nits)

* fix(clique sealing): don't read state no signer

* fix(replace Vec<Signers> with BTreeSet<Signers>)

* fix(tests): BTreeSet and more generic helpers

* fix(nits)

* fix(ethcore_block_seal): remove needless `Box`

* fix(faulty log): info -> trace

* fix(checked SystemTime): prevent SystemTime panics

* style(chain cfg): space after `:`

* style(fn enact): fix whitespace

* docs(clique): StepService

* docs(nit): fix faulty comment

* docs(fix typo)

* style(fix bad indentation)

* fix(bad regex match)

* grumble(on_seal_block): make `&mut` to avoid clone

* docs(on_seal_block): fix faulty documentation

* Delete .travis.yml

* docs: remove eth hf references in spec

* Update client.rs

* fix(nits)

* fix(clique step): `RwLock` -> `AtomicBool`

* fix(clique): use `Duration::as_millis`

* Clean up some Clique documentation

* Add trace information to eth_estimateGas (#10519)

* Add trace information to eth_estimateGas

* replace unwrap better version

* change vm::Error formatter to more user-friendly

* remove extra error format

* use map_or instead sequence of map/unwrap_or

* fix(light/on_demand): extract as a trait

* fix(grumble): OnDemand remove needless trait bound
2019-03-27 14:46:20 +01:00
Niklas Adolfsson 91933d857d perf(ethcore): `micro-opt` (#10405)
Mostly fixes that changes `eagerly eval` to `lazy eval`
2019-03-06 15:30:35 +01:00
Andrew Jones 97cb010df8 Silence Error::cause deprecations (#10438) 2019-03-02 13:18:18 +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
Andronik Ordian dc3b1ecdd0 light(on_demand): decrease default time window to 10 secs (#10016)
* light(on_demand): decrease default time window to 10 secs

* light(on_demand): use secs units for cli options
2018-12-05 19:17:26 +08:00
Niklas Adolfsson 7fb33796b1 light client : failsafe crate (circuit breaker) (#9790)
* refactor(light) : N/W calls with `circuit breaker`

* fix(nits) : forgot to commit new files

* Add tests and change CLI args

* Address grumbles

* fix(failsafe-rs) : Santize input to prevent panics

* chore(failsafe) : bump failsafe, (parking_lot)

Bump failsafe to v0.3.0 to enable `parking_lot::Mutex` instead
`spin::Mutex`

* Remove `success_rate`

* feat(circuit_breaker logger)

* feat(CLI): separate CLI args request and response

* Fix tests

* Error response provide request kind

When a reponse `times-out` provide the actual request or requests that failed

* Update ethcore/light/src/on_demand/mod.rs

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

* Update ethcore/light/src/on_demand/mod.rs

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

* fix(grumbles): formatting nit

* fix(grumbles)

* Use second resolution on CLI args
* Use `consecutive failure policy` instead of `timeOverWindow`
* Add a couple of tests for `request_guard`

* fix(request_guard): off-by-one error, update tests
2018-12-05 10:36:53 +01:00
cheme 61f4534e2a Allow dropping light client RPC query with no results (#9318)
* OnDemand no longer loop until there is a query.
All peer known at the time will be queried, and the query fail if all
return no reply.
Returning the failure is done through an empty Vec of reply (the type
of the oneshot channel remains unchanged).
Before this commit the query were send randomly to any peer until there
is a reply (for a query that got no result it was an issue, for other
queries it was quering multiple times the same peers).
After this commit the first query is random but next queries
follows hashmap iterator order.

Test no_capability was broken by this commit (the pending query was
removed).

* OnDemand no longer loop until there is a query.
All peer known at the time will be queried, and the query fail if all
return no reply.
Returning the failure is done through an empty Vec of reply (the type
of the oneshot channel remains unchanged).
Before this commit the query were send randomly to any peer until there
is a reply (for a query that got no result it was an issue, for other
queries it was quering multiple times the same peers).
After this commit the first query is random but next queries
follows hashmap iterator order.

Test no_capability was broken by this commit (the pending query was
removed). If adding some kind of timeout mechanism it could be restored.

* Comment plus better field names.

* No panick on dropped oneshot channel.

* Use Set to avoid counter heuristic

* Cli option `on_demand_nb_retry` for maximum number of retry when doing
on demand query in light client.

* Missing test update for previous commit

* Add a timeout (only when there is no peer to query), that way we do not
set number of query to minimum current number peer or configured number
of query : that way capability test was restored.

* Adding an error type for on_demand, it helps having variant of error
reported at rpc level : choice of rpc error code error might not be
right.

* Duration as constant is nice

* Switch to duration in main too

* Fix indentation (sorry for that).

* Fix error management (bad merge in previous commit)

* Lots of english corrections, major change on the new command parameters :
 - use standard '-' instead of '_'
 - renaming nb_retry params to 'on-demand-retry-count'
2018-09-12 11:47:01 +02:00
Niklas Adolfsson 6888a968f9 Light `clippy(fy)` (#9473)
* wasm tests

* `clippyfy` light-client

* Revert inefficient change `collect_ready()`
2018-09-06 15:44:40 +02:00
Jim Posen 9ed43230ca Better support for eth_getLogs in light mode (#9186)
* Light client on-demand request for headers range.

* Cache headers in HeaderWithAncestors response.

Also fulfills request locally if all headers are in cache.

* LightFetch::logs fetches missing headers on demand.

* LightFetch::logs limit the number of headers requested at a time.

* LightFetch::logs refactor header fetching logic.

* Enforce limit on header range length in light client logs request.

* Fix light request tests after struct change.

* Respond to review comments.
2018-08-25 23:06:01 +02:00
Niklas Adolfsson b2cf5d2958 Make `Capabilities struct` Copy (#9372) 2018-08-20 13:53:47 +03: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
Pierre Krieger 364a1fa5a8 Fix a division by zero in light client RPC handler (#7917) 2018-02-17 21:54:39 +01:00
Pierre Krieger 2c60a53fef Randomize the peer we dispatch to (#7844) 2018-02-08 21:36:46 +01:00
Robert Habermeier 2c426defd9
remove check_hangup hack now that is_canceled exists (#7620) 2018-01-18 18:19:04 +01:00
Robert Habermeier c7aed335ce update back-references more aggressively after answering from cache (#7578) 2018-01-17 09:45:36 +01:00
Robert Habermeier b010fb5004 Light Client: fetch transactions/receipts by transaction hash (#6641)
* rpc: transaction/receipt requests made async

* rpc: light client fetches transaction and uncle by hash/index

* on_demand: request type for transaction index

* serve transaction index requests in light protocol

* add a test for transaction index serving

* fetch transaction and receipts by hash on light client

* fix decoding tests

* light: more lenient cost table parsing (backwards compatible)

* fix tests and warnings

* LES -> PIP

* Update provider.rs

* proper doc comments for public functions
2017-10-08 18:19:27 +02:00
Lorenzo Manacorda 5f025cc1b8
Rename Requests to Batch 2017-09-24 20:09:30 +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
Robert Habermeier 372779915f Merge branch 'master' into light-poa 2017-09-04 12:30:37 +02:00
Hawstein 7b8af30590 remove re-export of parking_lot in util (#6435) 2017-09-02 20:09:13 +02:00
Robert Habermeier 2ff3dff6ea serve epoch signals over network and check them 2017-08-23 15:37:35 +02:00
Robert Habermeier 70ef33f6fe Light client improvements (#6156)
* no seal checking

* import command and --no-seal-check for light client

* fix eth_call

* tweak registry dapps lookup

* ignore failed requests to non-server peers
2017-07-27 13:50:12 +02:00
Vurich 17de29e69a Prevent disconnect from within handler (and style cleanup) 2017-06-30 12:10:12 +02:00
Vurich 5eba9078fc Report whether a peer was kept from `Handler::on_connect` 2017-06-30 11:00:32 +02:00
Robert Habermeier 386cdb830d Back-references for the on-demand service (#5573)
* header back-references for on demand

* initial back-reference implementation for on demand requests

* answer requests from cache

* answer requests from cache, add tests

* strongly typed responses for vectors of homogeneous requests

* fix fallout in RPC without optimizing
2017-05-23 12:39:25 +02:00
Robert Habermeier 2a6f38c587 removing slienced warning 2017-05-12 17:53:10 +02:00
Robert Habermeier 909f3d76d8 optimize back-reference filling 2017-05-12 17:25:02 +02:00
Robert Habermeier 68ec7ae41e tests for on_demand 2017-04-07 19:35:39 +02:00
Robert Habermeier 5793bb8fac typestrong API 2017-04-06 20:01:09 +02:00
Robert Habermeier d19232a848 use cache in on-demand again 2017-04-06 17:22:05 +02:00
Robert Habermeier 574cfae470 dispatch batched requests 2017-04-06 15:34:48 +02:00
Robert Habermeier 08d8709ef6 checked request for OnDemand 2017-04-05 18:56:01 +02:00
Robert Habermeier 35740456a4 generalize RequestBuilder 2017-04-05 15:02:44 +02:00
Robert Habermeier 1b0a369889 return default accounts from on_demand 2017-03-28 18:55:23 +02:00
Robert Habermeier 45c0a97142 fix body encoding 2017-03-23 18:52:54 +01:00
Robert Habermeier 5700f4ac81 fix block response decoding 2017-03-23 18:31:16 +01:00
Robert Habermeier 10a470a5fa better bookkeeping of requests in light sync 2017-03-23 15:44:16 +01:00
Robert Habermeier ec52a4a235 more tracing in on-demand 2017-03-23 13:24:04 +01:00
Robert Habermeier 77f036ee21 fix capabilities-interpreting error in on_demand 2017-03-23 04:38:08 +01:00
Robert Habermeier a55001ad1d fix deadlock in on_demand 2017-03-23 02:55:25 +01:00
Robert Habermeier 219eddf33e Merge branch 'master' into pip-msg 2017-03-22 13:14:28 +01:00
Tomasz Drwięga 7e87e9e8ad Updating JSON-RPC crates (#4934)
* New version of jsonrpc.

* Better invalid encoding messages

* Fixing deprecated methods of tokio_core

* Using dedicated branch for jsonrpc

* Bump
2017-03-22 07:02:14 +01:00
Robert Habermeier 7ad36ee36c Merge remote-tracking branch 'upstream/new-jsonrpc' into pip-msg 2017-03-21 21:15:06 +01:00
Robert Habermeier fe52e969b6 Merge branch 'master' into pip-msg 2017-03-21 15:24:47 +01:00
Tomasz Drwięga 958a8f66a0
Merge branch 'master' into new-jsonrpc 2017-03-21 09:35:50 +01:00
Marek Kotewicz a555686bcd rlp serialization refactor (#4873)
* fixed naming of rlp modules

* RlpStream cleanup

* appending short rlp lists (0...55 bytes) is 25% faster

* RlpStream does not use bytes module, nor trait Stream

* removed unused code from rlp module

* compiling ethcore-util with new rlp serialization

* compiling parity with new rlp serialization

* fixed compiling ethcore-light with new rlp serialization

* fixed compiling ethsync with new rlp serialization

* removed redundant comment, print

* removed redundant double-space

* replace usage of WriteBytesExt with ByteOrder
2017-03-20 19:14:29 +01:00
Robert Habermeier b5527415d6 get on_demand tests to compile 2017-03-16 20:33:45 +01:00