diff --git a/parity/cli/mod.rs b/parity/cli/mod.rs index d83b205ce..8718b0b57 100644 --- a/parity/cli/mod.rs +++ b/parity/cli/mod.rs @@ -503,6 +503,10 @@ usage! { "--jsonrpc-max-payload=[MB]", "Specify maximum size for HTTP JSON-RPC requests in megabytes.", + ARG arg_poll_lifetime: (u32) = 60u32, or |c: &Config| c.rpc.as_ref()?.poll_lifetime.clone(), + "--poll-lifetime=[S]", + "Set the RPC filter lifetime to S seconds. The filter has to be polled at least every S seconds , otherwise it is removed.", + ["API and Console Options – WebSockets"] FLAG flag_no_ws: (bool) = false, or |c: &Config| c.websockets.as_ref()?.disable.clone(), "--no-ws", @@ -757,10 +761,6 @@ usage! { "--gas-price-percentile=[PCT]", "Set PCT percentile gas price value from last 100 blocks as default gas price when sending transactions.", - ARG arg_poll_lifetime: (u32) = 60u32, or |c: &Config| c.mining.as_ref()?.poll_lifetime.clone(), - "--poll-lifetime=[S]", - "Set the lifetime of the internal index filter to S seconds.", - ARG arg_author: (Option) = None, or |c: &Config| c.mining.as_ref()?.author.clone(), "--author=[ADDRESS]", "Specify the block author (aka \"coinbase\") address for sending block rewards from sealed blocks. NOTE: MINING WILL NOT WORK WITHOUT THIS OPTION.", // Sealing/Mining Option @@ -1224,6 +1224,7 @@ struct Rpc { processing_threads: Option, max_payload: Option, keep_alive: Option, + poll_lifetime: Option, } #[derive(Default, Debug, PartialEq, Deserialize)] @@ -1316,7 +1317,6 @@ struct Mining { relay_set: Option, min_gas_price: Option, gas_price_percentile: Option, - poll_lifetime: Option, usd_per_tx: Option, usd_per_eth: Option, price_update_period: Option, @@ -1690,6 +1690,7 @@ mod tests { arg_jsonrpc_server_threads: None, arg_jsonrpc_threads: 4, arg_jsonrpc_max_payload: None, + arg_poll_lifetime: 60u32, // WS flag_no_ws: false, @@ -1751,7 +1752,6 @@ mod tests { arg_min_gas_price: Some(0u64), arg_usd_per_tx: "0.0001".into(), arg_gas_price_percentile: 50usize, - arg_poll_lifetime: 60u32, arg_usd_per_eth: "auto".into(), arg_price_update_period: "hourly".into(), arg_gas_floor_target: "8000000".into(), @@ -1965,6 +1965,7 @@ mod tests { processing_threads: None, max_payload: None, keep_alive: None, + poll_lifetime: None, }), ipc: Some(Ipc { disable: None, @@ -2021,7 +2022,6 @@ mod tests { relay_set: None, min_gas_price: None, gas_price_percentile: None, - poll_lifetime: None, usd_per_tx: None, usd_per_eth: None, price_update_period: Some("hourly".into()), diff --git a/parity/rpc_apis.rs b/parity/rpc_apis.rs index 5eafe325f..f2f1bb312 100644 --- a/parity/rpc_apis.rs +++ b/parity/rpc_apis.rs @@ -290,7 +290,6 @@ impl FullDependencies { allow_pending_receipt_query: !self.geth_compatibility, send_block_number_in_get_work: !self.geth_compatibility, gas_price_percentile: self.gas_price_percentile, - poll_lifetime: self.poll_lifetime } ); handler.extend_with(client.to_delegate()); diff --git a/rpc/src/v1/impls/eth.rs b/rpc/src/v1/impls/eth.rs index 548271f89..11e64227c 100644 --- a/rpc/src/v1/impls/eth.rs +++ b/rpc/src/v1/impls/eth.rs @@ -64,8 +64,6 @@ pub struct EthClientOptions { pub send_block_number_in_get_work: bool, /// Gas Price Percentile used as default gas price. pub gas_price_percentile: usize, - /// Set the timeout for the internal poll manager - pub poll_lifetime: u32 } impl EthClientOptions { @@ -84,7 +82,6 @@ impl Default for EthClientOptions { pending_nonce_from_queue: false, allow_pending_receipt_query: true, send_block_number_in_get_work: true, - poll_lifetime: 60u32, gas_price_percentile: 50, } } diff --git a/rpc/src/v1/tests/mocked/eth.rs b/rpc/src/v1/tests/mocked/eth.rs index a04e2b6df..1185a7509 100644 --- a/rpc/src/v1/tests/mocked/eth.rs +++ b/rpc/src/v1/tests/mocked/eth.rs @@ -94,9 +94,8 @@ impl EthTester { let hashrates = Arc::new(Mutex::new(HashMap::new())); let external_miner = Arc::new(ExternalMiner::new(hashrates.clone())); let gas_price_percentile = options.gas_price_percentile; - let poll_lifetime = options.poll_lifetime; let eth = EthClient::new(&client, &snapshot, &sync, &opt_ap, &miner, &external_miner, options).to_delegate(); - let filter = EthFilterClient::new(client.clone(), miner.clone(), poll_lifetime).to_delegate(); + let filter = EthFilterClient::new(client.clone(), miner.clone(), 60).to_delegate(); let reservations = Arc::new(Mutex::new(nonce::Reservations::new(runtime.executor()))); let dispatcher = FullDispatcher::new(client.clone(), miner.clone(), reservations, gas_price_percentile);