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

feat(rpc-client): Introduce rpc-jsonrpsee Crate #37

Merged
merged 8 commits into from
Aug 26, 2024
Merged

Conversation

refcell
Copy link
Collaborator

@refcell refcell commented Aug 25, 2024

Description

Introduces an op-alloy-rpc-jsonrpsee crate that can replace the non-type logic reth/optimism/rpc. Type logic can go in op-alloy/rpc-types.

Closes #32

@refcell refcell self-assigned this Aug 25, 2024
@refcell refcell requested a review from mattsse as a code owner August 25, 2024 13:36
@refcell
Copy link
Collaborator Author

refcell commented Aug 25, 2024

Note

Depends on sync types from #35

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

perhaps we rename this to op-alloy-jsonrpsee ?

crates/rpc-client/Cargo.toml Outdated Show resolved Hide resolved
@refcell
Copy link
Collaborator Author

refcell commented Aug 25, 2024

Note

Adds the OutputResponse type to rpc-types since it's used by the trait. Takes care of #32

@refcell refcell requested a review from mattsse August 25, 2024 15:36
@refcell refcell changed the title feat(rpc-client): Introduce rpc-client Crate feat(rpc-client): Introduce rpc-jsonrpsee Crate Aug 25, 2024
Copy link
Contributor

@HrikB HrikB left a comment

Choose a reason for hiding this comment

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

I wanna ask if it makes sense to implement a Provider here over the Optimism network. I was doing smth like this:

#[async_trait]
pub trait OpStackProvider<T: Transport + Clone = BoxTransport>: Provider<T, Optimism> {
    async fn output_at_block(&self, block_number: u64) -> TransportResult<OutputAtBlock> {
        let response = self
            .client()
            .request("optimism_outputAtBlock", (format!("0x{:x}", block_number),))
            .await?;

        Ok(response)
    }
}

impl<T: Transport + Clone> OpStackProvider<T> for RootProvider<T, Optimism> {
}

@mattsse
Copy link
Member

mattsse commented Aug 26, 2024

yep this makes sense, mind opening an issue for this?
this should go into a new provider crate

@mattsse mattsse merged commit 785014d into main Aug 26, 2024
18 checks passed
@mattsse mattsse deleted the rf/feat/rpc-client branch August 26, 2024 09:16
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.

[Feature] Rpc type for optimism_outputAtBlock
3 participants