openethereum/ethcore/res
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
..
contracts Tx permission contract improvement (#8400) 2018-06-12 09:31:14 +02:00
ethereum Enable all Constantinople hard fork changes in constantinople_test.json (#9505) 2018-09-12 02:08:23 +08:00
tx_permission_tests ethcore: add transition flag for transaction permission contract (#9275) 2018-08-07 15:18:19 +01:00
wasm-tests@0edbf860ff Allow dropping light client RPC query with no results (#9318) 2018-09-12 11:47:01 +02:00
authority_round.json Enable byzantium features on non-ethash chains (#7753) 2018-02-01 13:42:56 +01:00
authority_round_block_reward_contract.json Refactor EIP150, EIP160 and EIP161 forks to be specified in CommonParams (#8614) 2018-05-22 12:24:09 +08:00
authority_round_empty_steps.json Aura: Broadcast empty step messages instead of creating empty blocks (#7605) 2018-02-15 01:39:29 +01:00
basic_authority.json Enable byzantium features on non-ethash chains (#7753) 2018-02-01 13:42:56 +01:00
constructor.json Enable byzantium features on non-ethash chains (#7753) 2018-02-01 13:42:56 +01:00
instant_seal.json Support millisecond timestamp for instant seal engine (#9469) 2018-09-06 11:38:00 +02:00
null.json Add EIP-1014 transition config flag (#9268) 2018-08-31 23:43:51 +08:00
null_morden.json Generalize engine trait (#6591) 2017-09-26 14:19:08 +02:00
null_morden_with_reward.json Generalize engine trait (#6591) 2017-09-26 14:19:08 +02:00
tendermint.json Enable byzantium features on non-ethash chains (#7753) 2018-02-01 13:42:56 +01:00
validator_contract.json Move more params to the common section. (#6134) 2017-07-31 12:34:29 +02:00
validator_multi.json Move more params to the common section. (#6134) 2017-07-31 12:34:29 +02:00
validator_safe_contract.json Chainspec validation (#6197) 2017-08-02 12:50:36 +02:00