openethereum/rpc/src/v1/impls
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
..
light Allow dropping light client RPC query with no results (#9318) 2018-09-12 11:47:01 +02:00
debug.rs Bad blocks RPC + reporting (#9433) 2018-09-08 04:04:28 +02:00
eth.rs Only check warp syncing for eth_getWorks (#9484) 2018-09-11 01:53:42 +08:00
eth_filter.rs Implement EIP234 block_hash for eth_getLogs (#9256) 2018-08-13 15:47:10 +08:00
eth_pubsub.rs Implement EIP234 block_hash for eth_getLogs (#9256) 2018-08-13 15:47:10 +08:00
mod.rs Bad blocks RPC + reporting (#9433) 2018-09-08 04:04:28 +02:00
net.rs Update `license header` and `scripts` (#8666) 2018-06-04 10:19:50 +02:00
parity.rs Remove all dapp permissions related settings (#9120) 2018-08-07 20:52:23 +08:00
parity_accounts.rs Remove all dapp permissions related settings (#9120) 2018-08-07 20:52:23 +08:00
parity_set.rs Comply EIP-86 with the new definition (#9140) 2018-08-01 13:17:04 +02:00
personal.rs Remove all dapp permissions related settings (#9120) 2018-08-07 20:52:23 +08:00
private.rs Remove all dapp permissions related settings (#9120) 2018-08-07 20:52:23 +08:00
pubsub.rs Update `license header` and `scripts` (#8666) 2018-06-04 10:19:50 +02:00
rpc.rs Update `license header` and `scripts` (#8666) 2018-06-04 10:19:50 +02:00
secretstore.rs Add type for passwords. (#8920) 2018-06-22 15:09:15 +02:00
signer.rs Add type for passwords. (#8920) 2018-06-22 15:09:15 +02:00
signing.rs Remove all dapp permissions related settings (#9120) 2018-08-07 20:52:23 +08:00
signing_unsafe.rs Remove all dapp permissions related settings (#9120) 2018-08-07 20:52:23 +08:00
traces.rs Remove all dapp permissions related settings (#9120) 2018-08-07 20:52:23 +08:00
web3.rs Update `license header` and `scripts` (#8666) 2018-06-04 10:19:50 +02:00