openethereum/parity
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
..
cli Allow dropping light client RPC query with no results (#9318) 2018-09-12 11:47:01 +02:00
db db: remove wal disabling / fast-and-loose option. (#8963) 2018-07-10 17:33:25 +02:00
light_helpers Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00
account.rs Add type for passwords. (#8920) 2018-06-22 15:09:15 +02:00
blockchain.rs Fetch parity-common crates from crates.io (#9410) 2018-09-04 20:13:51 +02:00
cache.rs Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00
configuration.rs Allow dropping light client RPC query with no results (#9318) 2018-09-12 11:47:01 +02:00
deprecated.rs Remove node-health (#9119) 2018-07-18 16:27:29 +02:00
export_hardcoded_sync.rs Remove the dapps system (#9017) 2018-07-11 12:19:54 +02:00
helpers.rs Avoid using $HOME if not necessary (#9273) 2018-08-03 09:58:59 +02:00
informant.rs Fetch parity-common crates from crates.io (#9410) 2018-09-04 20:13:51 +02:00
ipfs.rs Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00
lib.rs Fetch parity-common crates from crates.io (#9410) 2018-09-04 20:13:51 +02:00
main.rs Allow setting the panic hook with parity-clib (#9292) 2018-08-10 11:06:30 +02:00
modules.rs Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00
params.rs Add POA Networks: Core and Sokol (#9413) 2018-08-30 21:32:47 +02:00
presale.rs Add type for passwords. (#8920) 2018-06-22 15:09:15 +02:00
rpc_apis.rs Bad blocks RPC + reporting (#9433) 2018-09-08 04:04:28 +02:00
rpc.rs Remove the dapps system (#9017) 2018-07-11 12:19:54 +02:00
run.rs Allow dropping light client RPC query with no results (#9318) 2018-09-12 11:47:01 +02:00
secretstore.rs Add type for passwords. (#8920) 2018-06-22 15:09:15 +02:00
signer.rs Remove UI related settings from CLI (#8783) 2018-06-06 10:05:52 +02:00
snapshot.rs db: remove wal disabling / fast-and-loose option. (#8963) 2018-07-10 17:33:25 +02:00
stratum.rs Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00
upgrade.rs Replace std::env::home_dir() with home crate impl. (#9293) 2018-08-21 15:30:24 +02:00
user_defaults.rs parity: fix UserDefaults json parser (#9189) 2018-07-23 13:57:50 +02:00
whisper.rs Update license header and scripts (#8666) 2018-06-04 10:19:50 +02:00