-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Instantiate environment with asynchronous API #768
Conversation
…h-environment-async
| impl_name: create_runtime_str!("parity-kusama"), | ||
| authoring_version: 2, | ||
| spec_version: 1040, | ||
| spec_version: 1041, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might not be needed, CI have me an error before though.
| // Rust bug: https://github.com/rust-lang/rust/issues/24159 | ||
| sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HasherFor<Block>> + Send, | ||
| { | ||
| type CreateProposer = Pin<Box< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary for this to be Pin? In case the future is Unpin I would suggest pinning on polling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess not - I'll avoid pinning in the follow-up if possible.
montekki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| // Rust bug: https://github.com/rust-lang/rust/issues/24159 | ||
| sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HasherFor<Block>> + Send, | ||
| { | ||
| type CreateProposer = Pin<Box< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following compiles for me:
diff --git a/validation/src/lib.rs b/validation/src/lib.rs
index 860c1a6f..51f09700 100644
--- a/validation/src/lib.rs
+++ b/validation/src/lib.rs
@@ -569,9 +569,7 @@ impl<C, N, P, SC, TxPool, B> consensus::Environment<Block> for ProposerFactory<C
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HasherFor<Block>> + Send,
{
- type CreateProposer = Pin<Box<
- dyn Future<Output = Result<Self::Proposer, Self::Error>> + Send + Unpin + 'static
- >>;
+ type CreateProposer = futures::future::Ready<Result<Self::Proposer, Self::Error>>;
type Proposer = Proposer<P, TxPool, B>;
type Error = Error;
@@ -597,7 +595,7 @@ impl<C, N, P, SC, TxPool, B> consensus::Environment<Block> for ProposerFactory<C
backend: self.backend.clone(),
});
- Box::pin(future::ready(maybe_proposer))
+ future::ready(maybe_proposer)
}
}|
A follow up pull request in regards to my suggestion is fine. |
This reverts commit 989db4b.
* update latest substrate polkadot-master * fix test compilation * bump version to 0.7.18 * bump impl_version * update substrate * Revert "Instantiate environment with asynchronous API (#768)" This reverts commit 989db4b. * update substrate * remove unused parameter type * bump trie-db version for tests * fix collator test * update substrate * remove unnecessary service changes
tiny patch for paritytech/substrate#4630