Conversation
| { | ||
| let proving_backend = proving_backend::ProvingBackend::new(trie_backend); | ||
| let mut extensions = Extensions::new(); | ||
| if let Some(keystore) = keystore { |
There was a problem hiding this comment.
Do we really need keystore here? If that can be invoked from the network context (i.e. light client requesting to prove some execution) we can end up signing something with a local key and giving it back as a response.
| { | ||
| let mut extensions = Extensions::new(); | ||
| if let Some(keystore) = keystore { | ||
| extensions.register(keystore); |
primitives/sr-io/with_std.rs
Outdated
| } | ||
|
|
||
| impl OffchainApi for () { | ||
| fn submit_transaction(data: Vec<u8>) -> Result<(), ()> { |
There was a problem hiding this comment.
This file is not used anymore. It was probably readded in your big refactoring pr.
andresilva
left a comment
There was a problem hiding this comment.
lgtm. so for my use case I should just provide a client to the grandpa code that has already pre-registered all the necessary extensions, so as to avoid introducing those types into the grandpa crate (e.g. transaction pool).
your comments regarding unnecessary registration of keystore extensions are also pertinent.
| side_effects_handler: Option<OffchainExt>, | ||
| recorder: &Option<ProofRecorder<Block>>, | ||
| enable_keystore: bool, | ||
| extensions: Option<Extensions>, |
| pub mod notifications; | ||
|
|
||
| pub use error::*; | ||
| // TODO: avoid re-exports |
There was a problem hiding this comment.
Should this have been handled?
This PR is an attempt to clean up how we deal with externalities extensions for offchain calls (i.e. the additional APIs available for some contexts), namely:
OffchainWorkerextensions,TransactionPoolandKeystore.Instead of passing things separately this PR introduces a
ExecutionExtensionsidea, where allExternalitiesExtensionscan be registered (avoiding cycles though). Later on in the call stack we passExtensionsinstead of arbitraryOption<KeystorePtr>orOption<OffchainExt>stuff.This cleans up some APIs and also avoids uneccesary direct dependencies.
CC @andresilva - finally :)