@@ -22,7 +22,6 @@ use sc_client_api::BlockBackend;
2222use sc_consensus_aura:: { CompatibilityMode , ImportQueueParams , SlotProportion , StartAuraParams } ;
2323use sc_consensus_grandpa:: SharedVoterState ;
2424pub use sc_executor:: NativeElseWasmExecutor ;
25- use sc_keystore:: LocalKeystore ;
2625use sc_service:: { error:: Error as ServiceError , Configuration , TaskManager } ;
2726use sc_telemetry:: { Telemetry , TelemetryWorker } ;
2827use sp_consensus_aura:: sr25519:: AuthorityPair as AuraPair ;
@@ -78,10 +77,6 @@ pub fn new_partial(
7877 > ,
7978 ServiceError ,
8079> {
81- if config. keystore_remote . is_some ( ) {
82- return Err ( ServiceError :: Other ( "Remote Keystores are not supported." . into ( ) ) )
83- }
84-
8580 let telemetry = config
8681 . telemetry_endpoints
8782 . clone ( )
@@ -175,13 +170,6 @@ pub fn new_partial(
175170 } )
176171}
177172
178- fn remote_keystore ( _url : & str ) -> Result < Arc < LocalKeystore > , & ' static str > {
179- // FIXME: here would the concrete keystore be built,
180- // must return a concrete type (NOT `LocalKeystore`) that
181- // implements `CryptoStore` and `SyncCryptoStore`
182- Err ( "Remote Keystore not supported." )
183- }
184-
185173/// Builds a new service for a full client.
186174pub fn new_full ( mut config : Configuration ) -> Result < TaskManager , ServiceError > {
187175 use sc_network_common:: sync:: warp:: WarpSyncParams ;
@@ -191,22 +179,12 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
191179 backend,
192180 mut task_manager,
193181 import_queue,
194- mut keystore_container,
182+ keystore_container,
195183 select_chain,
196184 transaction_pool,
197185 other : ( block_import, grandpa_link, beefy_voter_links, beefy_rpc_links, mut telemetry) ,
198186 } = new_partial ( & config) ?;
199187
200- if let Some ( url) = & config. keystore_remote {
201- match remote_keystore ( url) {
202- Ok ( k) => keystore_container. set_remote_keystore ( k) ,
203- Err ( e) =>
204- return Err ( ServiceError :: Other ( format ! (
205- "Error hooking up remote keystore for {url}: {e}"
206- ) ) ) ,
207- } ;
208- }
209-
210188 let genesis_hash = client. block_hash ( 0 ) . ok ( ) . flatten ( ) . expect ( "Genesis block exists; qed" ) ;
211189
212190 // Note: GrandPa is pushed before the Polkadot-specific protocols. This doesn't change
@@ -332,7 +310,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
332310 let _rpc_handlers = sc_service:: spawn_tasks ( sc_service:: SpawnTasksParams {
333311 network : network. clone ( ) ,
334312 client : client. clone ( ) ,
335- keystore : keystore_container. sync_keystore ( ) ,
313+ keystore : keystore_container. keystore ( ) ,
336314 task_manager : & mut task_manager,
337315 transaction_pool : transaction_pool. clone ( ) ,
338316 sync_service : sync_service. clone ( ) ,
@@ -375,7 +353,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
375353 } ,
376354 force_authoring,
377355 backoff_authoring_blocks,
378- keystore : keystore_container. sync_keystore ( ) ,
356+ keystore : keystore_container. keystore ( ) ,
379357 sync_oracle : sync_service. clone ( ) ,
380358 justification_sync_link : sync_service. clone ( ) ,
381359 block_proposal_slot_portion : SlotProportion :: new ( 2f32 / 3f32 ) ,
@@ -394,8 +372,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
394372
395373 // if the node isn't actively participating in consensus then it doesn't
396374 // need a keystore, regardless of which protocol we use below.
397- let keystore =
398- if role. is_authority ( ) { Some ( keystore_container. sync_keystore ( ) ) } else { None } ;
375+ let keystore = if role. is_authority ( ) { Some ( keystore_container. keystore ( ) ) } else { None } ;
399376
400377 let justifications_protocol_name = beefy_on_demand_justifications_handler. protocol_name ( ) ;
401378 let payload_provider = sp_consensus_beefy:: mmr:: MmrRootProvider :: new ( client. clone ( ) ) ;
0 commit comments