Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ethereum RPC Data Providers #680

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

nanocryk
Copy link
Collaborator

Makes the spawning logic generic over the RuntimeApi, which allows to inject a GenerateRpcBuilder that can call runtime apis only present in specific runtimes (different in simple and frontier templates).

@@ -59,10 +60,10 @@ pub struct SpawnedContainer {
/// Used to check the reference count, if it's 0 it means the database has been closed
pub backend: std::sync::Weak<ContainerChainBackend>,
/// Used to check the reference count, if it's 0 it means that the client has been closed.
pub client: std::sync::Weak<ContainerChainClient>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unfortunate, this module only cares about the refcount so it shouldn't need this generic param everywhere... But I believe we would need unsafe code to remove it.

Copy link
Collaborator

@tmpolaczyk tmpolaczyk Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, would it work if you set the type to dyn Any? Try initializing it like this

client.clone() as Arc<dyn Any + Send + Sync>;

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=037c61acd7a0e2d8c22838710eb4fa79

@@ -1,5 +1,5 @@
[toolchain]
channel = "1.78.0"
channel = "1.79.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This alone should be a separate PR, let's use the same version as polkadot-sdk has in the stable2407 branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants